PDB (Pod Disruption Budget)¶
https://kubernetes.io/docs/tasks/run-application/configure-pdb/
A PodDisruptionBudget has three fields:
A label selector
.spec.selectorto specify the set of pods to which it applies.spec.minAvailablewhich is a description of the number of pods from that set that must still be available after the eviction, even in the absence of the evicted pod. absolute number or a percentage..spec.maxUnavailablewhich is a description of the number of pods from that set that can be unavailable after the eviction. absolute number or a percentage.
get pdb apiversion in kubernetes¶
minAvailable or maxUnavailable¶
minAvailable: the number of Pods that must be available during a disruptionmaxUnavailable: the number of Pods that may be disruptedonly one of
minAvailableandmaxUnavailablein a single PodDisruptionBudget can be specifiedan integer represents the number of Pods. If
minAvailable = 10, then 10 Pods must always be available, even during a disruption.a percentage as a string (e.g. "50%") represents a percentage of total Pods. If
minAvailable = 50%", then at least 50% of the Pods (rounded) remain available during a disruption.
ALLOWED DISRUPTIONS¶
ALLOWED DISRUPTIONS = 0when there are not any pods matchingapp: my-appin the namespaceALLOWED DISRUPTIONS = 1disruption controller has seen the pods, counted the matching pods, and updated the status of the PDB