Kubernetes Troubleshooting - Dec24
Kubernetes Troubleshooting - Dec24
IN K8S
IMAGEPULLBACKOFF: this error occurs when k8s cant able to pull image
from registry (Dockerhub, ECR)
PENDINGPODS: This error will occurs when a pod is in pending state when
it is unable to schedule on to a node
if any pod was deleted from that 10 pods, then 11th pod will be created
FailedScheduling: This error occurs when the scheduler cant find any
suitable node for a pod.
OOMKILLED : This error will occur when a pod was killed itself because it
exceeds the memory limits.
2. Recreate Deployment.
In this strategy, the existing version of the application is terminated completely, and a new
version is deployed in its place. This approach is simple but may cause downtime during the
update.
3. Rolling Update
pod
pod
Now we can observe, old pods from RS-1 was completely deleted and RS-2 created new pods for
version-2 it contains some downtime, To avoid this we will use Rolling Updates
create a deployment file with strategy:
execute this file : kubectl create -f deployment.yml
Check the deployments now : kubectl get deployment
Check the RS : kubectl get rs
So we have 3 Pod copies, then the controller will always ensure that at least 2 Pods are available
during the “rolling update” process, and at most only 4 Pods exist in the cluster at the same time.
This strategy is a field of the Deployment object, named RollingUpdateStrategy
4. BLUE-GREEN DEPLOYMENT
version-1 version-2
Now that we have both blue and green deployments running, we can perform the Blue-Green
Deployment by routing traffic from the blue deployment to the green deployment.