AKS icon indicating copy to clipboard operation
AKS copied to clipboard

[BUG] change in behavior of unsatisfiablePDB. Unable to upgrade.

Open satyamkapoor opened this issue 1 year ago • 3 comments

Describe the bug Change in behavior of upgrade error: Unsatisfiable PDB

To Reproduce Steps to reproduce the behavior:

  1. Create a PDB with minAvailable == replicas. Ideally, place the workload on a workerpool node.
  2. Try upgrading cluster to a new k8s patch version, or just upgrading the builderpool to the new K8S patch version az aks nodepool upgrade --resource-group rgname --cluster-name cluster-name --name builderpool --no-wait --kubernetes-version 1.30.9

Expected behavior

  • Upgrade to nodepool gets performed without any issues, as the workload associated with PDB is deployed on another (workerpool) nodepool.
  • Workerpool upgrade begins where a new set of temporary nodes are created, tries to drain the old nodes, and if PDB is making it stuck, retries until a timeout and upgrade process fails.

Environment (please complete the following information):

  • CLI Version 2.68.0
  • Kubernetes version 1.30.7

Additional context

Cluster patch upgrade fails with UnsatisfiablePDB

(UnsatisfiablePDB) Upgrade is blocked due to invalid Pod Disruption Budgets (PDBs). Please review the PDB spec to allow disruptions during upgrades. To bypass this error, set forceUpgrade in upgradeSettings.overrideSettings. Bypassing this error without updating the PDB may result in drain failures during upgrade process. Invalid PDBs details: 2 errors occurred:
	* PDB ns/postgres-db-primary has minAvailable(1) >= expectedPods(1)  can't proceed with put operation
	* PDB ns/postgres-db-primary has minAvailable(1) >= expectedPods(1)  can't proceed with put operation

We're using CNPG operator, which places certain PDB on primary to avoid disruption. During an upgrade, labels on Postgres pods change to adapt the new primary, so the upgrade can complete. Unfortunately now, we see that the upgrade does not even begin due to unsatisfiablePDB. As per AKS documentation, unsatisfiablePDB is when maxUnavailable = 0. In our case minAvailable is 1, allowed disruptions are 1, and maxUnavailable is N/A.

We've had the same PDB for a year and never had issues with upgrades, except from last week. Any help is appreciated. I feel that UnsatisfiablePDB's approach is changed without updating the documentation.

satyamkapoor avatar Feb 20 '25 14:02 satyamkapoor

We are also suffering from this unexpected feature. When we are trying to upgrade the control plan and the system node pool(where we have no workloads) we are getting the error of unsatisfiablePDB. but we are not planning to upgrade the rest of the node pools (where we have the PDB) so why to block us? we want to do a blue green for example for our other node pools. the solution Azure suggest to remove the PDBS is very risky and really unwanted use case specially on large clusters with too many critical workloads.

eyltl avatar Feb 25 '25 11:02 eyltl

We are also suffering from this. This causes severe issues with cloudnative-pg, which relies on automated management of PDBs. Draining nodes, will move the primary, so the PDB is valid.

There is a force option (in AKS), but it does not feel right to use that. This "cautious PDB" behaviour is a breaking change in my opinion and should be opt-in, rather than opt-out.

nilfr avatar Feb 25 '25 15:02 nilfr

Update: we've noticed the buggy behavior is solved. Upgrades are working again.

Would definitely appreciate clear communication for such issues from Azure.

satyamkapoor avatar Mar 11 '25 11:03 satyamkapoor