From c0136b1a7231e70349c42cdca11505a69432d3a9 Mon Sep 17 00:00:00 2001 From: Apparao Adapureddi <82787303+adapured@users.noreply.github.com> Date: Tue, 8 Jun 2021 11:10:03 -0700 Subject: [PATCH] Adding sidecar feature to zookeeper-operator (#344) * Adding sidecar feature to zookeeper-operator * additionalSidecars and additionalVolumes moved from helper class * additionalSidecars and additionalVolumes moved from helper class Co-authored-by: ApparaoAdapuredddi --- charts/zookeeper-operator/README.md | 3 +++ charts/zookeeper-operator/templates/operator.yaml | 10 ++++++++++ charts/zookeeper-operator/values.yaml | 15 +++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/charts/zookeeper-operator/README.md b/charts/zookeeper-operator/README.md index 1d1c18e28..ba7a57bea 100644 --- a/charts/zookeeper-operator/README.md +++ b/charts/zookeeper-operator/README.md @@ -53,3 +53,6 @@ The following table lists the configurable parameters of the zookeeper-operator | `nodeSelector` | Map of key-value pairs to be present as labels in the node in which the pod should run | `{}` | | `affinity` | Specifies scheduling constraints on pods | `{}` | | `tolerations` | Specifies the pod's tolerations | `[]` | +| `additionalEnv` | Additional Environment Variables | `[]` | +| `additionalSidecars` | Additional Sidecars Configuration | `[]` | +| `additionalVolumes` | Additional volumes required for sidecars | `[]` | diff --git a/charts/zookeeper-operator/templates/operator.yaml b/charts/zookeeper-operator/templates/operator.yaml index 22f921d49..1176d9741 100644 --- a/charts/zookeeper-operator/templates/operator.yaml +++ b/charts/zookeeper-operator/templates/operator.yaml @@ -21,6 +21,10 @@ spec: {{- end }} spec: serviceAccountName: {{ .Values.serviceAccount.name }} + {{- if .Values.additionalVolumes }} + volumes: +{{ toYaml .Values.additionalVolumes | indent 6 }} + {{- end }} containers: - name: {{ template "zookeeper-operator.fullname" . }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -39,10 +43,16 @@ spec: fieldPath: metadata.name - name: OPERATOR_NAME value: {{ template "zookeeper-operator.fullname" . }} + {{- if .Values.additionalEnv }} +{{ toYaml .Values.additionalEnv | indent 8 }} + {{- end }} {{- if .Values.resources }} resources: {{ toYaml .Values.resources | indent 10 }} {{- end }} + {{- if .Values.additionalSidecars }} +{{ toYaml .Values.additionalSidecars | indent 6 }} + {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} diff --git a/charts/zookeeper-operator/values.yaml b/charts/zookeeper-operator/values.yaml index 582d7e4aa..2140d8bad 100644 --- a/charts/zookeeper-operator/values.yaml +++ b/charts/zookeeper-operator/values.yaml @@ -58,3 +58,18 @@ hooks: ## the operator cannot be deleted till the zookeeper cluster ## custom resources have been cleaned up delete: true + +## Additional Sidecars Configuration. +additionalSidecars: {} +# - name: nginx +# image: nginx:latest + +## Additional Environment Variables. +additionalEnv: {} + +## Additional volumes required for sidecars. +additionalVolumes: {} +# - name: volume1 +# emptyDir: {} +# - name: volume2 +# emptyDir: {}