Link Search Menu Expand Document

PodDisruptionBudget

pod-disruption-budget-max-unavailable.yaml

---
apiVersion: policy/v1beta1
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/v1beta1
kind: PodDisruptionBudget
metadata:
  name: pod-disruption-budget-min-available-simple
spec:
  minAvailable: 2
  selector:
    matchLabels:
      app: app-simple

Pod Disruption Budget Example


  1. Make sure Pod Disruption Budget is supported by your provider and/or cluster owner.
  2. Change the metadata name tag to the name you want.
  3. Set the app value. All pods that have this label will fall under this Pod Disruption Budget.
  4. Set the minAvailable or maxUnavailable 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/