Controller/PSP: Reorder fields.

See https://v1-24.docs.kubernetes.io/docs/concepts/security/pod-security-policy.
This commit is contained in:
Marco Ebert 2023-10-06 18:37:59 +02:00
parent d649900010
commit 94889bac08

View file

@ -11,25 +11,9 @@ metadata:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
allowedCapabilities:
- NET_BIND_SERVICE
{{- if .Values.controller.image.chroot }}
- SYS_CHROOT
{{- end }}
{{- if .Values.controller.sysctls }}
allowedUnsafeSysctls:
{{- range $sysctl, $value := .Values.controller.sysctls }}
- {{ $sysctl }}
{{- end }}
{{- end }}
privileged: false privileged: false
allowPrivilegeEscalation: true hostPID: false
volumes: hostIPC: false
- configMap
- emptyDir
- projected
- secret
- downwardAPI
{{- if .Values.controller.hostNetwork }} {{- if .Values.controller.hostNetwork }}
hostNetwork: {{ .Values.controller.hostNetwork }} hostNetwork: {{ .Values.controller.hostNetwork }}
{{- end }} {{- end }}
@ -69,8 +53,18 @@ spec:
max: {{ $key }} max: {{ $key }}
{{- end }} {{- end }}
{{- end }} {{- end }}
hostIPC: false volumes:
hostPID: false - configMap
- downwardAPI
- emptyDir
- secret
- projected
fsGroup:
rule: MustRunAs
ranges:
- min: 1
max: 65535
readOnlyRootFilesystem: false
runAsUser: runAsUser:
rule: MustRunAsNonRoot rule: MustRunAsNonRoot
supplementalGroups: supplementalGroups:
@ -78,13 +72,19 @@ spec:
ranges: ranges:
- min: 1 - min: 1
max: 65535 max: 65535
fsGroup: allowPrivilegeEscalation: true
rule: MustRunAs allowedCapabilities:
ranges: - NET_BIND_SERVICE
- min: 1 {{- if .Values.controller.image.chroot }}
max: 65535 - SYS_CHROOT
readOnlyRootFilesystem: false {{- end }}
seLinux: seLinux:
rule: RunAsAny rule: RunAsAny
{{- if .Values.controller.sysctls }}
allowedUnsafeSysctls:
{{- range $sysctl, $value := .Values.controller.sysctls }}
- {{ $sysctl }}
{{- end }}
{{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}