Skip to content

Conversation

@OzBenSimhonTraceloop
Copy link
Contributor

@OzBenSimhonTraceloop OzBenSimhonTraceloop commented Jan 25, 2026

Important

Add HPA support to Helm chart with CPU and memory autoscaling configuration.

  • New Features:
    • Add hpa.yaml for Horizontal Pod Autoscaler configuration in helm/templates.
    • Support autoscaling based on CPU and memory utilization metrics.
    • Allow optional scaling behavior configuration.
  • Configuration:
    • Update values.yaml to include autoscaling settings with enabled, minReplicas, maxReplicas, cpu, memory, and behavior options.

This description was created by Ellipsis for d09fc51. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • New Features
    • Added autoscaling configuration with customizable min/max replicas.
    • Added CPU and memory utilization-based scaling options (individually toggleable).
    • Added optional scaling behavior configuration for fine-tuning autoscaler actions.
    • Autoscaling activates only when enabled and at least one metric (CPU or memory) is enabled.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Walkthrough

Adds a new Helm HorizontalPodAutoscaler (autoscaling/v2) template and corresponding values entries. The HPA is conditionally rendered when autoscaling is enabled and at least one of CPU or memory autoscaling is enabled; supports min/max replicas, CPU/memory metrics, and an optional behavior block.

Changes

Cohort / File(s) Summary
HPA Template
helm/templates/hpa.yaml
New Helm template for autoscaling/v2 HorizontalPodAutoscaler. Rendered only when values.autoscaling.enabled AND (cpu.enabled OR memory.enabled). Sets target deployment, namespace, minReplicas/maxReplicas, optional CPU and/or memory metrics using averageUtilization, and an optional behavior block via toYaml.
Autoscaling Values
helm/values.yaml
Adds autoscaling configuration: enabled, minReplicas, maxReplicas, cpu.enabled, cpu.targetCPUUtilizationPercentage, memory.enabled, memory.targetMemoryUtilizationPercentage, and behavior.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Helm as Helm (chart)
participant KubeAPI as Kubernetes API
participant Metrics as Metrics Server
participant Controller as HPA Controller
participant Deployment as Deployment
Helm->>KubeAPI: Apply HPA manifest (if autoscaling enabled)
KubeAPI->>Controller: Register HPA resource
Controller->>Metrics: Query CPU/Memory metrics
Metrics-->>Controller: Return metrics
Controller->>Deployment: Adjust replica count (scale up/down)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nudged a helm, a whisper light,
Pods stretch their legs from day to night,
Min to max they hop and play,
Metrics call — they bloom away,
A little rabbit cheers the sway 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: Add HPA support' accurately summarizes the main change—adding HorizontalPodAutoscaler support to the Helm chart.
Linked Issues check ✅ Passed The PR adds HPA template and configuration supporting CPU/memory metrics as required by TLP-1665, though the issue description is minimal.
Out of Scope Changes check ✅ Passed All changes (HPA template and autoscaling values configuration) directly support the HPA implementation objective without introducing unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 4e8cd8a in 1 minute and 22 seconds. Click for details.
  • Reviewed 67 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. helm/templates/hpa.yaml:16
  • Draft comment:
    Ensure at least one metric is enabled. If both CPU and memory metrics are disabled, the 'metrics:' list will be empty, which can cause HPA validation errors.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment identifies a real potential issue with the code. However, I need to check against the rules: 1) It starts with "Ensure that..." which is explicitly called out as likely not useful in the rules. 2) It's asking the author to verify/ensure something rather than pointing to a clear code change. 3) The comment is speculative - it says this "can cause" errors, not that it definitely will. 4) It doesn't provide a clear, actionable code change. The comment is more of a warning/verification request than a concrete suggestion for how to fix the code. While the technical concern is valid (empty metrics list could cause validation errors), this is exactly the type of comment the rules say to avoid - it starts with "Ensure that..." and asks the author to verify something rather than providing a concrete code change. However, this could be a legitimate bug that needs fixing. Even though the technical issue is real, the comment violates the explicit rule about "Ensure that..." comments. If this were a critical issue, the comment should have provided a concrete solution like adding validation or a default metric, rather than asking the author to ensure something. The comment is more of a warning than actionable feedback. This comment should be deleted because it starts with "Ensure that..." which explicitly violates the rules, and it asks the author to verify/check something rather than providing a clear, actionable code change. While the technical concern may be valid, the comment format is not appropriate per the guidelines.
2. helm/values.yaml:67
  • Draft comment:
    Consider adding documentation for the autoscaling parameters to improve clarity for users.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_5H6LYKIEYNAthVzl

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@helm/templates/hpa.yaml`:
- Around line 16-32: The HPA template may render an empty metrics array when
both .Values.autoscaling.cpu.enabled and .Values.autoscaling.memory.enabled are
false, so add a validation guard when autoscaling is enabled: check
.Values.autoscaling.enabled and enforce that at least one of
.Values.autoscaling.cpu.enabled or .Values.autoscaling.memory.enabled is true
(use the template fail helper or render a clear error) to prevent creating an
HPA with no metrics; update the top of the hpa.yaml template around the metrics
block (referencing the metrics section and the .Values.autoscaling.* flags) to
implement this validation or alternatively document the constraint in
values.yaml.
🧹 Nitpick comments (1)
helm/templates/hpa.yaml (1)

37-38: Remove trailing blank line.

The yamllint tool flags the extra blank line at the end of the file.

🧹 Proposed fix
 {{- end }}
-

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed d09fc51 in 21 seconds. Click for details.
  • Reviewed 10 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. helm/templates/hpa.yaml:1
  • Draft comment:
    Updated condition ensures HPA is only deployed when autoscaling is enabled and at least one metric (CPU or memory) is active. Verify that this logic is intentional, especially if future custom metrics might be considered.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_WICFyiP5kafuO1XY

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

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