From f2d4e6792ff83753ea65655043ad84293c60cdd3 Mon Sep 17 00:00:00 2001 From: Redouane Kachach Date: Wed, 22 Nov 2023 17:49:31 +0100 Subject: [PATCH] mgr: adding CEPH_ARGS to the mgr pod so radosgw-admin can use it ceph dashboard uses radosgw-admin for certain tasks that aren't accessible via the rgw REST API. Due to the absence of a valid ceph.conf file at /etc/ceph/ceph.conf within the mgr pod, radosgw-admin fails to operate, resulting in 500 errors across various 'Object Gateway' views on the dashboard. This change adds CEPH_ARGS environment variable to the mgr pod enabling its propagation and utilization by the dashboard/radosgw-admin for executing rgw commands. closes: https://github.com/rook/rook/issues/13255 Signed-off-by: Redouane Kachach (cherry picked from commit afc485fa0343fa879fd44653638dd0ebe33ad3d3) --- pkg/operator/ceph/cluster/mgr/spec.go | 1 + pkg/operator/ceph/cluster/mgr/spec_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/operator/ceph/cluster/mgr/spec.go b/pkg/operator/ceph/cluster/mgr/spec.go index 26f5c483b..d2167c81e 100644 --- a/pkg/operator/ceph/cluster/mgr/spec.go +++ b/pkg/operator/ceph/cluster/mgr/spec.go @@ -355,6 +355,7 @@ func (c *Cluster) cephMgrOrchestratorModuleEnvs() []v1.EnvVar { {Name: "ROOK_OPERATOR_NAMESPACE", Value: operatorNamespace}, {Name: "ROOK_CEPH_CLUSTER_CRD_VERSION", Value: cephv1.Version}, {Name: "ROOK_CEPH_CLUSTER_CRD_NAME", Value: c.clusterInfo.NamespacedName().Name}, + {Name: "CEPH_ARGS", Value: fmt.Sprintf("--mon-host $(ROOK_CEPH_MON_HOST) --keyring %s", keyring.VolumeMount().KeyringFilePath())}, k8sutil.PodIPEnvVar(podIPEnvVar), } return envVars diff --git a/pkg/operator/ceph/cluster/mgr/spec_test.go b/pkg/operator/ceph/cluster/mgr/spec_test.go index 84e5ab6a7..f9d00a5f3 100644 --- a/pkg/operator/ceph/cluster/mgr/spec_test.go +++ b/pkg/operator/ceph/cluster/mgr/spec_test.go @@ -70,6 +70,7 @@ func TestPodSpec(t *testing.T) { podTemplate := test.NewPodTemplateSpecTester(t, &d.Spec.Template) podTemplate.Spec().Containers().RequireAdditionalEnvVars( + "CEPH_ARGS", "ROOK_OPERATOR_NAMESPACE", "ROOK_CEPH_CLUSTER_CRD_VERSION", "ROOK_CEPH_CLUSTER_CRD_NAME") podTemplate.RunFullSuite(config.MgrType, "a", AppName, "ns", "quay.io/ceph/ceph:myceph",