Skip to content

vmagent: preserve replica count in stateful mode with HPA enabled#2192

Merged
AndrewChubatiuk merged 3 commits into
masterfrom
vmagent-stateful-hpa-fix
May 19, 2026
Merged

vmagent: preserve replica count in stateful mode with HPA enabled#2192
AndrewChubatiuk merged 3 commits into
masterfrom
vmagent-stateful-hpa-fix

Conversation

@AndrewChubatiuk
Copy link
Copy Markdown
Contributor

@AndrewChubatiuk AndrewChubatiuk commented May 19, 2026

fixes #2190


Summary by cubic

Prevent vmagent from overwriting StatefulSet replica count in stateful mode when HPA is enabled, so HPA-driven scaling is preserved. Fixes #2190.

  • Bug Fixes
    • In stateful mode with HPA, skip updating .spec.replicas during reconcile via PatchSpec.
    • Added a unit test to ensure HPA-selected replicas persist and a CHANGELOG entry.

Written for commit e337076. Summary will update on new commits. Review in cubic

@AndrewChubatiuk AndrewChubatiuk requested a review from vrutkovs as a code owner May 19, 2026 11:51
Copy link
Copy Markdown
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.

1 issue found across 3 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread docs/CHANGELOG.md Outdated
AndrewChubatiuk and others added 2 commits May 19, 2026 14:57
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Signed-off-by: Andrii Chubatiuk <andrew.chubatiuk@gmail.com>
Signed-off-by: Andrii Chubatiuk <achubatiuk@victoriametrics.com>
@AndrewChubatiuk AndrewChubatiuk merged commit e00b076 into master May 19, 2026
7 of 8 checks passed
@AndrewChubatiuk AndrewChubatiuk deleted the vmagent-stateful-hpa-fix branch May 19, 2026 13:31
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.

Bug with operator when syncing VMAgent.spec.replicas in statefulmode with hpa enabled.

2 participants