Validation
Similar to the container exercises, check the health state of the Kubernetes cluster.
Exercise - kubectl
Open your terminal application and run the kubectl command without any parameters in order to display a generic help and most options
kubectl
Exercise - version information
Execute the following command:
kubectl version
You get an output similar to the following:
Client Version: v1.28.4
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.27.7This displays the version of the Kubernetes cluster (Server version) and the version of the client.
Exercise - cluster information
Now run the following command:
kubectl cluster-info
This command shows some information about the cluster. You should see an output similar to this:
Kubernetes control plane is running at https://fer2dns-awed5bfr.hcp.westeurope.azmk8s.io:443
CoreDNS is running at https://fer2dns-awed5bfr.hcp.westeurope.azmk8s.io:443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://fer2dns-awed5bfr.hcp.westeurope.azmk8s.io:443/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.Exercise - physical nodes
Somewhat more meaningful information is the amount of nodes in your cluster:
kubectl get nodes
This will result in
NAME STATUS ROLES AGE VERSION
aks-fer2pool-24896946-vmss000000 Ready agent 3h29m v1.27.7
aks-fer2pool-24896946-vmss000001 Ready agent 3h29m v1.27.7
aks-fer2pool-24896946-vmss000002 Ready agent 3h29m v1.27.7You can see here that your cluster environment consists of three nodes.
Exercise - option -o wide
Now run the following command with the following change:
kubectl get nodes -o wide
What did you notice, what did the option (-o wide) add?