znat
znat

Reputation: 13474

How to get a unique id from a Kubernetes or Openshift cluster?

I'm looking for a way to uniquely identify a cluster:

What would that something be?

Upvotes: 2

Views: 2468

Answers (1)

Simon
Simon

Reputation: 4485

With OpenShift 4.x, you can find the unique Cluster ID for each cluster in the clusterversion CRD:

$ oc get clusterversion -o jsonpath='{.items[].spec.clusterID}{"\n"}'

The clusterversion object looks like this:

$ oc get clusterversion version -o yaml

apiVersion: config.openshift.io/v1
kind: ClusterVersion
metadata:
  name: version
  [..]
spec:
  channel: stable-4.4
  clusterID: 990f7ab8-109b-4c95-8480-2bd1deec55ff
[..]

Source: https://docs.openshift.com/container-platform/4.2/support/gathering-cluster-data.html#support-get-cluster-id_gathering-cluster-data

Upvotes: 2

Related Questions