Skip to content

Commit

Permalink
Add support for LoadBalancer controller service type. Add
Browse files Browse the repository at this point in the history
loadBalancerSourceRanges and loadBalancerSourceRanges to controller
service spec.

Signed-off-by: Dinko Korunic <[email protected]>
  • Loading branch information
dkorunic committed Dec 24, 2019
1 parent 8c9adce commit 16ca92c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kubernetes-ingress/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: kubernetes-ingress
version: 0.3.0
version: 0.4.0
kubeVersion: ">=1.12.0-0"
description: A Helm chart for HAProxy Kubernetes Ingress Controller
keywords:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes-ingress/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
HAProxy Kubernetes Ingress Controller has been successfully installed.

Controller image deployed is: "{{ .Values.controller.image.repository }}:{{ tpl .Values.controller.image.tag . }}".
Your controller is running in "{{ .Values.controller.kind }}" mode.
Your controller is of a "{{ .Values.controller.kind }}" kind. Your controller service is running as a "{{ .Values.controller.service.type }}" type.
{{- if and .Values.rbac.create}}
RBAC authorization is enabled.
{{- else}}
Expand Down
11 changes: 11 additions & 0 deletions kubernetes-ingress/templates/controller-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{ with .Values.controller.service.clusterIP }}clusterIP: {{ . }}{{ end }}
type: {{ .Values.controller.service.type }}
ports:
- name: http
Expand All @@ -37,3 +38,13 @@ spec:
{{- if .Values.controller.service.externalIPs }}
{{ toYaml .Values.controller.service.externalIPs | indent 4 }}
{{- end -}}
{{- if (eq .Values.controller.service.type "LoadBalancer") }}
{{- if .Values.controller.service.loadBalancerIP }}
loadBalancerIP: "{{ .Values.controller.service.loadBalancerIP }}"
{{- end }}
{{- if .Values.controller.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.controller.service.loadBalancerSourceRanges | indent 4 }}
{{- end }}
{{- end }}

14 changes: 13 additions & 1 deletion kubernetes-ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ controller:
## Controller Service configuration
## ref: https://kubernetes.io/docs/concepts/services-networking/service/
service:
type: NodePort
type: NodePort # can be 'NodePort' or 'LoadBalancer'

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

## LoadBalancer IP
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
loadBalancerIP: ""

## Source IP ranges permitted to access Network Load Balancer
# ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
loadBalancerSourceRanges: []

## Service ClusterIP
## ref: https://kubernetes.io/docs/concepts/services-networking/service/
# clusterIP: ""

## Controller DaemonSet configuration
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
daemonset:
Expand Down

0 comments on commit 16ca92c

Please sign in to comment.