2022-09-24 11:38:05 +00:00
{{- if (semverCompare "<1.25.0-0" .Capabilities.KubeVersion.Version) }}
2023-11-07 17:52:36 +00:00
{{- if and .Values.podSecurityPolicy.enabled .Values.controller.admissionWebhooks.enabled .Values.controller.admissionWebhooks.patch.enabled (empty .Values.controller.admissionWebhooks.existingPsp) -}}
2020-02-24 19:25:57 +00:00
apiVersion : policy/v1beta1
kind : PodSecurityPolicy
metadata :
2023-10-29 17:26:05 +00:00
name : {{ include "ingress-nginx.admissionWebhooks.fullname" . }}
2020-02-24 19:25:57 +00:00
annotations :
"helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
2023-11-07 17:52:36 +00:00
seccomp.security.alpha.kubernetes.io/allowedProfileNames : "*"
2020-02-24 19:25:57 +00:00
labels :
2020-02-28 14:53:24 +00:00
{{- include "ingress-nginx.labels" . | nindent 4 }}
app.kubernetes.io/component : admission-webhook
2021-11-19 14:52:52 +00:00
{{- with .Values.controller.admissionWebhooks.patch.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
2020-02-24 19:25:57 +00:00
spec :
2023-11-07 17:52:36 +00:00
privileged : false
hostPID : false
hostIPC : false
hostNetwork : false
volumes :
- configMap
- downwardAPI
- emptyDir
- secret
- projected
2020-02-24 19:25:57 +00:00
fsGroup :
rule : MustRunAs
2023-11-07 17:52:36 +00:00
ranges :
- min : 1
max : 65535
readOnlyRootFilesystem : true
2020-02-24 19:25:57 +00:00
runAsUser :
rule : MustRunAsNonRoot
2023-11-07 17:52:36 +00:00
runAsGroup :
rule : MustRunAs
2020-02-24 19:25:57 +00:00
ranges :
2023-11-07 17:52:36 +00:00
- min : 1
max : 65535
supplementalGroups :
2020-02-24 19:25:57 +00:00
rule : MustRunAs
2023-11-07 17:52:36 +00:00
ranges :
- min : 1
max : 65535
allowPrivilegeEscalation : false
requiredDropCapabilities :
- ALL
seLinux :
rule : RunAsAny
2020-02-24 19:25:57 +00:00
{{- end }}
2022-09-24 11:38:05 +00:00
{{- end }}