Skip to content

Commit 822ca5c

Browse files
committed
podSecurityContext
1 parent 8b2a661 commit 822ca5c

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

Readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ Options for downloading the imgproxy image
169169
|**resources.deployment.replicas.stepCount**|The max number of pods to be added/dropped during autoscaling step.|`1`|
170170
|**resources.deployment.replicas.stepSeconds**|The period in seconds (1-1800) during which up to `stepCount` pods can be added or dropped by autoscaler.|`60`|
171171
|**resources.deployment.resources**|Hash of resource limits for your pods|`{}`|
172-
|**resources.deployment.securityContext**|Hash of security context settings for your pods|`{}`|
172+
|**resources.deployment.podSecurityContext**|Security context settings for pods|`{}`|
173173
|**resources.deployment.containerSecurityContext**|Security context setting for containers, see [the docs](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container)|`{}`|
174+
|**resources.deployment.securityContext**|DEPRECATED: Security context settings for pods|`{}`|
174175
|**resources.deployment.terminationGracePeriodSeconds**|A custom amount of time to terminate the app|`30`|
175176
|**resources.deployment.tolerations**|Tolerations for Kubernetes taints||
176177
|**resources.deployment.topologySpreadConstraints**|topologySpreadConstraints for distributing pods across zones|`[]`|

imgproxy/templates/_helpers.tpl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,18 @@ https://docs.aws.amazon.com/eks/latest/userguide/specify-service-account-role.ht
118118
{{- $suffix := ($.Values.resources.ingress.pathSuffix | default "" | trimPrefix "/") -}}
119119
{{- printf "%s/%s" $prefix $suffix -}}
120120
{{- end -}}
121+
122+
{{/* deprecated securityContext */}}
123+
{{- define "imgproxy.podSecurityContext" -}}
124+
{{- $securityContext := $.Values.resources.deployment.securityContext -}}
125+
{{- $podSecurityContext := $.Values.resources.deployment.podSecurityContext -}}
126+
{{- if and $securityContext $podSecurityContext -}}
127+
{{- fail "Both resources.deployment.securityContext and resources.deployment.podSecurityContext are defined. Please use only podSecurityContext." -}}
128+
{{- end -}}
129+
{{- if $securityContext -}}
130+
{{- printf "\n# WARNING: resources.deployment.securityContext is deprecated, please use resources.deployment.podSecurityContext instead" -}}
131+
{{ $securityContext | toYaml | nindent 8 }}
132+
{{- else if $podSecurityContext -}}
133+
{{ $podSecurityContext | toYaml | nindent 8 }}
134+
{{- end -}}
135+
{{- end -}}

imgproxy/templates/deployment.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ spec:
6565
{{- end }}
6666
{{- end }}
6767
{{- end }}
68-
{{- if $.Values.resources.deployment.securityContext }}
69-
securityContext: {{ $.Values.resources.deployment.securityContext | toYaml | nindent 8 }}
68+
{{- with (include "imgproxy.podSecurityContext" .) }}
69+
securityContext:
70+
{{ . }}
7071
{{- end }}
7172
{{- if $.Values.resources.serviceAccount.existingName }}
7273
serviceAccountName: {{ $.Values.resources.serviceAccount.existingName | quote }}

0 commit comments

Comments
 (0)