The PodDisruptionBudget with minAvailable=0 prevents RHOCP node drain if 0 pods are in the running state in the RHOCP4
Environment
- Red Hat OpenShift Container Platform (RHOCP)
- 4.12
Issue
- The
PodDisruptionBudget(PDB)withminAvailable=0prevents RHOCP node drain even if 0podsare running in the RHOCP4. -
RHOCP Node drain is failing due to
PodDisruptionBudget(PDB)withminAvailable=0.error when evicting pods/"mypod" -n "test" (will retry after 5s): Cannot evict pod as it would violate the pod's disruption budget.
Resolution
- With a
PodDisruptionBudget(PDB)that has theunhealthyPodEvictionPolicyset toAlwaysAllow, thePodDisruptionBudgetcan drain nodes and evict thepodsfor a malfunctioning application guarded by thisPodDisruptionBudget. -
Create a YAML file that defines a
PodDisruptionBudgetobject and specify theunhealthyPodEvictionPolicy:apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: my-pdb spec: minAvailable: 0 selector: matchLabels: name: my-pod unhealthyPodEvictionPolicy: AlwaysAllow <==========
Root Cause
- In the RHOCP 4.12 or lower versions, the RHOCP node drains fail for a malfunctioning application guarded by the
PodDisruptionBudget. - The
unhealthyPodEvictionPolicyfiled inPodDisruptionBudgetwas introduced in the RHOCP 4.13 Version.
Diagnostic Steps
- Check the
PodDisruptionBudgetconfigurations:
$ oc get pdb <pdb_name> -0 yaml
- Check the
podstatus:
$ oc get po -n <project name>
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments