From 3b07adcd1f3ddff201c57d58bfcb1d6e9cdddf34 Mon Sep 17 00:00:00 2001 From: parth-gr Date: Mon, 5 Jan 2026 18:06:30 +0530 Subject: [PATCH] external: if admin creds is provided dont stop creating csi secret if admin secret is created stop creating csi secret from the rook operator the csi creds and secret will still be created by the python and the import script Signed-off-by: parth-gr --- PendingReleaseNotes.md | 4 ++++ deploy/examples/create-external-cluster-resources.py | 12 ++++++------ pkg/operator/ceph/cluster/cluster_external.go | 8 -------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/PendingReleaseNotes.md b/PendingReleaseNotes.md index 8a36e4f80..fe9f7ea3a 100644 --- a/PendingReleaseNotes.md +++ b/PendingReleaseNotes.md @@ -6,6 +6,10 @@ When set to `false`, the standby MDS daemon deployment will be scaled down and removed, rather than only disabling the standby cache while the daemon remains running. +- Now rook operator won't create the csi user and secrets for external mode when admin keyring is used. + There will be a single source of truth. The python script will be responsible for creating the ceph user + and the import script will handle creating the kubernetes secrets for ceph user. [PR](https://github.com/rook/rook/pull/16882) + ## Features - Experimental: Allow concurrent reconciles of the CephCluster CR when there multiple clusters diff --git a/deploy/examples/create-external-cluster-resources.py b/deploy/examples/create-external-cluster-resources.py index f8f773584..c6c17c697 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -1863,8 +1863,7 @@ class RadosJSON: }, } ) - - # if 'CSI_RBD_NODE_SECRET' exists, then only add 'rook-csi-rbd-provisioner' Secret + # if 'CSI_RBD_NODE_SECRET' && 'CSI_RBD_NODE_SECRET_NAME' exists, then only add 'rook-csi-rbd-node' Secret if ( self.out_map["CSI_RBD_NODE_SECRET"] and self.out_map["CSI_RBD_NODE_SECRET_NAME"] @@ -1881,7 +1880,7 @@ class RadosJSON: }, } ) - # if 'CSI_RBD_PROVISIONER_SECRET' exists, then only add 'rook-csi-rbd-provisioner' Secret + # if 'CSI_RBD_PROVISIONER_SECRET' && 'CSI_RBD_PROVISIONER_SECRET_NAME' exists, then only add 'rook-csi-rbd-provisioner' Secret if ( self.out_map["CSI_RBD_PROVISIONER_SECRET"] and self.out_map["CSI_RBD_PROVISIONER_SECRET_NAME"] @@ -1892,13 +1891,14 @@ class RadosJSON: "kind": "Secret", "data": { "userID": self.get_user_id( - self.out_map["CSI_RBD_PROVISIONER_SECRET_NAME"], generation + self.out_map["CSI_RBD_PROVISIONER_SECRET_NAME"], + generation, ), "userKey": self.out_map["CSI_RBD_PROVISIONER_SECRET"], }, } ) - # if 'CSI_CEPHFS_PROVISIONER_SECRET' exists, then only add 'rook-csi-cephfs-provisioner' Secret + # if 'CSI_CEPHFS_PROVISIONER_SECRET' && 'CSI_CEPHFS_PROVISIONER_SECRET_NAME' exists, then only add 'rook-csi-cephfs-provisioner' Secret if ( self.out_map["CSI_CEPHFS_PROVISIONER_SECRET"] and self.out_map["CSI_CEPHFS_PROVISIONER_SECRET_NAME"] @@ -1916,7 +1916,7 @@ class RadosJSON: }, } ) - # if 'CSI_CEPHFS_NODE_SECRET' exists, then only add 'rook-csi-cephfs-node' Secret + # if 'CSI_CEPHFS_NODE_SECRET' && 'CSI_CEPHFS_NODE_SECRET_NAME' exists, then only add 'rook-csi-cephfs-node' Secret if ( self.out_map["CSI_CEPHFS_NODE_SECRET"] and self.out_map["CSI_CEPHFS_NODE_SECRET_NAME"] diff --git a/pkg/operator/ceph/cluster/cluster_external.go b/pkg/operator/ceph/cluster/cluster_external.go index 6a12d515c..925a09282 100644 --- a/pkg/operator/ceph/cluster/cluster_external.go +++ b/pkg/operator/ceph/cluster/cluster_external.go @@ -101,14 +101,6 @@ func (c *ClusterController) configureExternalCephCluster(cluster *cluster) error } log.NamespacedInfo(cluster.Namespace, logger, "external cluster identity established") - // Create CSI Secrets only if the user has provided the admin key - if cluster.ClusterInfo.CephCred.Username == client.AdminUsername { - err = csi.CreateCSISecrets(c.context, cluster.ClusterInfo, cluster.namespacedName) - if err != nil { - return errors.Wrap(err, "failed to create csi kubernetes secrets") - } - } - // update the msgr2 flag for _, m := range cluster.ClusterInfo.InternalMonitors { // m.Endpoint=10.1.115.104:3300