Home > OS >  How to describe a Kubernetes cluster using kubectl?
How to describe a Kubernetes cluster using kubectl?

Time:11-28

I want to check the Kubernetes configuration - how many nodes, etc. I tried the following command.

kubectl describe cluster
error: the server doesn't have a resource type "cluster"

BTW, I tried to use the following command to check the AZ of the nodes of the pods. But it returns <none> for all the pods' nodes.

kubectl get pods -o=custom-columns=NAME:.metadata.name,ZONE:.metadata.labels.'topology\.Kubernetes\.io/zone'

How to use kubectl to find the AZs of the pods?

CodePudding user response:

I could be missing the point of your question, but if you just need the nodes, you could do

kubectl get nodes

and then

kubectl describe node {node-name}

to get further details of an individual node

You could also combine the output from kubectl get nodes and either use jsonpath or jq to filter the information you need.

CodePudding user response:

Try this one: kubectl cluster-info?

  • Related