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

Issue 440: Added support to run zookeeper operator as non-root #441

Merged
merged 1 commit into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ spec:
containers:
- name: post-install-upgrade-job
image: "{{ .Values.hooks.image.repository }}:{{ .Values.hooks.image.tag }}"
{{- if .Values.hooks.securityContext }}
securityContext:
{{ toYaml .Values.hooks.securityContext | indent 10 }}
{{- end }}
command:
- /scripts/validations.sh
volumeMounts:
Expand All @@ -116,4 +120,4 @@ spec:
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- end }}
7 changes: 5 additions & 2 deletions charts/zookeeper-operator/templates/pre-delete-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ metadata:
"helm.sh/hook-weight": "2"
"helm.sh/hook-delete-policy": hook-succeeded, before-hook-creation, hook-failed
spec:
backoffLimit: 1
activeDeadlineSeconds: 20
backoffLimit: 6
template:
metadata:
name: {{ template "zookeeper-operator.fullname" . }}-pre-delete
Expand All @@ -101,6 +100,10 @@ spec:
containers:
- name: pre-delete-job
image: "{{ .Values.hooks.image.repository }}:{{ .Values.hooks.image.tag }}"
{{- if .Values.hooks.securityContext }}
securityContext:
{{ toYaml .Values.hooks.securityContext | indent 12 }}
{{- end }}
command:
- /scripts/pre-delete.sh
volumeMounts:
Expand Down
10 changes: 9 additions & 1 deletion charts/zookeeper-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ image:
tag: 0.2.13
pullPolicy: IfNotPresent

securityContext: {}
# runAsUser: 1001
# runAsGroup: 1001

## Additional labels to be added to resources
labels: {}

Expand Down Expand Up @@ -56,11 +60,15 @@ hooks:
backoffLimit: 10
image:
repository: lachlanevenson/k8s-kubectl
tag: v1.16.10
tag: v1.23.2
## Whether to create pre-delete hook which ensures that
## the operator cannot be deleted till the zookeeper cluster
## custom resources have been cleaned up
delete: true
securityContext: {}
# runAsUser: 1001
# runAsGroup: 1001


## Additional Sidecars Configuration.
additionalSidecars: {}
Expand Down
4 changes: 4 additions & 0 deletions charts/zookeeper/templates/post-install-upgrade-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ spec:
containers:
- name: post-install-upgrade-job
image: "{{ .Values.hooks.image.repository }}:{{ .Values.hooks.image.tag }}"
{{- if .Values.hooks.securityContext }}
securityContext:
{{ toYaml .Values.hooks.securityContext | indent 10 }}
{{- end }}
command:
- /scripts/validations.sh
volumeMounts:
Expand Down
7 changes: 5 additions & 2 deletions charts/zookeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ config:
# autoPurgePurgeInterval: 1
# quorumListenOnAllIPs: false
# additionalConfig: {}

## configure the storage type
## accepted values : persistence/ephemeral
## default option is persistence
Expand All @@ -93,7 +93,10 @@ ephemeral:
hooks:
image:
repository: lachlanevenson/k8s-kubectl
tag: v1.16.10
tag: v1.23.2
securityContext: {}
# runAsUser: 1001
# runAsGroup: 1001
backoffLimit: 10
pod:
annotations: {}
Expand Down