From 8f5196a559d23b45a97838776dac4b1e3b6b5db3 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Fri, 6 Nov 2020 09:06:31 +0530 Subject: [PATCH] ceph: add privileged securityContext to cephfs deployment cephfs csi driver still uses the ceph CLI for all the ceph fs operations, when cephcsi gets a request from the kubernetes it will internally starts threads for each call. in cephcsi we are setting the pids limit to max, to set this value the container has to be running as the privileged one. if we go with default pid limit we will face core dump due to resource crunch. without privileged access we will see Failed to set new PID limit to -1: open /sys/fs/cgroup/pids/kubepods.slice/ kubepods-besteffort.slice/kubepods-besteffort-pod1029ed37_bebc_466d_9e53_79e7323a67ed.slice/crio-9ef6768d027916f414bf30b54ef13eebad8efd0aa4741d97618affa838d7b4c0.scope/pids.max: permission denied Signed-off-by: Madhu Rajanna --- .../csi-cephfsplugin-provisioner-dep.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cluster/examples/kubernetes/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml b/cluster/examples/kubernetes/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml index e03a79371..27ecae964 100644 --- a/cluster/examples/kubernetes/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml +++ b/cluster/examples/kubernetes/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml @@ -31,6 +31,11 @@ spec: - name: ADDRESS value: /csi/csi-provisioner.sock imagePullPolicy: "IfNotPresent" + securityContext: + privileged: true + capabilities: + add: ["SYS_ADMIN"] + allowPrivilegeEscalation: true volumeMounts: - name: socket-dir mountPath: /csi @@ -46,6 +51,11 @@ spec: - name: ADDRESS value: unix:///csi/csi-provisioner.sock imagePullPolicy: "IfNotPresent" + securityContext: + privileged: true + capabilities: + add: ["SYS_ADMIN"] + allowPrivilegeEscalation: true volumeMounts: - name: socket-dir mountPath: /csi @@ -62,6 +72,11 @@ spec: - name: ADDRESS value: unix:///csi/csi-provisioner.sock imagePullPolicy: "IfNotPresent" + securityContext: + privileged: true + capabilities: + add: ["SYS_ADMIN"] + allowPrivilegeEscalation: true volumeMounts: - name: socket-dir mountPath: /csi @@ -78,6 +93,11 @@ spec: - name: ADDRESS value: unix:///csi/csi-provisioner.sock imagePullPolicy: "IfNotPresent" + securityContext: + privileged: true + capabilities: + add: ["SYS_ADMIN"] + allowPrivilegeEscalation: true volumeMounts: - name: socket-dir mountPath: /csi @@ -111,6 +131,11 @@ spec: - name: CSI_ENDPOINT value: unix:///csi/csi-provisioner.sock imagePullPolicy: "IfNotPresent" + securityContext: + privileged: true + capabilities: + add: ["SYS_ADMIN"] + allowPrivilegeEscalation: true volumeMounts: - name: socket-dir mountPath: /csi @@ -145,6 +170,11 @@ spec: - name: socket-dir mountPath: /csi imagePullPolicy: "IfNotPresent" + securityContext: + privileged: true + capabilities: + add: ["SYS_ADMIN"] + allowPrivilegeEscalation: true volumes: - name: socket-dir emptyDir: {