Skip to content

[monitoring-agents] Set minReplicas to 1 for VPA for VMAgent - #1894

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix-vpa-for-vmagent
Jan 22, 2026
Merged

Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix-vpa-for-vmagent

Conversation

@sircthulhu

@sircthulhu Kirill Ilin (sircthulhu) commented Jan 20, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Set minReplicas for VPA for VMAgent to work correctly in the default case when replicas = 1
Fixes #1893

Release note

[monitoring-agents] set minReplicas=1 in VPA for cluster-wide VMAgent to allow recrating single replica

Summary by CodeRabbit

Changes

  • Chores
    • Updated system monitoring autoscaler configuration to enforce minimum replica constraints, enhancing service resilience and availability during scaling operations.

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

@dosubot dosubot Bot added size/XS This PR changes 0-9 lines, ignoring generated files kind/bug Categorizes issue or PR as related to a bug labels Jan 20, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello Kirill Ilin (@sircthulhu), I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a crucial configuration change to the Vertical Pod Autoscaler (VPA) for the VMAgent component. By setting minReplicas to 1, the VPA is now properly configured to handle scenarios where the VMAgent operates with a single replica, resolving an issue that could prevent correct recreation or scaling behavior. This change enhances the robustness and reliability of the monitoring agents within the system.

Highlights

  • VPA Configuration Update: The Vertical Pod Autoscaler (VPA) configuration for the VMAgent has been updated to explicitly set minReplicas to 1. This ensures that the VPA correctly manages the VMAgent, especially when it is running as a single replica.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@coderabbitai

coderabbitai Bot commented Jan 20, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A single configuration constraint was added to the VerticalPodAutoscaler template for monitoring-agents. The minReplicas: 1 field was inserted into the spec.updatePolicy section to ensure the VMAgent maintains at least one replica during autoscaling updates, preventing VPA from scaling below the single-replica operational requirement.

Changes

Cohort / File(s) Summary
VerticalPodAutoscaler Configuration
packages/system/monitoring-agents/templates/vpa.yaml
Added minReplicas: 1 constraint to spec.updatePolicy to enforce minimum replica count during autoscaling

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A tiny tweak, but oh so grand,

One replica now takes its stand,

VPA knows: don't scale below,

VMAgent shall steadily flow! ✨

🚥 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 PR title accurately summarizes the main change: setting minReplicas to 1 in the VPA configuration for VMAgent monitoring.
Linked Issues check ✅ Passed The PR successfully addresses issue #1893 by adding minReplicas: 1 to the VPA updatePolicy, enabling VPA to update single-replica VMAgent deployments.
Out of Scope Changes check ✅ Passed All changes are scoped to the VPA configuration for VMAgent; only minReplicas field was added with no extraneous 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.


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.

❤️ Share

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request correctly configures the Vertical Pod Autoscaler (VPA) for VMAgent by setting minReplicas: 1. This change is necessary to allow the VPA's updater to function correctly when VMAgent is deployed with a single replica, ensuring that resource recommendations can be applied by recreating the pod. The change is well-targeted and effectively resolves the issue of VPA not working for single-replica VMAgent deployments.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jan 20, 2026
@kvaps Andrei Kvapil (kvaps) added the kind/backport Categorizes issue or PR as requiring a backport to the current release line label Jan 22, 2026
@kvaps

Copy link
Copy Markdown
Member

/retest

@kvaps
Andrei Kvapil (kvaps) merged commit a805aef into main Jan 22, 2026
37 of 39 checks passed
@kvaps
Andrei Kvapil (kvaps) deleted the fix-vpa-for-vmagent branch January 22, 2026 22:17
@github-actions

Copy link
Copy Markdown

Successfully created backport PR for release-0.41:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/backport Categorizes issue or PR as requiring a backport to the current release line kind/bug Categorizes issue or PR as related to a bug lgtm This PR has been approved by a maintainer size/XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[monitoring-agents] VMAgent runs as single-replica, but VPA doesn't set minAllowed

3 participants