Skip to content

feature/add-vpa - #284

Merged
Timofei Larkin (lllamnyp) merged 2 commits into
cozystack:mainfrom
klinch0:feature/add-vpa-for-helm-chart
Apr 18, 2025
Merged

Timofei Larkin (lllamnyp) merged 2 commits into
cozystack:mainfrom
klinch0:feature/add-vpa-for-helm-chart

Conversation

@klinch0

@klinch0 klinch0 commented Apr 17, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Introduced Vertical Pod Autoscaler (VPA) support for etcd-operator and kube-rbac-proxy, enabling automatic resource scaling based on configurable limits.
    • Added new configuration options to control VPA enablement, resource constraints, and update policy directly from the values file.
  • Chores

    • Updated deployment templates to conditionally exclude resource settings when VPA is enabled.
    • Enhanced documentation with VPA configuration details and updated schema to validate new VPA settings.

@coderabbitai

coderabbitai Bot commented Apr 17, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Vertical Pod Autoscaler (VPA) support has been introduced and integrated into the etcd-operator Helm chart. The deployment template now conditionally omits static resource requests and limits for containers when their respective VPA is enabled. A new VPA manifest template is added, which generates a VPA resource for the controller manager deployment when VPA is enabled for either the etcd-operator or kube-rbac-proxy containers. The values.yaml file is updated to include VPA configuration blocks for both containers, specifying enablement and resource boundaries, as well as a top-level VPA update policy.

Changes

File(s) Change Summary
charts/etcd-operator/templates/workload/deployment.yml Wrapped the resources block for etcd-operator and kube-rbac-proxy containers in conditionals to exclude them when their respective VPA is enabled.
charts/etcd-operator/templates/workload/vpa.yml Added a new Helm template for a VerticalPodAutoscaler resource, conditionally rendered and parameterized by values for each container and a global update policy.
charts/etcd-operator/values.yaml Introduced vpa configuration blocks for both etcdOperator and kubeRbacProxy, with enablement flags and min/max CPU/memory settings, and added a top-level VPA updatePolicy field.
charts/etcd-operator/README.md Updated documentation to include new VPA-related configuration keys for etcdOperator and kubeRbacProxy, and a global vpa.updatePolicy key.
charts/etcd-operator/values.schema.json Extended JSON schema to define vpa configuration objects under etcdOperator, kubeRbacProxy, and root level, specifying enablement, resource limits, and update policy types.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Helm Chart
    participant Kubernetes API

    User->>Helm Chart: Install/Upgrade with VPA enabled in values.yaml
    Helm Chart->>Helm Chart: Render deployment.yml (conditionally omit resources)
    Helm Chart->>Helm Chart: Render vpa.yml (conditionally create VPA resource)
    Helm Chart->>Kubernetes API: Apply Deployment manifest
    Helm Chart->>Kubernetes API: Apply VPA manifest
    Kubernetes API->>Deployment: Manage pods (no static resources if VPA enabled)
    Kubernetes API->>VPA: Manage resource recommendations and scaling
Loading

Poem

In the meadow of pods, a breeze anew,
VPA whispers, "I'll scale for you!"
No more fixed rations, just flexible care,
For etcd-operator and proxy, resources to spare.
Helm charts now smarter, with values that sing,
Autoscaling magic—let Kubernetes spring!
🐇✨

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a1de90 and 73dbac9.

📒 Files selected for processing (3)
  • charts/etcd-operator/README.md (3 hunks)
  • charts/etcd-operator/values.schema.json (3 hunks)
  • charts/etcd-operator/values.yaml (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • charts/etcd-operator/README.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • charts/etcd-operator/values.schema.json
  • charts/etcd-operator/values.yaml

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions Bot added the feature New feature or request label Apr 17, 2025
@klinch0
klinch0 force-pushed the feature/add-vpa-for-helm-chart branch from d55edd8 to 3a1de90 Compare April 17, 2025 08:30
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Apr 17, 2025

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
charts/etcd-operator/templates/workload/vpa.yml (1)

13-14: Validate default updateMode value
The chart defaults spec.updatePolicy.updateMode to "Auto", but please confirm that "Auto" is a valid update mode in the VPA API. Consider tightening schema validation (e.g., via an enum) to enforce only supported modes.

charts/etcd-operator/values.schema.json (1)

336-338: Enhance validation for VPA updatePolicy
Add an enum constraint for vpa.updatePolicy (e.g., ["Auto","Initial","Recreate","Off"]) to the schema to prevent invalid input and improve user feedback.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d55edd8 and 3a1de90.

📒 Files selected for processing (5)
  • charts/etcd-operator/README.md (3 hunks)
  • charts/etcd-operator/templates/workload/deployment.yml (2 hunks)
  • charts/etcd-operator/templates/workload/vpa.yml (1 hunks)
  • charts/etcd-operator/values.schema.json (3 hunks)
  • charts/etcd-operator/values.yaml (3 hunks)
✅ Files skipped from review due to trivial changes (2)
  • charts/etcd-operator/values.yaml
  • charts/etcd-operator/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • charts/etcd-operator/templates/workload/deployment.yml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
charts/etcd-operator/templates/workload/vpa.yml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

🔇 Additional comments (1)
charts/etcd-operator/templates/workload/vpa.yml (1)

1-1: False-positive YAML lint error due to Helm templating
The leading {{- token is being flagged by YAMLlint as a syntax error, but this is expected in Helm templates. You can safely ignore this warning or configure your linter to skip templated files.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

Comment thread charts/etcd-operator/values.schema.json Resolved

@lllamnyp Timofei Larkin (lllamnyp) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@kvaps Andrei Kvapil (kvaps) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@lllamnyp Timofei Larkin (lllamnyp) added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Apr 18, 2025
@lllamnyp
Timofei Larkin (lllamnyp) merged commit b6e4ea9 into cozystack:main Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation feature New feature or request ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants