Skip to content

Commit 16ca92c

Browse files
committed
Add support for LoadBalancer controller service type. Add
loadBalancerSourceRanges and loadBalancerSourceRanges to controller service spec. Signed-off-by: Dinko Korunic <[email protected]>
1 parent 8c9adce commit 16ca92c

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

kubernetes-ingress/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v1
22
name: kubernetes-ingress
3-
version: 0.3.0
3+
version: 0.4.0
44
kubeVersion: ">=1.12.0-0"
55
description: A Helm chart for HAProxy Kubernetes Ingress Controller
66
keywords:

kubernetes-ingress/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
HAProxy Kubernetes Ingress Controller has been successfully installed.
22

33
Controller image deployed is: "{{ .Values.controller.image.repository }}:{{ tpl .Values.controller.image.tag . }}".
4-
Your controller is running in "{{ .Values.controller.kind }}" mode.
4+
Your controller is of a "{{ .Values.controller.kind }}" kind. Your controller service is running as a "{{ .Values.controller.service.type }}" type.
55
{{- if and .Values.rbac.create}}
66
RBAC authorization is enabled.
77
{{- else}}

kubernetes-ingress/templates/controller-service.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ metadata:
1616
{{ $key }}: {{ $value | quote }}
1717
{{- end }}
1818
spec:
19+
{{ with .Values.controller.service.clusterIP }}clusterIP: {{ . }}{{ end }}
1920
type: {{ .Values.controller.service.type }}
2021
ports:
2122
- name: http
@@ -37,3 +38,13 @@ spec:
3738
{{- if .Values.controller.service.externalIPs }}
3839
{{ toYaml .Values.controller.service.externalIPs | indent 4 }}
3940
{{- end -}}
41+
{{- if (eq .Values.controller.service.type "LoadBalancer") }}
42+
{{- if .Values.controller.service.loadBalancerIP }}
43+
loadBalancerIP: "{{ .Values.controller.service.loadBalancerIP }}"
44+
{{- end }}
45+
{{- if .Values.controller.service.loadBalancerSourceRanges }}
46+
loadBalancerSourceRanges:
47+
{{ toYaml .Values.controller.service.loadBalancerSourceRanges | indent 4 }}
48+
{{- end }}
49+
{{- end }}
50+

kubernetes-ingress/values.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ controller:
102102
## Controller Service configuration
103103
## ref: https://kubernetes.io/docs/concepts/services-networking/service/
104104
service:
105-
type: NodePort
105+
type: NodePort # can be 'NodePort' or 'LoadBalancer'
106106

107107
## Service annotations
108108
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
@@ -129,6 +129,18 @@ controller:
129129
## Expose service via external IPs that route to one or more cluster nodes
130130
externalIPs: []
131131

132+
## LoadBalancer IP
133+
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
134+
loadBalancerIP: ""
135+
136+
## Source IP ranges permitted to access Network Load Balancer
137+
# ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
138+
loadBalancerSourceRanges: []
139+
140+
## Service ClusterIP
141+
## ref: https://kubernetes.io/docs/concepts/services-networking/service/
142+
# clusterIP: ""
143+
132144
## Controller DaemonSet configuration
133145
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
134146
daemonset:

0 commit comments

Comments
 (0)