mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 19:10:21 +00:00
4235178f7c
Add selinuxMount flag to enable/disable /etc/selinux host mount inside pods to support selinux-enabled filesystems Signed-off-by: Francesco Astegiano <francesco.astegiano@gmail.com>
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
{{- if .Values.nodeplugin.podSecurityPolicy.enabled -}}
|
|
apiVersion: policy/v1beta1
|
|
kind: PodSecurityPolicy
|
|
metadata:
|
|
name: {{ include "ceph-csi-cephfs.nodeplugin.fullname" . }}
|
|
labels:
|
|
app: {{ include "ceph-csi-cephfs.fullname" . }}
|
|
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
|
component: {{ .Values.nodeplugin.name }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
spec:
|
|
allowPrivilegeEscalation: true
|
|
allowedCapabilities:
|
|
- 'SYS_ADMIN'
|
|
fsGroup:
|
|
rule: RunAsAny
|
|
privileged: true
|
|
hostNetwork: true
|
|
hostPorts:
|
|
- min: {{ .Values.nodeplugin.httpMetrics.containerPort }}
|
|
max: {{ .Values.nodeplugin.httpMetrics.containerPort }}
|
|
hostPID: true
|
|
runAsUser:
|
|
rule: RunAsAny
|
|
seLinux:
|
|
rule: RunAsAny
|
|
supplementalGroups:
|
|
rule: RunAsAny
|
|
volumes:
|
|
- 'configMap'
|
|
- 'emptyDir'
|
|
- 'projected'
|
|
- 'secret'
|
|
- 'hostPath'
|
|
allowedHostPaths:
|
|
- pathPrefix: '/dev'
|
|
readOnly: false
|
|
- pathPrefix: '/run/mount'
|
|
readOnly: false
|
|
- pathPrefix: '/sys'
|
|
readOnly: false
|
|
{{- if .Values.selinuxMount }}
|
|
- pathPrefix: '/etc/selinux'
|
|
readOnly: true
|
|
{{- end }}
|
|
- pathPrefix: '/lib/modules'
|
|
readOnly: true
|
|
- pathPrefix: '{{ .Values.kubeletDir }}'
|
|
readOnly: false
|
|
{{- end }}
|