In this post, we will explore How To Debug or Troubleshoot Kubernetes Cluster. Kubernetes issues are difficult to detect & identify. We assume that Kubectl CLI is installed and configured in your Kubernetes environment. Let's start with the basic sanity Checks.
kubectl get nodes
NAME STATUS ROLES AGE VERSION
kube-1 NotReady <none> 1h v1.23.3
kube-2 Ready <none> 1h v1.23.3
kube-3 Ready <none> 1h v1.23.3
To get even more detailed info about the overall health of the cluster, use below -
kubectl cluster-info dump
kubectl describe node kube-1
Get the node yaml file details
kubectl get node kube-1 -o yaml
kubectl get nodes -o wide
kubectl describe pv <pv name> -n <namespace>
kubectl get pods -n <namespace> -o wide
kubectl logs -f <pod\_name> -n <namespace>
kubectl describe pods <pod\_name> -n <namespace>
Look at any off-beat details in the above.
journalctl -u kubelet.
If systemd is absent, the kubelet and container runtime write to .log files in the /var/log directory. To write logs to custom dir, you can indirectly run below and redirect the helper tool to logs to a different custom dir.
kube-log-runner
kube-log-runner
But kubelet always directs the container runtime to write logs within the directory C:\var\log\pods. Note that Kubernetes does not provide cluster-level logging Out of the box. Although that can be achieved using some own approaches. Some of the common node logs are -
deployment not ready kubernetes ,kubernetes deployment troubleshooting ,deployment error in kubernetes ,deployment is not ready: . 0 out of 1 expected pods are ready ,kubernetes deployment not creating pods ,troubleshoot deployment issues in kubernetes kodekloud ,kubernetes pod troubleshooting ,troubleshooting kubernetes cluster ,troubleshooting kubernetes networking ,troubleshooting kubernetes services ,troubleshooting kubernetes deployment ,troubleshooting kubernetes ingress ,troubleshooting kubernetes dns ,troubleshooting kubernetes control plane ,troubleshooting kubernetes pdf ,troubleshooting kubernetes nodes ,troubleshooting kubernetes pods ,kubernetes troubleshooting cheat sheet ,kubernetes issues and solutions ,kubernetes troubleshooting flowchart ,kubernetes troubleshooting scenarios ,kubernetes troubleshooting interview questions ,kubernetes cluster ,kubernetes cluster setup ,kubernetes cluster unreachable ,kubernetes cluster architecture ,kubernetes cluster data is stored in which of the following ,kubernetes cluster autoscaler ,kubernetes cluster setup step by step ,kubernetes cluster upgrade ,kubernetes cluster creation ,kubernetes cluster monitoring ,