Search code examples
kubernetesgoogle-cloud-platformkubectl

Kubectl using command to get cluster status


I need to create a shell-script which examine the cluster Status.**

I saw that the kubectl describe-nodes provides lots of data I can output it to json and then parse it but maybe it’s just overkill. Is there a simple way to with kubectl command to get the status of the cluster ? just if its up / down


Solution

  • The least expensive way to check if you can reach the API server is kubectl version. In addition kubectl cluster-info gives you some more info.