Get Datacenter using kubectl command

7/4/2018

Is there any command in kubectl to get the data centre details,something like

kubectl get dc
-- ambikanair
kubectl
kubernetes

2 Answers

7/4/2018

Not sure what you mean with "data centre details" but the biggest addressable unit in Kubernetes ATM is a cluster. All relevant info about the context you're operating in can be viewed and updated via the kubectl config command, see also the docs.

-- Michael Hausenblas
Source: StackOverflow

7/4/2018

It is not very clear what is 'datacenter' in your context. If you are referring to a cluster, then kubectl cluster-info or kubectl get nodes may be what you are looking for.

If 'datacenter' is 'all clusters that this kubectl is configured to access', then maybe kubectl config get-contexts or kubectl config get-clusters is what you are looking for. (a 'context' contains everything needed to address a single cluster: the cluster name, the access credentials and the default namespace).

-- Leo K
Source: StackOverflow