Solution: Troubleshooting Kubernetes
Explore how to troubleshoot common Kubernetes issues including pod resource errors, image pull policy problems, and resource overload. Learn to adjust pod resource limits, fix image errors by changing pull policies, and use horizontal pod autoscalers to manage load efficiently. Gain hands-on experience with commands to edit, delete, and recreate pods for optimum cluster performance.
We'll cover the following...
Problem 1: Resolving resource error issues
We observe the deployed application has an issue. We check its status using the following command:
kubectl get pods
We realize that the Pod is in a pending state. We troubleshoot further by describing the Pod using the following command:
kubectl describe pod app
When we use the above command, we get the following error, which is seen at the bottom of the page:
1 Insufficient cpu, 1 Insufficient memory.
The error indicates that our Pod is requesting lots of resources and the node can’t handle that. We resolve that by reducing the resource, i.e., our memory and CPU usage in our ...