Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Effect of pod disruption budget on a single replica deployment

Tags:

kubernetes

We have a deployment with a single replica. I have also set a pod disruption budget with minimumAvailability = 1

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: app
spec:
  minAvailable: 1
  selector:
    matchLabels:
      app: app-selector

I have seen behaviour where clusterAutoscaler doesn't wait for the minimumAvailability to be healthy, and kills the pod.

My question is, does having a pod disruption budget works with replica number = 1 & minimum availability = 1?

like image 409
dkbhadeshiya Avatar asked Oct 28 '25 00:10

dkbhadeshiya


1 Answers

Don't mix up PDB and maxUnavailable or MaxSurge : there are not the same..

  • PDB prevents you from scaling down your app against volontary disruptions only, like cluster upgrades where you drain a node for exemple
  • minAvailable define how many pods should remain up on rollout.
  • maxSurge define how many pods should be added on rollout

Why do we need PodDisruptionBudget on AKS?

https://kubernetes.io/docs/tasks/run-application/configure-pdb/ https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#rolling-update-deployment

like image 100
Will Avatar answered Oct 29 '25 14:10

Will



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!