Skip to content

Conversation

@ShravaniVangur
Copy link
Contributor

This PR updates the metrics logic to reference the ceph-csi-config ConfigMap instead of the deprecated rook-ceph-csi-config. Metrics previously used the old ConfigMap to retrieve monitor endpoints for executing Ceph commands. Since that ConfigMap is no longer available, switching to ceph-csi-config ensures the metrics can correctly obtain the mons and execute Ceph commands as expected.

Copy link
Contributor

@aruniiird aruniiird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now for the new configmap, ceph-csi-config, we may have to add RBAC permissions.
Please see the file controllers/storagecluster/exporter.go
PS: you may have to search for the old configmap name and replace it with the new one.

}

if len(clusterConfig.Monitors) == 0 {
if len(clusterConfigs[0].Monitors) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my understanding,
we only check for Monitors in the first clusterConfig, right, and we don't want to check other configs in the list.?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, All the configs would have the monitors and hence we would check for the first one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in a cluster with internal and external mode configured, doesn't the Monitors change? maybe that was the reason there was a mention of Namespace in the original code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configmap is still being retrieved based on the CephAuthNamespace. In the whole repo, the namespace stored as a part of the input struct was not being retrieved/utilised anywhere.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

		if clusterConfigs[idx].Namespace == cephClusterNamespace {
			clusterConfig = clusterConfigs[idx]
			break
		}

I see it's being used in removed code?

}

data, ok := configmap.Data["csi-cluster-config-json"]
data, ok := configmap.Data["config.json"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the new config map, ceph-csi-config, just make sure that this data-key, config.json, is correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is the key

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 4, 2025

@aruniiird: changing LGTM is restricted to collaborators

Details

In response to this:

Now for the new configmap, ceph-csi-config, we may have to add RBAC permissions.
Please see the file controllers/storagecluster/exporter.go
PS: you may have to search for the old configmap name and replace it with the new one.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@aruniiird
Copy link
Contributor

@ShravaniVangur ,
Just another suggestion, if you can add the explanation provided in this PR as the commit message as well then that will be a good reference.

The configmap rook-ceph-csi-config is no longer available for
reference. Updating the reference to ceph-csi-config to retrieve
mons for initCephFn.

Signed-off-by: ShravaniVangur <shravanivangur@gmail.com>
Copy link
Contributor

@weirdwiz weirdwiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 5, 2025

@weirdwiz: changing LGTM is restricted to collaborators

Details

In response to this:

LGTM

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 5, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ShravaniVangur, weirdwiz
Once this PR has been reviewed and has the lgtm label, please assign agarwal-mudit for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@leelavg
Copy link
Contributor

leelavg commented Dec 8, 2025

If you are only interested in Monitors why not read from CephConnection CR? In external mode rook creates it directly and in internal mode ocs-op generates it & client-op creates it.

@ShravaniVangur
Copy link
Contributor Author

If you are only interested in Monitors why not read from CephConnection CR? In external mode rook creates it directly and in internal mode ocs-op generates it & client-op creates it.

@leelavg Although the CephConnection is the right source to read the monitor ips, it cannot be fetched through the current kubeclient. If that has to be retrieved, then dyamic clients might have to be introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants