Skip to content

Conversation

@matthieu-robin
Copy link
Contributor

@matthieu-robin matthieu-robin commented Jan 2, 2026

What this PR does

Added resource requests and limits for etcd-defrag container.

Release note

[system] Add resource requests and limits to etcd-defrag

Summary by CodeRabbit

  • Chores
    • Enhanced resource configurations for the etcd defragmentation process to ensure optimal performance and system stability.

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

Added resource requests and limits for etcd-defrag container.

Signed-off-by: Matthieu ROBIN <info@matthieurobin.com>
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 2, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Added resource requests and limits to the etcd-defrag CronJob container in the Kubernetes manifest. This configures CPU and memory constraints for the defragmentation process without altering existing functionality.

Changes

Cohort / File(s) Summary
etcd CronJob Configuration
packages/extra/etcd/templates/etcd-defrag.yaml
Added resource requests and limits (CPU and memory) to the etcd-defrag container specification

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A defrag job now has its bounds,
With limits placed on resource grounds—
CPU and memory, neatly defined,
Etcd's health stays well-aligned! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding resource requests and limits to the etcd-defrag component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings

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
Copy link
Contributor

Summary of Changes

Hello @matthieu-robin, 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 enhances the stability and predictability of the etcd-defrag container by explicitly defining its resource requirements and constraints. By setting both requests and limits for CPU and memory, the change ensures that the container receives adequate resources for its operation while also preventing it from consuming excessive resources that could impact other workloads within the cluster.

Highlights

  • Resource Requests Added: CPU and memory resource requests have been added for the etcd-defrag container, setting a baseline of 200m CPU and 256Mi memory.
  • Resource Limits Defined: CPU and memory resource limits have been introduced for the etcd-defrag container, capping its usage at 500m CPU and 512Mi memory.

🧠 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-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-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.

@dosubot dosubot bot added the enhancement New feature or request label Jan 2, 2026
Copy link
Contributor

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

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 adds resource requests and limits to the etcd-defrag container, which is a good practice for managing resources in a Kubernetes cluster. My review includes one suggestion to improve maintainability by making these new resource values configurable through the Helm chart's values.yaml file, rather than hardcoding them. This will provide more flexibility for users of the chart.

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: 0

🧹 Nitpick comments (1)
packages/extra/etcd/templates/etcd-defrag.yaml (1)

15-21: Good addition of resource constraints.

Adding resource requests and limits is a best practice for CronJobs. The values provide reasonable burst capacity (2.5x for CPU, 2x for memory).

However, verify that these values are appropriate for your expected etcd database size. Etcd defragmentation can be memory-intensive, especially for larger databases. If the process exceeds the 512Mi memory limit, it will be OOM killed, causing job failures.

Consider making these values configurable via Helm values (e.g., .Values.defrag.resources) for easier tuning in different environments:

resources:
  requests:
    cpu: {{ .Values.defrag.resources.requests.cpu | default "200m" }}
    memory: {{ .Values.defrag.resources.requests.memory | default "256Mi" }}
  limits:
    cpu: {{ .Values.defrag.resources.limits.cpu | default "500m" }}
    memory: {{ .Values.defrag.resources.limits.memory | default "512Mi" }}
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d6e50b and 675eaa6.

📒 Files selected for processing (1)
  • packages/extra/etcd/templates/etcd-defrag.yaml
🧰 Additional context used
📓 Path-based instructions (1)
**/*.yaml

📄 CodeRabbit inference engine (AGENTS.md)

Do NOT directly edit upstream Helm charts in vendored charts directory; use proper chart vendoring mechanisms

Files:

  • packages/extra/etcd/templates/etcd-defrag.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build

Copy link
Member

@kvaps kvaps left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @matthieu-robin

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 2, 2026
@kvaps kvaps added the backport Should change be backported on previus release label Jan 2, 2026
@kvaps kvaps merged commit d26d99c into cozystack:main Jan 2, 2026
30 checks passed
@github-actions
Copy link

github-actions bot commented Jan 2, 2026

Successfully created backport PR for release-0.39:

kvaps added a commit that referenced this pull request Jan 2, 2026
…etcd-defrag (#1786)

# Description
Backport of #1785 to `release-0.39`.
kvaps added a commit that referenced this pull request Jan 8, 2026
## What this PR does
Added resource requests and limits for etcd-defrag container.

### Release note

<!--  Write a release note:
- Explain what has changed internally and for users.
- Start with the same [label] as in the PR title
- Follow the guidelines at
https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md.
-->

```release-note
[system] Add resource requests and limits to etcd-defrag
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Enhanced resource configurations for the etcd defragmentation process
to ensure optimal performance and system stability.

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

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kvaps added a commit that referenced this pull request Jan 8, 2026
## What this PR does
Added resource requests and limits for etcd-defrag container.

### Release note

<!--  Write a release note:
- Explain what has changed internally and for users.
- Start with the same [label] as in the PR title
- Follow the guidelines at
https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md.
-->

```release-note
[system] Add resource requests and limits to etcd-defrag
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Enhanced resource configurations for the etcd defragmentation process
to ensure optimal performance and system stability.

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

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kvaps added a commit that referenced this pull request Jan 9, 2026
## What this PR does
Added resource requests and limits for etcd-defrag container.

### Release note

<!--  Write a release note:
- Explain what has changed internally and for users.
- Start with the same [label] as in the PR title
- Follow the guidelines at
https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md.
-->

```release-note
[system] Add resource requests and limits to etcd-defrag
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Enhanced resource configurations for the etcd defragmentation process
to ensure optimal performance and system stability.

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

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Should change be backported on previus release enhancement New feature or request 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.

2 participants