Skip to content

Feat/rails graceful shutdown pdb - #223

Merged
IxDay merged 1 commit into
lago-v2from
feat/rails-graceful-shutdown-pdb
Jul 10, 2026
Merged

Feat/rails graceful shutdown pdb#223
IxDay merged 1 commit into
lago-v2from
feat/rails-graceful-shutdown-pdb

Conversation

@binaryknot

Copy link
Copy Markdown
Contributor

What

Adds three opt-in, values-gated fields to the lago-rails chart (aliased as api and all workers) to harden pods against involuntary disruption during Karpenter node consolidation and EKS upgrades:

  • terminationGracePeriodSeconds (pod spec)
  • lifecycle (container) — for a preStop sleep
  • podDisruptionBudget — new pdb.yaml template with minAvailable / maxUnavailable

Why

During node drains, SIGTERM to Puma and EndpointSlice removal race, so the gateway keeps routing to a terminating pod → brief 502/503s. A preStop sleep keeps the pod serving until it's removed from the gateway's endpoints, and a PDB caps how many pods drain at once. This is the first iteration of hardening we'll roll to staging-eu-1 then prod-eu-1.

Notes for reviewers

  • Fully backward-compatible — all three default off/empty, so existing consumers render identically.
  • PDB single-replica trap: a PDB on a 1-replica Deployment wedges node drain. Enablement is per-alias via values; we'll only turn it on for the multi-replica api (done in the lago-deploy PR), never blindly on workers.
  • Chart.yaml/Chart.lock intentionally untouched — the release pipeline owns version bumps.
  • Enabling these in staging-eu-1 / prod-eu-1 (plus the Envoy BackendTrafficPolicy retries) is a separate lago-deploy PR.

Testing

  • helm lint clean; 16/16 helm-unittest cases pass (new graceful_shutdown_pdb_test.yaml covers all three, both on and off).
  • Verified rendered output for lago-rails and the umbrella lago chart.

@binaryknot
binaryknot requested a review from IxDay July 9, 2026 18:03
@binaryknot
binaryknot changed the base branch from main to lago-v2 July 9, 2026 18:05

@IxDay IxDay left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That's literally perfect

@IxDay
IxDay merged commit 70baa94 into lago-v2 Jul 10, 2026
4 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.

2 participants