From ece9efd97872f522e9b755efb52def31da1fd117 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Fri, 4 Dec 2020 15:48:32 +0530 Subject: [PATCH] ceph: add mgr caps for csi-rbd-node client If the kernel doesnt support mapping of rbd image with deep-flatten feature,cephcsi need to flatten the rbd image first and than map the image on the node. cephcsi first tries to add a task to flatten the rbd image if its receives any permission error it will try to call rbd CLI command which is a blocking call. This commit adds mgr caps to the csi-rbd-node user so that cephcsi will add flatten task and return immediate error to the kubelet, let kubelet retry again,If we go with blocking rbd CLI call we may end up having stale maps on the node in corner cases. Signed-off-by: Madhu Rajanna --- pkg/operator/ceph/csi/secrets.go | 1 + pkg/operator/ceph/csi/secrets_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/operator/ceph/csi/secrets.go b/pkg/operator/ceph/csi/secrets.go index d78f559ca..d43178f25 100644 --- a/pkg/operator/ceph/csi/secrets.go +++ b/pkg/operator/ceph/csi/secrets.go @@ -81,6 +81,7 @@ func createCSIKeyringCephFSProvisioner(s *keyring.SecretStore) (string, error) { func cephCSIKeyringRBDNodeCaps() []string { return []string{ "mon", "profile rbd", + "mgr", "allow rw", "osd", "profile rbd", } } diff --git a/pkg/operator/ceph/csi/secrets_test.go b/pkg/operator/ceph/csi/secrets_test.go index 00b2dfc16..3120ff23c 100644 --- a/pkg/operator/ceph/csi/secrets_test.go +++ b/pkg/operator/ceph/csi/secrets_test.go @@ -24,7 +24,7 @@ import ( func TestCephCSIKeyringRBDNodeCaps(t *testing.T) { caps := cephCSIKeyringRBDNodeCaps() - assert.Equal(t, caps, []string{"mon", "profile rbd", "osd", "profile rbd"}) + assert.Equal(t, caps, []string{"mon", "profile rbd", "mgr", "allow rw", "osd", "profile rbd"}) } func TestCephCSIKeyringRBDProvisionerCaps(t *testing.T) {