From 4bfd88dc4df5656acce945d29364e481cb777466 Mon Sep 17 00:00:00 2001 From: yati1998 Date: Tue, 2 Aug 2022 10:44:43 +0530 Subject: [PATCH] csi: remove attacher sidecar from CephFS rook deployment CephFS CSI driver dont have/advertise controller publish/unpublish capabilities, thus dont need attacher sidecar for its operations. The presence of external-attacher adds on overhead and issues wrt attachment in various scenarios. One of them would be the lack of performance on syncing volumeattachment from api server..etc. More or less we don't have controller publish and unpublish capabilities, so we should not make use of this sidecar and cause unnecessary addon here thus other issues. similar changes have been added to CSI https://github.com/ceph/ceph-csi/pull/3149 Signed-off-by: yati1998 --- Documentation/Getting-Started/quickstart.md | 4 ++-- .../Troubleshooting/ceph-csi-common-issues.md | 2 +- PendingReleaseNotes.md | 1 + .../rook-ceph/templates/clusterrole.yaml | 6 ------ deploy/charts/rook-ceph/values.yaml | 8 -------- deploy/examples/common.yaml | 6 ------ deploy/examples/operator-openshift.yaml | 8 -------- deploy/examples/operator.yaml | 8 -------- pkg/operator/ceph/csi/spec.go | 2 +- .../csi-cephfsplugin-provisioner-dep.yaml | 18 ------------------ 10 files changed, 5 insertions(+), 58 deletions(-) diff --git a/Documentation/Getting-Started/quickstart.md b/Documentation/Getting-Started/quickstart.md index 24ec41ef6..92f147b8e 100644 --- a/Documentation/Getting-Started/quickstart.md +++ b/Documentation/Getting-Started/quickstart.md @@ -100,8 +100,8 @@ If you did not modify the `cluster.yaml` above, it is expected that one OSD will ```console $ kubectl -n rook-ceph get pod NAME READY STATUS RESTARTS AGE -csi-cephfsplugin-provisioner-d77bb49c6-n5tgs 5/5 Running 0 140s -csi-cephfsplugin-provisioner-d77bb49c6-v9rvn 5/5 Running 0 140s +csi-cephfsplugin-provisioner-d77bb49c6-n5tgs 4/4 Running 0 140s +csi-cephfsplugin-provisioner-d77bb49c6-v9rvn 4/4 Running 0 140s csi-cephfsplugin-rthrp 3/3 Running 0 140s csi-rbdplugin-hbsm7 3/3 Running 0 140s csi-rbdplugin-provisioner-5b5cd64fd-nvk6c 6/6 Running 0 140s diff --git a/Documentation/Troubleshooting/ceph-csi-common-issues.md b/Documentation/Troubleshooting/ceph-csi-common-issues.md index 9a5807c40..e2275fb72 100644 --- a/Documentation/Troubleshooting/ceph-csi-common-issues.md +++ b/Documentation/Troubleshooting/ceph-csi-common-issues.md @@ -292,7 +292,7 @@ Restarting the `csi-xxxxplugin-xxx` pod on the node may help. ## Volume Attachment -Each provisioner pod also has a sidecar container called `csi-attacher`. +Each RBD provisioner pod also has a sidecar container called `csi-attacher`. ### csi-attacher diff --git a/PendingReleaseNotes.md b/PendingReleaseNotes.md index b404061d0..35d4dc84d 100644 --- a/PendingReleaseNotes.md +++ b/PendingReleaseNotes.md @@ -8,3 +8,4 @@ - The toolbox pod now uses the Ceph image directly instead of the Rook image - Add support for AWS Server Side Encryption with (AWS-SSE:S3)[https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingServerSideEncryption.html] for RGW. +- Remove Attacher sidecar from CephFS Rook deployment. diff --git a/deploy/charts/rook-ceph/templates/clusterrole.yaml b/deploy/charts/rook-ceph/templates/clusterrole.yaml index 396b620e2..664033390 100644 --- a/deploy/charts/rook-ceph/templates/clusterrole.yaml +++ b/deploy/charts/rook-ceph/templates/clusterrole.yaml @@ -454,12 +454,6 @@ rules: - apiGroups: [""] resources: ["events"] verbs: ["list", "watch", "create", "update", "patch"] - - apiGroups: ["storage.k8s.io"] - resources: ["volumeattachments"] - verbs: ["get", "list", "watch", "patch"] - - apiGroups: ["storage.k8s.io"] - resources: ["volumeattachments/status"] - verbs: ["patch"] - apiGroups: [""] resources: ["persistentvolumeclaims/status"] verbs: ["patch"] diff --git a/deploy/charts/rook-ceph/values.yaml b/deploy/charts/rook-ceph/values.yaml index 47cac5fd6..20e4acf96 100644 --- a/deploy/charts/rook-ceph/values.yaml +++ b/deploy/charts/rook-ceph/values.yaml @@ -227,14 +227,6 @@ csi: limits: memory: 256Mi cpu: 200m - - name : csi-attacher - resource: - requests: - memory: 128Mi - cpu: 100m - limits: - memory: 256Mi - cpu: 200m - name : csi-snapshotter resource: requests: diff --git a/deploy/examples/common.yaml b/deploy/examples/common.yaml index c07a20071..27a77aa70 100644 --- a/deploy/examples/common.yaml +++ b/deploy/examples/common.yaml @@ -42,12 +42,6 @@ rules: - apiGroups: [""] resources: ["events"] verbs: ["list", "watch", "create", "update", "patch"] - - apiGroups: ["storage.k8s.io"] - resources: ["volumeattachments"] - verbs: ["get", "list", "watch", "patch"] - - apiGroups: ["storage.k8s.io"] - resources: ["volumeattachments/status"] - verbs: ["patch"] - apiGroups: [""] resources: ["persistentvolumeclaims/status"] verbs: ["patch"] diff --git a/deploy/examples/operator-openshift.yaml b/deploy/examples/operator-openshift.yaml index 2d6389e38..58ef36258 100644 --- a/deploy/examples/operator-openshift.yaml +++ b/deploy/examples/operator-openshift.yaml @@ -393,14 +393,6 @@ data: # limits: # memory: 256Mi # cpu: 200m - # - name : csi-attacher - # resource: - # requests: - # memory: 128Mi - # cpu: 100m - # limits: - # memory: 256Mi - # cpu: 200m # - name : csi-snapshotter # resource: # requests: diff --git a/deploy/examples/operator.yaml b/deploy/examples/operator.yaml index e1a6a67ab..6e10ac7d5 100644 --- a/deploy/examples/operator.yaml +++ b/deploy/examples/operator.yaml @@ -316,14 +316,6 @@ data: # limits: # memory: 256Mi # cpu: 200m - # - name : csi-attacher - # resource: - # requests: - # memory: 128Mi - # cpu: 100m - # limits: - # memory: 256Mi - # cpu: 200m # - name : csi-snapshotter # resource: # requests: diff --git a/pkg/operator/ceph/csi/spec.go b/pkg/operator/ceph/csi/spec.go index 29979eb56..e418d03b5 100644 --- a/pkg/operator/ceph/csi/spec.go +++ b/pkg/operator/ceph/csi/spec.go @@ -610,7 +610,7 @@ func (r *ReconcileCSI) startDrivers(ver *version.Info, ownerInfo *k8sutil.OwnerI } } if EnableCephFS { - err = csiDriverobj.createCSIDriverInfo(r.opManagerContext, r.context.Clientset, CephFSDriverName, k8sutil.GetValue(r.opConfig.Parameters, "CSI_CEPHFS_FSGROUPPOLICY", string(k8scsi.ReadWriteOnceWithFSTypeFSGroupPolicy)), true) + err = csiDriverobj.createCSIDriverInfo(r.opManagerContext, r.context.Clientset, CephFSDriverName, k8sutil.GetValue(r.opConfig.Parameters, "CSI_CEPHFS_FSGROUPPOLICY", string(k8scsi.ReadWriteOnceWithFSTypeFSGroupPolicy)), false) if err != nil { return errors.Wrapf(err, "failed to create CSI driver object for %q", CephFSDriverName) } diff --git a/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml b/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml index a4c023e6e..ec977365a 100644 --- a/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml +++ b/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml @@ -22,24 +22,6 @@ spec: priorityClassName: {{ .ProvisionerPriorityClassName }} {{ end }} containers: - - name: csi-attacher - image: {{ .AttacherImage }} - args: - - "--v={{ .SidecarLogLevel }}" - - "--csi-address=$(ADDRESS)" - - "--leader-election=true" - - "--timeout={{ .GRPCTimeout }}" - - "--leader-election-namespace={{ .Namespace }}" - - "--leader-election-lease-duration=137s" - - "--leader-election-renew-deadline=107s" - - "--leader-election-retry-period=26s" - env: - - name: ADDRESS - value: /csi/csi-provisioner.sock - imagePullPolicy: "IfNotPresent" - volumeMounts: - - name: socket-dir - mountPath: /csi {{ if .EnableCephFSSnapshotter }} - name: csi-snapshotter image: {{ .SnapshotterImage }}