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

feat(HelmChart): Add securityContext on pod level #20666

Merged
merged 2 commits into from
Jul 11, 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
2 changes: 1 addition & 1 deletion helm/superset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ maintainers:
- name: craig-rueda
email: craig@craigrueda.com
url: https://github.com/craig-rueda
version: 0.6.4
version: 0.6.5
dependencies:
- name: postgresql
version: 11.1.22
Expand Down
7 changes: 5 additions & 2 deletions helm/superset/templates/deployment-beat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ spec:
{{- end }}
securityContext:
runAsUser: {{ .Values.runAsUser }}
{{- if .Values.supersetCeleryBeat.securityContext }}
{{ toYaml .Values.supersetCeleryBeat.securityContext | nindent 8 }}
{{- if .Values.supersetCeleryBeat.podSecurityContext }}
{{ toYaml .Values.supersetCeleryBeat.podSecurityContext | nindent 8 }}
{{- end }}
{{- if .Values.supersetCeleryBeat.initContainers }}
initContainers:
Expand All @@ -78,6 +78,9 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.supersetCeleryBeat.containerSecurityContext }}
securityContext: {{ toYaml .Values.supersetCeleryBeat.containerSecurityContext | nindent 12 }}
{{- end }}
command: {{ tpl (toJson .Values.supersetCeleryBeat.command) . }}
env:
- name: "SUPERSET_PORT"
Expand Down
7 changes: 5 additions & 2 deletions helm/superset/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ spec:
{{- end }}
securityContext:
runAsUser: {{ .Values.runAsUser }}
{{- if .Values.supersetWorker.securityContext }}
{{ toYaml .Values.supersetWorker.securityContext | nindent 8 }}
{{- if .Values.supersetWorker.podSecurityContext }}
{{ toYaml .Values.supersetWorker.podSecurityContext | nindent 8 }}
{{- end }}
{{- if .Values.supersetWorker.initContainers }}
initContainers:
Expand All @@ -76,6 +76,9 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.supersetWorker.containerSecurityContext }}
securityContext: {{ toYaml .Values.supersetWorker.containerSecurityContext | nindent 12 }}
{{- end }}
command: {{ tpl (toJson .Values.supersetWorker.command) . }}
env:
- name: "SUPERSET_PORT"
Expand Down
7 changes: 5 additions & 2 deletions helm/superset/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ spec:
{{- end }}
securityContext:
runAsUser: {{ .Values.runAsUser }}
{{- if .Values.supersetNode.securityContext }}
{{ toYaml .Values.supersetNode.securityContext | nindent 8 }}
{{- if .Values.supersetNode.podSecurityContext }}
{{ toYaml .Values.supersetNode.podSecurityContext | nindent 8 }}
{{- end }}
{{- if .Values.supersetNode.initContainers }}
initContainers:
Expand All @@ -79,6 +79,9 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.supersetNode.containerSecurityContext }}
securityContext: {{ toYaml .Values.supersetNode.containerSecurityContext | nindent 12 }}
{{- end }}
command: {{ tpl (toJson .Values.supersetNode.command) . }}
env:
- name: "SUPERSET_PORT"
Expand Down
7 changes: 5 additions & 2 deletions helm/superset/templates/init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ spec:
{{- end }}
securityContext:
runAsUser: {{ .Values.runAsUser }}
{{- if .Values.init.securityContext }}
{{ toYaml .Values.init.securityContext | nindent 8 }}
{{- if .Values.init.podSecurityContext }}
{{ toYaml .Values.init.podSecurityContext | nindent 8 }}
{{- end }}
{{- if .Values.init.initContainers }}
initContainers:
Expand All @@ -64,6 +64,9 @@ spec:
name: {{ tpl . $ }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.init.containerSecurityContext }}
securityContext: {{ toYaml .Values.init.containerSecurityContext | nindent 12 }}
{{- end }}
volumeMounts:
- name: superset-config
mountPath: {{ .Values.configMountPath | quote }}
Expand Down
20 changes: 16 additions & 4 deletions helm/superset/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@
"resources": {
"type": "object"
},
"securityContext": {
"podSecurityContext": {
"type": "object"
},
"containerSecurityContext": {
"type": "object"
}
},
Expand Down Expand Up @@ -315,7 +318,10 @@
"resources": {
"type": "object"
},
"securityContext": {
"podSecurityContext": {
"type": "object"
},
"containerSecurityContext": {
"type": "object"
}
},
Expand Down Expand Up @@ -352,7 +358,10 @@
"resources": {
"type": "object"
},
"securityContext": {
"podSecurityContext": {
"type": "object"
},
"containerSecurityContext": {
"type": "object"
}
},
Expand Down Expand Up @@ -418,7 +427,10 @@
"podAnnotations": {
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/annotations"
},
"securityContext": {
"podSecurityContext": {
"type": "object"
},
"containerSecurityContext": {
"type": "object"
}
},
Expand Down
12 changes: 8 additions & 4 deletions helm/superset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ supersetNode:
# requests:
# cpu: 100m
# memory: 128Mi
securityContext: {}
podSecurityContext: {}
containerSecurityContext: {}
##
## Superset worker configuration
supersetWorker:
Expand Down Expand Up @@ -294,7 +295,8 @@ supersetWorker:
# requests:
# cpu: 100m
# memory: 128Mi
securityContext: {}
podSecurityContext: {}
containerSecurityContext: {}
##
## Superset beat configuration (to trigger scheduled jobs like reports)
supersetCeleryBeat:
Expand Down Expand Up @@ -327,7 +329,8 @@ supersetCeleryBeat:
# requests:
# cpu: 100m
# memory: 128Mi
securityContext: {}
podSecurityContext: {}
containerSecurityContext: {}
##
## Init job configuration
init:
Expand Down Expand Up @@ -391,7 +394,8 @@ init:
fi
## Annotations to be added to init job pods
podAnnotations: {}
securityContext: {}
podSecurityContext: {}
containerSecurityContext: {}
##
## Configuration values for the postgresql dependency.
## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md
Expand Down