Pod Disruption Budget¶
Pod Disruption Budget allows you to limit the number of simultaneous interruptions that an application can experience, making it more resilient while allowing Caascad administrators to manage the nodes of your cluster.
In order to allow Caascad teams to ensure the operational maintenance of your clusters, in case the number of replicas is greater than 1, we invite you to configure PDB rules using the maxUnavailable
parameter. Its value must be equal to or greater than 1.
You can check the setting with the following command:
kubectl get pdb -A | grep -v "kube-system"
Checking for failed pods¶
According to the PDBs setting with a maximum unavailability of 1, if a pod is failing on a deployment, it will prevent operations on the Caascad side. Please check at regular intervals that there are no pods in error for too long (maximum 7 days).
To check, you can run the command :
kubectl get pods -A | grep -v "Running\|CreatingContainer\|Init\|Completed"
Case of unfinished pods (Status Terminating)¶
To force a pod to terminate, first try to terminate it by patching the pod removing its finalizers, which will have the effect of ending the life of the pod:
kubectl patch pods <pod> -n <namespace> \
--type json \
--patch='[ { "op": "remove", "path": "/metadata/finalizers" } ]'
However, if this command fails to delete the pod, you can, as a last resort, force the pod to be deleted with the command :
kubectl delete pods <pod_name> --grace-period=0 --force -n <namespace>