In this article, I will show you how you can check Kubernetes cluster health status.
Here are the following ways you can use it.
- Check cluster API health
- Check Node status
- Check cluster pod status
Kubernetes Cluster Health Check Command
To check the health of the API endpoint, use the following command:
kubectl get --raw='/readyz?verbose'
Now within the cluster, you can use the following command:
curl -k https://localhost:6443/livez?verbose
Additionally, there is a deprecated command for component status that is still functional in the newest release.
kubectl get cs
Kubernetes Node Status Command
Use the below kubectl nodes command to get the status:
kubectl get nodes
Use the following kubectl command to get the status and details of a Kubernetes node in detail.
kubectl describe nodes
How To Check Cluster Pod Status?
Check the status of every cluster pod listed using the kube-system namespace.
kubectl get po -n kube-system
Final Thoughts Kubernetes Cluster Health Status
In order to make sure the Kubernetes cluster is operating smoothly, it is important to regularly verify the cluster status using several methods.
Check out the best Kubernetes tutorials if you’re learning the system.
Frequently Asked Questions
How do I check my Kubernetes cluster performance?
To check Kubernetes cluster performance, look at the containers, pods, services, & general cluster characteristics, you may help in the performance of an application in a Kubernetes cluster. Each of these tiers of resources used by an application is thoroughly described by Kubernetes.
What is the command to check node health in Kubernetes?
To check the node health in Kubernetes, you can use the following command: kubectl get nodes.
What is the status code for the Kubernetes health check?
Kubernetes health checks have 3 possible statuses: Success (typically indicated by HTTP 200), Failure (indicated by a non-2xx HTTP status code), and Unknown (when the status cannot be determined). The specific status code used depends on the application’s configuration and needs.