feat(helm): add HPA behavior and startup probe#2798
feat(helm): add HPA behavior and startup probe#2798alepane21 merged 6 commits intowundergraph:mainfrom
Conversation
Add two optional, opt-in keys to the router chart:
- autoscaling.behavior: passthrough to HPA spec.behavior, allowing
users to configure scaleUp/scaleDown stabilization windows and
policies. Useful when the router does meaningful startup work
(e.g. persisted-operations manifest cache warmup) which would
otherwise spike CPU/memory and cause the HPA to over-provision
on deploys.
- probes.startup: passthrough to the container's startupProbe.
Lets operators give the router additional startup grace without
loosening liveness/readiness defaults.
Both default to {} and render nothing when unset, so existing
installations are unaffected.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds optional HPA Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
helm/cosmo/charts/router/values.yaml (1)
195-195: Add an example/comment forprobes.startupfor parity withbehaviorand the other probes.Unlike
readinessandlivenessabove (which show concretehttpGet/initialDelaySecondsconfig) and unlike the newautoscaling.behavior(which now ships an inline example),probes.startup: {}is bare. Since the stated motivation of this PR is to grant additional startup grace for PQL manifest cache warmup, a commented example would make the intended usage discoverable for operators and consistent with the rest of the file.📝 Suggested example comment
- startup: {} + # -- Configure startup probe. When unset, no startupProbe is rendered. + # Useful to grant additional startup grace (e.g. while the PQL manifest cache warms up) + # so that the liveness probe does not kill the pod prematurely. + # Example: + # startup: + # httpGet: + # path: /health/live + # port: http + # initialDelaySeconds: 10 + # periodSeconds: 10 + # failureThreshold: 30 + startup: {}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@helm/cosmo/charts/router/values.yaml` at line 195, Add a commented example for probes.startup to mirror the existing readiness/liveness examples and the new autoscaling.behavior snippet: show a sample startupProbe configuration (e.g., httpGet path, port, and initialDelaySeconds/periodSeconds/failureThreshold) as commented YAML under the probes.startup: {} key so operators can see how to increase startup grace for PQL manifest cache warmup; update the probes.startup block to include this inline commented example and ensure naming matches the existing probes.readiness/probes.liveness style for consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@helm/cosmo/charts/router/values.yaml`:
- Line 195: Add a commented example for probes.startup to mirror the existing
readiness/liveness examples and the new autoscaling.behavior snippet: show a
sample startupProbe configuration (e.g., httpGet path, port, and
initialDelaySeconds/periodSeconds/failureThreshold) as commented YAML under the
probes.startup: {} key so operators can see how to increase startup grace for
PQL manifest cache warmup; update the probes.startup block to include this
inline commented example and ensure naming matches the existing
probes.readiness/probes.liveness style for consistency.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 29f05e4d-c820-4fa2-918e-b61dbed7379d
📒 Files selected for processing (1)
helm/cosmo/charts/router/values.yaml
There was a problem hiding this comment.
🧹 Nitpick comments (1)
helm/cosmo/charts/router/values.yaml (1)
146-147: Add Helm-docs description markers for the new keys.At Line 146 and Line 195, adding
# --description comments (same style as adjacent keys) will keep generated README parameter descriptions populated and consistent.Suggested diff
autoscaling: enabled: false minReplicas: 1 maxReplicas: 100 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 + # -- Configure HPA behavior (`spec.behavior`) for scaleUp/scaleDown policies and stabilization windows. behavior: # Configures the HPA scaling behavior. When unset, Kubernetes applies its defaults # (300s scale-down stabilization window, no scale-up window). # Example of a custom scale up and scale down behavior: @@ probes: # -- Configure readiness probe readiness: @@ # -- Configure liveness probe liveness: @@ + # -- Configure startup probe startup: {}Also applies to: 195-195
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@helm/cosmo/charts/router/values.yaml` around lines 146 - 147, Add Helm-docs description markers for the new Helm chart values so generated README parameter descriptions remain populated: insert the comment marker "# --" above the new top-level value key "behavior" (and likewise add the same "# --" comment for the other new key at the spot around line 195) following the same style as adjacent keys, ensuring the marker sits immediately above each key so helm-docs picks up the parameter descriptions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@helm/cosmo/charts/router/values.yaml`:
- Around line 146-147: Add Helm-docs description markers for the new Helm chart
values so generated README parameter descriptions remain populated: insert the
comment marker "# --" above the new top-level value key "behavior" (and likewise
add the same "# --" comment for the other new key at the spot around line 195)
following the same style as adjacent keys, ensuring the marker sits immediately
above each key so helm-docs picks up the parameter descriptions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d3787c06-9045-4100-a66a-cee97404c990
📒 Files selected for processing (1)
helm/cosmo/charts/router/values.yaml
This adds two new options in the router's HPA Helm Chart:
autoscaling.behaviorto allow configuring the the HPA scaling behaviorprobes.startupto configure startup probeThis is useful to fine tune HPA policies and allows for a cooldown period before applying HPA policies. I need this to ignore the initial CPU/memory spike caused by the PQL manifest cache warmup.
Summary by CodeRabbit
New Features
Documentation
Checklist
Open Source AI Manifesto
This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.