fix(actual-budget): park at 0 replicas in prod#1607
Merged
Conversation
Actual Budget is currently unused. Set prod's HelmRelease replicaCount
to 0 and pin the KEDA HTTPScaledObject to min=0/max=0 so it can't scale
back up under stray traffic.
To make this reversible without touching the base, parameterize
http-scaled-object.yaml's min/max with `${actual_budget_replicas_(min|max):=1}`.
Defaults preserve current local behavior (no variable set → min=1, max=1);
the prod variables ConfigMap pins both to 0 and adjusts the inline comment.
KEDA HTTP add-on v0.14 CRD accepts min=max=0 (verified against upstream
schema) — the interceptor hangs/times out stray hits on
budget.platform.devantler.tech, which is the right semantic for a parked
app. Reverting is a three-line edit in the prod variables ConfigMap.
`ksail workload validate` and `ksail --config ksail.prod.yaml workload
validate` both pass (254 files each).
Contributor
There was a problem hiding this comment.
Pull request overview
Parks the Actual Budget application in the production cluster by scaling both the HelmRelease and its KEDA HTTPScaledObject to zero replicas, while keeping default (non-prod) behavior unchanged via Flux variable substitution defaults.
Changes:
- Set
actual_budget_replicasto0in prod variables and introduceactual_budget_replicas_min/maxpinned to0. - Parameterize
HTTPScaledObject.spec.replicas.{min,max}with${actual_budget_replicas_(min|max):=1}so environments without overrides retain the existing 1/1 behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
k8s/clusters/prod/variables/variables-cluster-config-map.yaml |
Pins Actual Budget HelmRelease + KEDA scaling variables to 0 in prod to keep the app parked. |
k8s/bases/apps/actual-budget/http-scaled-object.yaml |
Switches KEDA HTTPScaledObject min/max replicas to Flux-substituted variables with safe defaults. |
Address Copilot review on PR #1607: list all three variable names explicitly so someone un-parking the app later cannot misread 'actual_budget_replicas + _min' as a single variable.
The KEDA HTTP add-on translates HTTPScaledObject into a downstream ScaledObject. With max=0 the translation produces MinReplicaCount=1, MaxReplicaCount=0, which KEDA rejects: ScaledObjectCheckFailed: ScaledObject doesn't have correct Idle/Min/Max Replica Counts specification: MinReplicaCount=1 must be less than MaxReplicaCount=0 The upstream CRD schema accepts max=0 (no minimum validator) but the controller rejects it after translation. Fix by setting max to 1, matching the headlamp/whoami scale-to-zero pattern: the deployment stays at 0 with no traffic (HelmRelease replicaCount=0, KEDA min=0) and only briefly spins up 1 pod if something hits the URL. SQLite on RWO PVC requires max <= 1 anyway.
Contributor
|
🎉 This PR is included in version 1.12.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Park the Actual Budget app at 0 replicas in production. It is currently unused.
actual_budget_replicas: "1"→"0"(HelmRelease initialreplicaCount)actual_budget_replicas_min: "0",actual_budget_replicas_max: "0"(KEDAHTTPScaledObjectfloor + ceiling)min/maxin the baseHTTPScaledObjectwith${actual_budget_replicas_(min|max):=1}so local stays unchanged (no var → defaults to 1/1, current behavior).Why
Without pinning the KEDA
HTTPScaledObjectto 0/0, the previousmin: 1, max: 1would scale the deployment back up to 1 the moment Flux applies the new HelmRelease — defeating the purpose. Doing it via variables (rather than a hetzner-overlay patch) keeps the base flexible and makes the "park / unpark" operation a three-line edit in the prod variables ConfigMap.Why
max: 0is safe hereVerified against the upstream KEDA HTTP add-on v0.14 CRD (chart version pinned in this repo): the
replicas.maxfield has nominimum:validator, somax: 0is schema-valid. Behaviorally the interceptor will hang / time out any stray hit onbudget.platform.devantler.tech— that is the correct "parked" semantic, since the app is intentionally not in service.Reversal
To bring it back online:
(SQLite on RWO PVC still keeps
max ≤ 1whenever it is re-enabled — the inline comment in the ConfigMap captures this.)Validation
ksail workload validate✅ (254 files)ksail --config ksail.prod.yaml workload validate✅ (254 files)kubectl kustomizefor bothclusters/local/andclusters/prod/✅Resource-freeing note
Once this lands, the deployment's previously-requested CPU / memory is released to the scheduler automatically —
replicas: 0means zero Pods, which means zero requests at the cluster level. No additional mechanism is needed to "free" them.