Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding sidecar feature to zookeeper-operator #344

Merged
merged 4 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions charts/zookeeper-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `[]` |
14 changes: 14 additions & 0 deletions charts/zookeeper-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4948,3 +4948,17 @@ openAPIV3Schema:
type: object
type: object
{{- end }}

{{/*
Sidecar implementation details
*/}}
{{- define "chart.additionalSidecars"}}
{{ toYaml .Values.additionalSidecars }}
{{- end}}

{{/*
Sidecar volume implementation details
*/}}
{{- define "chart.additionalVolumes"}}
{{ toYaml .Values.additionalVolumes }}
{{- end}}
10 changes: 10 additions & 0 deletions charts/zookeeper-operator/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- if .Values.additionalVolumes }}
volumes:
{{- include "chart.additionalVolumes" . | indent 6 }}
{{- end }}
containers:
- name: {{ template "zookeeper-operator.fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand All @@ -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 }}
{{- include "chart.additionalSidecars" . | indent 6 }}
{{- end }}
adapured marked this conversation as resolved.
Show resolved Hide resolved
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
Expand Down
15 changes: 15 additions & 0 deletions charts/zookeeper-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}