Skip to content

fix: update HPA deployment targets for api and webserver#9593

Open
matikepa wants to merge 1 commit intoonyx-dot-app:mainfrom
matikepa:fix/helm-hpa
Open

fix: update HPA deployment targets for api and webserver#9593
matikepa wants to merge 1 commit intoonyx-dot-app:mainfrom
matikepa:fix/helm-hpa

Conversation

@matikepa
Copy link

@matikepa matikepa commented Mar 24, 2026

Description

  • Fixed Helm HPA scaleTargetRef deployment names so autoscalers point to the correct workloads.
  • Updated API HPA target from {{ include "onyx.fullname" . }} to {{ include "onyx.fullname" . }}-api-server.
  • Updated Webserver HPA target from {{ include "onyx.fullname" . }} to {{ include "onyx.fullname" . }}-web-server.
  • This prevents HPA from referencing non-existent deployment names.

How Has This Been Tested?

  • Verified commit diff only changes scaleTargetRef.name in HPA templates:
    • deployment/helm/charts/onyx/templates/api-hpa.yaml
    • deployment/helm/charts/onyx/templates/webserver-hpa.yaml

Summary by cubic

Fixes HPA targets for the API and webserver to point to the correct Deployments, restoring autoscaling behavior.

  • Bug Fixes
    • Updated scaleTargetRef.name in api-hpa.yaml to {{ include "onyx.fullname" . }}-api-server.
    • Updated scaleTargetRef.name in webserver-hpa.yaml to {{ include "onyx.fullname" . }}-web-server.

Written for commit b2af913. Summary will update on new commits.

@matikepa matikepa requested a review from a team as a code owner March 24, 2026 11:17
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 24, 2026

Greptile Summary

This PR fixes a correctness bug in the Helm chart HPA templates where the scaleTargetRef.name was pointing to a non-existent deployment ({{ include "onyx.fullname" . }}) instead of the actual deployment names (-api-server and -web-server suffixes). The fix aligns both HPAs with their respective deployment definitions.

  • api-hpa.yaml: scaleTargetRef.name updated from fullnamefullname-api-server, matching api-deployment.yaml line 5.
  • webserver-hpa.yaml: scaleTargetRef.name updated from fullnamefullname-web-server, matching webserver-deployment.yaml line 5.
  • Both corrected names are consistent with the KEDA ScaledObject equivalents (api-scaledobject.yaml and webserver-scaledobject.yaml), which already referenced the correct deployment names.
  • No other files are affected; the change is minimal and targeted.

Confidence Score: 5/5

  • This PR is safe to merge — it corrects broken HPA targets with no risk of regression.
  • The change is a two-line surgical fix to YAML template values. Cross-referencing api-deployment.yaml and webserver-deployment.yaml confirms the new names exactly match the actual Kubernetes Deployment metadata names. The KEDA ScaledObject counterparts already used these same correct names, providing additional confidence. There are no logic branches, no conditional rendering changes, and no impact on any other resource in the chart.
  • No files require special attention.

Important Files Changed

Filename Overview
deployment/helm/charts/onyx/templates/api-hpa.yaml Fixes scaleTargetRef.name to {{ include "onyx.fullname" . }}-api-server, which correctly matches the deployment name defined in api-deployment.yaml. Consistent with the KEDA ScaledObject equivalent in api-scaledobject.yaml.
deployment/helm/charts/onyx/templates/webserver-hpa.yaml Fixes scaleTargetRef.name to {{ include "onyx.fullname" . }}-web-server, which correctly matches the deployment name defined in webserver-deployment.yaml. Consistent with the KEDA ScaledObject equivalent in webserver-scaledobject.yaml.

Sequence Diagram

sequenceDiagram
    participant HPA as "api-hpa (HPA)"
    participant WHPA as "webserver-hpa (HPA)"
    participant AD as "fullname-api-server (Deployment)"
    participant WD as "fullname-web-server (Deployment)"

    Note over HPA,AD: Before fix scaleTargetRef pointed to fullname only - non-existent
    Note over WHPA,WD: Before fix scaleTargetRef pointed to fullname only - non-existent

    HPA->>AD: "scaleTargetRef.name = fullname-api-server (fixed)"
    WHPA->>WD: "scaleTargetRef.name = fullname-web-server (fixed)"
Loading

Reviews (1): Last reviewed commit: "fix: update HorizontalPodAutoscaler name..." | Re-trigger Greptile

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

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.

1 participant