Skip to content

Commit 02b7190

Browse files
authored
Add support for sidecar containers to zookeeper-operator (#13)
1 parent 7952bb6 commit 02b7190

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

charts/zookeeper-operator/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ The following table lists the configurable parameters of the zookeeper-operator
5353
| `nodeSelector` | Map of key-value pairs to be present as labels in the node in which the pod should run | `{}` |
5454
| `affinity` | Specifies scheduling constraints on pods | `{}` |
5555
| `tolerations` | Specifies the pod's tolerations | `[]` |
56+
| `additionalEnv` | Additional Environment Variables | `[]` |
57+
| `additionalSidecars` | Additional Sidecars Configuration | `[]` |
58+
| `additionalVolumes` | Additional volumes required for sidecars | `[]` |

charts/zookeeper-operator/templates/_helpers.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,17 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
3535
app.kubernetes.io/managed-by: {{ .Release.Service }}
3636
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
3737
{{- end -}}
38+
39+
{{/*
40+
Sidecar implementation details
41+
*/}}
42+
{{- define "chart.additionalSidecars"}}
43+
{{ toYaml .Values.additionalSidecars }}
44+
{{- end}}
45+
46+
{{/*
47+
Sidecar volume implementation details
48+
*/}}
49+
{{- define "chart.additionalVolumes"}}
50+
{{ toYaml .Values.additionalVolumes }}
51+
{{- end}}

charts/zookeeper-operator/templates/operator.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ spec:
2121
{{- end }}
2222
spec:
2323
serviceAccountName: {{ .Values.serviceAccount.name }}
24+
{{- if .Values.additionalVolumes }}
25+
volumes:
26+
{{- include "chart.additionalVolumes" . | indent 6 }}
27+
{{- end }}
2428
containers:
2529
- name: {{ template "zookeeper-operator.fullname" . }}
2630
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
@@ -39,10 +43,16 @@ spec:
3943
fieldPath: metadata.name
4044
- name: OPERATOR_NAME
4145
value: {{ template "zookeeper-operator.fullname" . }}
46+
{{- if .Values.additionalEnv }}
47+
{{ toYaml .Values.additionalEnv | indent 8 }}
48+
{{- end }}
4249
{{- if .Values.resources }}
4350
resources:
4451
{{ toYaml .Values.resources | indent 10 }}
4552
{{- end }}
53+
{{- if .Values.additionalSidecars }}
54+
{{- include "chart.additionalSidecars" . | indent 6 }}
55+
{{- end }}
4656
{{- if .Values.nodeSelector }}
4757
nodeSelector:
4858
{{ toYaml .Values.nodeSelector | indent 8 }}

charts/zookeeper-operator/values.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,18 @@ affinity: {}
4747
tolerations: []
4848
# Pod annotations
4949
annotations: {}
50+
51+
## Additional Sidecars Configuration.
52+
additionalSidecars: {}
53+
# - name: nginx
54+
# image: nginx:latest
55+
56+
## Additional Environment Variables.
57+
additionalEnv: {}
58+
59+
## Additional volumes required for sidecars.
60+
additionalVolumes: {}
61+
# - name: volume1
62+
# emptyDir: {}
63+
# - name: volume2
64+
# emptyDir: {}

0 commit comments

Comments
 (0)