Skip to content

Commit

Permalink
Allow setting securityContext to false (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxachun authored Mar 23, 2022
1 parent c17c0e5 commit b9c76ec
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helm/charts/hydra-maester/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ spec:
{{- toYaml .Values.deployment.resources | nindent 12 }}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
{{- if .Values.deployment.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- end }}
serviceAccountName: {{ include "hydra-maester.fullname" . }}-account
automountServiceAccountToken: {{ .Values.deployment.automountServiceAccountToken }}
{{- if .Values.priorityClassName }}
Expand Down
4 changes: 4 additions & 0 deletions helm/charts/hydra/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ spec:
containers:
{{- if .Values.watcher.enabled }}
- name: watcher
{{- if .Values.deployment.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- end }}
image: {{ .Values.watcher.image }}
command:
- /bin/bash
Expand Down Expand Up @@ -153,8 +155,10 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.deployment.resources | nindent 12 }}
{{- if .Values.deployment.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- end }}
lifecycle:
{{- toYaml .Values.deployment.lifecycle | nindent 12 }}
{{- if .Values.deployment.extraContainers }}
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/hydra/templates/job-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ spec:
lifecycle:
{{ tpl .Values.job.lifecycle . | indent 10 }}
{{- end }}
{{- if .Values.deployment.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 10 }}
{{- end }}
{{- if .Values.deployment.extraVolumeMounts }}
volumeMounts:
{{ toYaml .Values.deployment.extraVolumeMounts | indent 10 }}
Expand Down
4 changes: 4 additions & 0 deletions helm/charts/keto/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ spec:
containers:
{{- if .Values.watcher.enabled }}
- name: watcher
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
image: {{ .Values.watcher.image }}
command:
- /bin/bash
Expand All @@ -79,8 +81,10 @@ spec:
{{- end }}
{{- end }}
- name: {{ .Chart.Name }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: [ "keto" ]
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/keto/templates/job-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ spec:
{{- with $extraEnv }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 10 }}
{{- end }}
{{- if .Values.job.extraContainers }}
{{ tpl .Values.job.extraContainers . | indent 6 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ spec:
port: http
resources:
{{- toYaml .Values.deployment.resources | nindent 12 }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
{{- with .Values.deployment.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions helm/charts/kratos/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ spec:
containers:
{{- if .Values.watcher.enabled }}
- name: watcher
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
image: {{ .Values.watcher.image }}
command:
- /bin/bash
Expand Down Expand Up @@ -190,8 +192,10 @@ spec:
{{- toYaml .Values.deployment.readinessProbe | nindent 12 }}
resources:
{{- toYaml $resources | nindent 12 }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
{{- if .Values.deployment.extraContainers }}
{{ tpl .Values.deployment.extraContainers . | indent 8 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/kratos/templates/job-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ spec:
lifecycle:
{{ tpl .Values.job.lifecycle . | indent 10 }}
{{- end }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 10 }}
{{- end }}
{{- if .Values.deployment.extraVolumeMounts }}
volumeMounts:
{{ toYaml .Values.deployment.extraVolumeMounts | indent 10 }}
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/kratos/templates/statefulset-mail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ spec:
{{- end }}
resources:
{{- toYaml $resources | nindent 12 }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
{{- if .Values.deployment.extraContainers }}
{{ tpl .Values.deployment.extraContainers . | indent 8 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/oathkeeper-maester/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ spec:
{{- toYaml .Values.deployment.resources | nindent 12 }}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
{{- if .Values.deployment.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- end }}
serviceAccountName: {{ include "oathkeeper-maester.fullname" . }}-account
automountServiceAccountToken: {{ .Values.deployment.automountServiceAccountToken }}
dnsPolicy: ClusterFirst
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/oathkeeper/templates/deployment-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ spec:
port: http-api
resources:
{{- toYaml .Values.deployment.resources | nindent 12 }}
{{- if .Values.deployment.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- end }}
{{- if .Values.deployment.extraContainers }}
{{ tpl .Values.deployment.extraContainers . | indent 8 }}
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions helm/charts/oathkeeper/templates/deployment-sidecar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ spec:
- |
touch /etc/rules/access-rules.json
chmod 666 /etc/rules/access-rules.json
{{- if .Values.deployment.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand Down Expand Up @@ -98,8 +100,10 @@ spec:
port: http-api
resources:
{{- toYaml .Values.deployment.resources | nindent 12 }}
{{- if .Values.deployment.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- end }}
- name: {{ .Chart.Name }}-maester
image: "{{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
Expand All @@ -122,8 +126,10 @@ spec:
- name: {{ include "oathkeeper.name" . }}-rules-volume
mountPath: /etc/rules
readOnly: false
{{- if .Values.deployment.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- end }}
{{- if .Values.deployment.extraContainers }}
{{ tpl .Values.deployment.extraContainers . | indent 8 }}
{{- end }}
Expand Down

0 comments on commit b9c76ec

Please sign in to comment.