Problem
When working with clusters attached to or managed by Kommander, sometimes it is helpful to determine the name of the cluster by its Monitoring ID and vice-versa.
Solution
The Monitoring ID is stored in the state of the management cluster in the objects called KommanderCluster
. You can use the following command To retrieve the complete monitoring ID to cluster name map:
kubectl get KommanderCluster --all-namespaces -o jsonpath="{.items[*]['.metadata.annotations.kommander\.mesosphere\.io/display-name', '.labels.kommander\.mesosphere\.io/cluster-id']}"