pod-disruption-budget-max-unavailable.yaml
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: pod-disruption-budget-max-unavailable-simple
spec:
maxUnavailable: "10%"
selector:
matchLabels:
app: app-simple
pod-disruption-budget-min-available.yaml
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: pod-disruption-budget-min-available-simple
spec:
minAvailable: 2
selector:
matchLabels:
app: app-simple
Pod Disruption Budget Example
- Make sure Pod Disruption Budget is supported by your provider and/or cluster owner.
- Change the metadata
name
tag to the name you want. - Set the
app
value. All pods that have this label will fall under this Pod Disruption Budget. - Set the
minAvailable
ormaxUnavailable
value. This can be an integer (for example when specififying minimum 3 pods should be available) or a percentage (for example when maximum 50% may be unavailable).
Reference: https://kubernetes.io/docs/tasks/run-application/configure-pdb/