Skip to content

sample-app: PDB + RollingUpdate strategy to contain bad rollouts#4

Merged
David-Uka merged 1 commit into
mainfrom
chore/pdb-and-rollout-strategy
Jul 6, 2026
Merged

sample-app: PDB + RollingUpdate strategy to contain bad rollouts#4
David-Uka merged 1 commit into
mainfrom
chore/pdb-and-rollout-strategy

Conversation

@David-Uka

Copy link
Copy Markdown
Owner

Closes the "no PDB, no maxUnavailable/maxSurge" part of the crash-loop gap. Rollback docs already existed (runbook.md, rollback.md); this adds the missing containment mechanics and links them in the runbook.

Still open (flagged, not fixed here, out of scope repos): alert -> runbook_url wiring in cluster-observability, and automated rollback (Argo Rollouts analysis).

- Deployment.spec.strategy: maxUnavailable=0, maxSurge=1 so a bad rollout
  stalls on failing readiness instead of replacing healthy pods
- PodDisruptionBudget (maxUnavailable=1) so voluntary disruptions can't
  stack with an in-progress bad rollout and take the whole fleet down
- runbook.md: documents both, and flags the still-open gap (alert
  runbook_url + automated rollback) as out of scope for this repo

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a rolling update strategy to the deployment configuration, adds a PodDisruptionBudget (PDB) to prevent voluntary disruptions, and documents these rollout containment strategies in the runbook. The review feedback suggests changing the hardcoded maxUnavailable: 1 in the PDB to a percentage-based value ("33%") to scale dynamically with the Horizontal Pod Autoscaler, along with a corresponding update to the documentation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

metadata:
name: sample-app
spec:
maxUnavailable: 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the application uses a Horizontal Pod Autoscaler (hpa.yaml), the number of replicas can scale dynamically. Using a hardcoded absolute value of maxUnavailable: 1 can become highly restrictive as the application scales up (e.g., during node drains or cluster upgrades, only one pod can be evicted at a time, which significantly slows down cluster maintenance).

Consider using a percentage-based value like maxUnavailable: "33%" instead. This scales dynamically with the replica count while maintaining the same behavior for lower replica counts:

  • 1 replica (dev): 1 * 33% = 0.33 (rounded up to 1), allowing full disruption.
  • 2 replicas (staging): 2 * 33% = 0.66 (rounded up to 1), allowing at most 1 unavailable pod.
  • 3 replicas (prod): 3 * 33% = 0.99 (rounded up to 1), allowing at most 1 unavailable pod.
  maxUnavailable: "33%"

Comment thread docs/runbook.md
healthy pods until the new ones pass readiness. Combined with the readiness
probe, a crash-looping new version stalls the rollout instead of replacing
the whole fleet.
- **PodDisruptionBudget**: `maxUnavailable: 1` on `sample-app` protects

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Update the documentation to reflect the percentage-based maxUnavailable value if the suggestion to use "33%" is adopted.

Suggested change
- **PodDisruptionBudget**: `maxUnavailable: 1` on `sample-app` protects
- **PodDisruptionBudget**: `maxUnavailable: "33%"` on `sample-app` protects

@David-Uka
David-Uka merged commit 4842d8e into main Jul 6, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant