Skip to content

Commit af22eab

Browse files
authored
[bitnami/haproxy] Chart standardised (#7493)
Signed-off-by: Miguel Ruiz <miruiz@vmware.com>
1 parent 4a8d223 commit af22eab

File tree

6 files changed

+177
-81
lines changed

6 files changed

+177
-81
lines changed

bitnami/haproxy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ name: haproxy
2323
sources:
2424
- https://github.com/bitnami/bitnami-docker-haproxy
2525
- https://github.com/haproxytech/haproxy
26-
version: 0.2.23
26+
version: 0.3.0

bitnami/haproxy/README.md

Lines changed: 92 additions & 76 deletions
Large diffs are not rendered by default.

bitnami/haproxy/templates/deployment.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ spec:
5353
{{- if .Values.tolerations }}
5454
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }}
5555
{{- end }}
56+
{{- if .Values.schedulerName }}
57+
schedulerName: {{ .Values.schedulerName }}
58+
{{- end }}
59+
{{- if .Values.topologySpreadConstraints }}
60+
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" .) | nindent 8 }}
61+
{{- end }}
5662
{{- if .Values.priorityClassName }}
5763
priorityClassName: {{ .Values.priorityClassName | quote }}
5864
{{- end }}
@@ -99,6 +105,21 @@ spec:
99105
resources: {{- toYaml .Values.resources | nindent 12 }}
100106
{{- end }}
101107
{{- if not .Values.diagnosticMode.enabled }}
108+
{{- if .Values.startupProbe.enabled }}
109+
startupProbe:
110+
# Using exec instead of tcpSocket to avoid noise in te logs
111+
exec:
112+
command:
113+
- pgrep
114+
- haproxy
115+
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
116+
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
117+
timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
118+
successThreshold: {{ .Values.startupProbe.successThreshold }}
119+
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
120+
{{- else if .Values.customStartupProbe }}
121+
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }}
122+
{{- end }}
102123
{{- if .Values.livenessProbe.enabled }}
103124
livenessProbe:
104125
# Using exec instead of tcpSocket to avoid noise in te logs

bitnami/haproxy/templates/service-account.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ metadata:
99
{{- if .Values.commonLabels }}
1010
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
1111
{{- end }}
12-
{{- if .Values.commonAnnotations }}
13-
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
12+
{{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }}
13+
annotations:
14+
{{- if .Values.commonAnnotations }}
15+
{{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
16+
{{- end }}
17+
{{- if .Values.serviceAccount.annotations }}
18+
{{- include "common.tplvalues.render" (dict "value" .Values.serviceAccount.annotations "context" $) | nindent 4 }}
19+
{{- end }}
1420
{{- end }}
21+
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
1522
{{- end }}

bitnami/haproxy/templates/service.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ spec:
3030
{{ if eq .Values.service.type "LoadBalancer" }}
3131
loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }}
3232
{{ end }}
33-
{{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }}
34-
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
33+
{{- if eq .Values.service.type "LoadBalancer" }}
34+
loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }}
35+
{{- end }}
36+
{{- if .Values.service.sessionAffinity }}
37+
sessionAffinity: {{ .Values.service.sessionAffinity }}
38+
{{- end }}
39+
{{- if .Values.service.sessionAffinityConfig }}
40+
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.sessionAffinityConfig "context" $) | nindent 4 }}
3541
{{- end }}
3642
ports: {{- include "common.tplvalues.render" ( dict "value" .Values.service.ports "context" $ ) | nindent 4 }}
3743
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}

bitnami/haproxy/values.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,17 @@ service:
9696
## @param service.annotations Additional custom annotations for haproxy service
9797
##
9898
annotations: {}
99+
## @param service.sessionAffinity Session Affinity for Kubernetes service, can be "None" or "ClientIP"
100+
## If "ClientIP", consecutive client requests will be directed to the same mongos Pod
101+
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
102+
##
103+
sessionAffinity: None
104+
## @param service.sessionAffinityConfig Additional settings for the sessionAffinity
105+
## sessionAffinityConfig:
106+
## clientIP:
107+
## timeoutSeconds: 300
108+
##
109+
sessionAffinityConfig: {}
99110
## @param service.labels Additional custom labels for haproxy service
100111
##
101112
labels: {}
@@ -130,6 +141,20 @@ image:
130141
replicaCount: 1
131142
## Configure extra options for haproxy containers' liveness and readiness probes
132143
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
144+
## @param startupProbe.enabled Enable startupProbe on haproxy nodes
145+
## @param startupProbe.initialDelaySeconds Initial delay seconds for startupProbe
146+
## @param startupProbe.periodSeconds Period seconds for startupProbe
147+
## @param startupProbe.timeoutSeconds Timeout seconds for startupProbe
148+
## @param startupProbe.failureThreshold Failure threshold for startupProbe
149+
## @param startupProbe.successThreshold Success threshold for startupProbe
150+
##
151+
startupProbe:
152+
enabled: false
153+
failureThreshold: 5
154+
initialDelaySeconds: 15
155+
periodSeconds: 10
156+
successThreshold: 1
157+
timeoutSeconds: 5
133158
## @param livenessProbe.enabled Enable livenessProbe on haproxy nodes
134159
## @param livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe
135160
## @param livenessProbe.periodSeconds Period seconds for livenessProbe
@@ -158,6 +183,9 @@ readinessProbe:
158183
periodSeconds: 10
159184
successThreshold: 1
160185
timeoutSeconds: 5
186+
## @param customStartupProbe Custom startupProbe that overrides the default one
187+
##
188+
customStartupProbe: {}
161189
## @param customLivenessProbe Custom livenessProbe that overrides the default one
162190
##
163191
customLivenessProbe: {}
@@ -184,10 +212,12 @@ podSecurityContext:
184212
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
185213
## @param containerSecurityContext.enabled Enabled haproxy containers' Security Context
186214
## @param containerSecurityContext.runAsUser Set haproxy containers' Security Context runAsUser
215+
## @param containerSecurityContext.runAsNonRoot Set haproxy container's Security Context runAsNonRoot
187216
##
188217
containerSecurityContext:
189218
enabled: true
190219
runAsUser: 1001
220+
runAsNonRoot: true
191221

192222
## HAProxy Pod Disruption Budget configuration
193223
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
@@ -300,6 +330,15 @@ nodeSelector: {}
300330
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
301331
##
302332
tolerations: []
333+
## @param schedulerName Name of the k8s scheduler (other than default)
334+
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
335+
##
336+
schedulerName: ""
337+
## @param topologySpreadConstraints Topology Spread Constraints for pod assignment
338+
## https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
339+
## The value is evaluated as a template
340+
##
341+
topologySpreadConstraints: []
303342
## @param updateStrategy.type haproxy statefulset strategy type
304343
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
305344
##
@@ -359,6 +398,11 @@ initContainers: []
359398
##
360399

361400
## ServiceAccount configuration
401+
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
402+
## @param serviceAccount.create Specifies whether a ServiceAccount should be created
403+
## @param serviceAccount.name Name of the service account to use. If not set and create is true, a name is generated using the fullname template.
404+
## @param serviceAccount.automountServiceAccountToken Automount service account token for the server service account
405+
## @param serviceAccount.annotations Annotations for service account. Evaluated as a template. Only used if `create` is `true`.
362406
##
363407
serviceAccount:
364408
## @param serviceAccount.create Specifies whether a ServiceAccount should be created
@@ -368,3 +412,5 @@ serviceAccount:
368412
## If not set and create is true, a name is generated using the common.names.fullname template
369413
##
370414
name: ""
415+
automountServiceAccountToken: true
416+
annotations: {}

0 commit comments

Comments
 (0)