Skip to content

Commit 3764565

Browse files
authored
Add support for sidecar containers to kafka-operator (#32)
1 parent a0670f0 commit 3764565

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

charts/kafka-operator/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,6 @@ Parameter | Description | Default
8282
`webhook.enabled` | Operator will activate the admission webhooks for custom resources | `true`
8383
`webhook.certs.generate` | Helm chart will generate cert for the webhook | `true`
8484
`webhook.certs.secret` | Helm chart will use the secret name applied here for the cert | `kafka-operator-serving-cert`
85+
`additionalEnv` | Additional Environment Variables | `[]`
86+
`additionalSidecars` | Additional Sidecars Configuration | `[]`
87+
`additionalVolumes` | Additional volumes required for sidecars | `[]`

charts/kafka-operator/templates/_helpers.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,17 @@ Compute operator prometheus metrics auth proxy service account
5252
{{ default "default" .Values.prometheusMetrics.authProxy.serviceAccount.name }}
5353
{{- end -}}
5454
{{- end -}}
55+
56+
{{/*
57+
Sidecar implementation details
58+
*/}}
59+
{{- define "chart.additionalSidecars"}}
60+
{{ toYaml .Values.additionalSidecars }}
61+
{{- end}}
62+
63+
{{/*
64+
Sidecar volume implementation details
65+
*/}}
66+
{{- define "chart.additionalVolumes"}}
67+
{{ toYaml .Values.additionalVolumes }}
68+
{{- end}}

charts/kafka-operator/templates/operator-deployment-with-webhook.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ spec:
127127
secret:
128128
secretName: {{ .Values.operator.vaultSecret }}
129129
{{- end }}
130+
{{- if .Values.additionalVolumes }}
131+
{{- include "chart.additionalVolumes" . | indent 8 }}
132+
{{- end }}
130133
containers:
131134
{{- if and .Values.prometheusMetrics.enabled .Values.prometheusMetrics.authProxy.enabled }}
132135
- name: kube-rbac-proxy
@@ -167,6 +170,9 @@ spec:
167170
valueFrom:
168171
fieldRef:
169172
fieldPath: metadata.namespace
173+
{{- if .Values.additionalEnv }}
174+
{{ toYaml .Values.additionalEnv | indent 12 }}
175+
{{- end }}
170176
{{- if .Values.operator.vaultAddress }}
171177
- name: VAULT_ADDR
172178
value: {{ .Values.operator.vaultAddress }}
@@ -200,6 +206,9 @@ spec:
200206
{{- end }}
201207
resources:
202208
{{ toYaml .Values.operator.resources | nindent 12 }}
209+
{{- if .Values.additionalSidecars }}
210+
{{- include "chart.additionalSidecars" . | indent 8 }}
211+
{{- end }}
203212
{{- with .Values.nodeSelector }}
204213
nodeSelector:
205214
{{ toYaml . | indent 8 }}

charts/kafka-operator/values.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,18 @@ nodeSelector: {}
7272
tolerations: []
7373

7474
affinity: {}
75+
76+
## Additional Sidecars Configuration.
77+
additionalSidecars: {}
78+
# - name: nginx
79+
# image: nginx:latest
80+
81+
## Additional Environment Variables.
82+
additionalEnv: {}
83+
84+
## Additional volumes required for sidecars.
85+
additionalVolumes: {}
86+
# - name: volume1
87+
# emptyDir: {}
88+
# - name: volume2
89+
# emptyDir: {}

0 commit comments

Comments
 (0)