fix(charts): make replicaCount work, add test/prod PDB + autoscaling … - #226
Open
NikhilMM89 wants to merge 1 commit into
Open
NikhilMM89 wants to merge 1 commit into
NikhilMM89 wants to merge 1 commit into
Conversation
…values The deployments and the HPAs disagreed about when autoscaling is active, so with the shipped defaults neither set a replica count. deployment.yaml gated `replicas` on `<component>.autoscaling.enabled` alone, while hpa.yaml requires `global.autoscaling` AND that same flag. The defaults are global.autoscaling=false with backend/frontend autoscaling.enabled=true, so the HPA was not rendered and the `replicas` field was omitted as well — Kubernetes then silently defaulted to 1 and `replicaCount` was dead config. Setting replicaCount=3 rendered no replicas field at all; it now renders 3. Both deployment templates now gate on the same condition as hpa.yaml, so exactly one of the HPA or the static replica count owns the field. Move the per-environment shape out of merge.yml --set flags and into charts/app/values-test.yaml and values-prod.yaml. The deployed shape of test and prod was previously visible only as a long --set line in CI, which is invisible in code review and drifts from git. Environment changes beyond the straight port of the existing flags: - TEST gains PDBs (minAvailable 1). Only prod had them, so a node drain could evict both test pods at once. - PROD PDB minAvailable 1 -> 2. At 1 a node drain could reduce production to a single pod. - maxReplicas raised above minReplicas (test 2->4, prod 5->7). Both were pinned min==max, which makes the HPA a fixed replica count and leaves targetCPUUtilizationPercentage with nothing to act on. DEV/PR keep the chart defaults: single replica, Recreate, no PDB. f6bc3f-dev hosts every open PR environment in one namespace against a 3-core quota, so HPAs at minReplicas 3 per PR would exhaust it, and a PDB over a single replica blocks node drains indefinitely. Both are now documented in values.yaml rather than left implicit. Verified with helm template for all three environments: dev renders replicas=1/Recreate/no HPA/no PDB; test renders no replicas field, RollingUpdate, HPA 2-4, PDB 1; prod renders no replicas field, RollingUpdate, HPA 5-7, PDB 2. minAvailable < minReplicas holds for every component. helm lint passes for all three value sets.
This branch has not been deployed
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.
…values
The deployments and the HPAs disagreed about when autoscaling is active, so with the shipped defaults neither set a replica count.
deployment.yaml gated
replicason<component>.autoscaling.enabledalone, while hpa.yaml requiresglobal.autoscalingAND that same flag. The defaults are global.autoscaling=false with backend/frontend autoscaling.enabled=true, so the HPA was not rendered and thereplicasfield was omitted as well — Kubernetes then silently defaulted to 1 andreplicaCountwas dead config. Setting replicaCount=3 rendered no replicas field at all; it now renders 3.Both deployment templates now gate on the same condition as hpa.yaml, so exactly one of the HPA or the static replica count owns the field.
Move the per-environment shape out of merge.yml --set flags and into charts/app/values-test.yaml and values-prod.yaml. The deployed shape of test and prod was previously visible only as a long --set line in CI, which is invisible in code review and drifts from git.
Environment changes beyond the straight port of the existing flags:
DEV/PR keep the chart defaults: single replica, Recreate, no PDB. f6bc3f-dev hosts every open PR environment in one namespace against a 3-core quota, so HPAs at minReplicas 3 per PR would exhaust it, and a PDB over a single replica blocks node drains indefinitely. Both are now documented in values.yaml rather than left implicit.
Verified with helm template for all three environments: dev renders replicas=1/Recreate/no HPA/no PDB; test renders no replicas field, RollingUpdate, HPA 2-4, PDB 1; prod renders no replicas field, RollingUpdate, HPA 5-7, PDB 2. minAvailable < minReplicas holds for every component. helm lint passes for all three value sets.
Description
Please provide a summary of the change and the issue fixed. Please include relevant context. List dependency changes.
Fixes # (issue)
Type of change
How Has This Been Tested?
Checklist
Further comments
Thanks for the PR!
Deployments, as required, will be available below:
Please create PRs in draft mode. Mark as ready to enable:
After merge, new images are deployed in: