Skip to content

kubectl cluster verification commands

kubectl cluster verification commands are a set of command-line operations used to inspect the status, health, and configuration of a Kubernetes cluster. These commands are essential for verifying that the cluster is running correctly and that the kubectl client can successfully communicate with the cluster API^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]。

Primary Verification Commands

Cluster Information

To verify that you are connected to a cluster and to view the service endpoints (such as the DNS server or Dashboard), use the following command^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]:

[kubectl cluster-info](<./kubectl-cluster-info.md>)

This command returns the addresses of the master services, confirming that the control plane is accessible^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]。

Node Status

To check the status of the nodes registered in the cluster, use the following command^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]:

[kubectl](<./kubectl.md>) get nodes

This lists all available nodes, displaying their status (e.g., Ready) to confirm they are healthy and capable of running workloads^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]。

Version Information

To verify the versions of the Kubernetes client and the server, ensuring compatibility and confirming the installed release, use^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]:

[kubectl](<./kubectl.md>) version --short

This outputs the Client Version and Server Version, allowing you to see the specific Kubernetes release (e.g., v1.24.0) running on the cluster^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]。

Context

In local development environments (such as using Docker Desktop for Mac or Minikube), these commands are typically the first steps taken after enabling Kubernetes^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]。They serve as a "smoke test" to ensure that the installation was successful and the cluster is operational before proceeding to deploy applications^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]。

Sources

  • 400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md