Skip to content

[bucket] Add resources requests/limits to s3manager container - #2624

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
cozystack:mainfrom
matthieu-robin:fix/s3manager-cpu-limit
Jul 3, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 1 commit into
cozystack:mainfrom
matthieu-robin:fix/s3manager-cpu-limit

Conversation

@matthieu-robin

@matthieu-robin Matthieu ROBIN (matthieu-robin) commented May 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The s3manager container in packages/system/bucket/templates/deployment.yaml had no resources block, triggering a no CPU limit conformance warning on the bucket UI Deployment.

The bucket package is a standalone chart (no vendored upstream), so the values are set directly in the template — same pattern as the csi-resizer fix in #2614 and the existing capi-providers-cpprovider template.

  • limits : cpu: 500m, memory: 512Mi
  • requests : cpu: 100m, memory: 128Mi

Comfortable headroom for the lightweight S3 browser UI while keeping a small baseline request.

Test plan

  • helm template . --show-only templates/deployment.yaml from packages/system/bucket/ renders the resources block on the s3manager container (verified locally)
  • Re-run the conformance/lint tool — the s3manager has no CPU limit warning should be gone
  • CI passes

Release note

```release-note
Add CPU and memory requests/limits to the s3manager container of the bucket UI Deployment to clear the "no CPU limit" conformance warning.
```

Summary by CodeRabbit

  • Chores
    • Improved deployment configuration with explicit resource allocation settings to ensure optimal service stability and resource management.

Review Change Stack

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 addresses a conformance warning regarding missing CPU limits in the s3manager container. By defining explicit resource requests and limits, the deployment now aligns with standard operational requirements, ensuring better resource management and compliance within the cluster.

Highlights

  • Resource Configuration: Added CPU and memory requests and limits to the s3manager container in the bucket deployment template.
  • Conformance Compliance: Resolved the 'no CPU limit' conformance warning by explicitly defining resource constraints.
New Features

🧠 You can now enable Memory (public preview) 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 the 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 counterproductive. 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.

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

@github-actions github-actions Bot added size/XS This PR changes 0-9 lines, ignoring generated files area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) labels May 12, 2026
@dosubot dosubot Bot added the quality-of-life QoL improvements label May 12, 2026
@coderabbitai

coderabbitai Bot commented May 12, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The s3manager container in the bucket Deployment template now declares explicit Kubernetes resource constraints, specifying CPU/memory requests of 100m/128Mi and limits of 500m/512Mi, enabling predictable scheduling and resource protection.

Changes

S3Manager Container Resource Configuration

Layer / File(s) Summary
S3Manager container resource requests and limits
packages/system/bucket/templates/deployment.yaml
The s3manager container specification adds a resources block with CPU request/limit (100m/500m) and memory request/limit (128Mi/512Mi).

🎯 1 (Trivial) | ⏱️ ~2 minutes

🐰 A container that bounds its appetite,
With requests and limits set just right,
No more runaway pods in the night,
The cluster keeps stable and tight! 🎯

🚥 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 title '[bucket] Add resources requests/limits to s3manager container' clearly and specifically summarizes the main change: adding Kubernetes resource requests/limits to the s3manager container in the bucket package deployment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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

🧹 Nitpick comments (1)
packages/system/bucket/templates/deployment.yaml (1)

32-38: Make resources configurable via values.yaml.

While capi-providers-cpprovider does hardcode resources, hardcoding is not the established pattern for system packages. Most system packages (backup-controller, backupstrategy-controller, cert-manager, cilium, cluster-autoscaler, etc.) make resources configurable through values.yaml. The bucket chart already uses values.yaml extensively for other configuration (bucketName, users, namespace, ingress settings). For consistency, consider moving these resource definitions to values.yaml and referencing them via {{ .Values.resources.* }} in the template.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/system/bucket/templates/deployment.yaml` around lines 32 - 38, The
deployment template currently hardcodes CPU/memory limits and requests; move
these into values.yaml and reference them from the template. Add a resources
section in values.yaml (e.g. resources.limits.cpu, resources.limits.memory,
resources.requests.cpu, resources.requests.memory) with sensible defaults, then
replace the hardcoded block in packages/system/bucket/templates/deployment.yaml
to read values from .Values.resources (using the existing Helm templating/lookup
pattern such as .Values.resources.limits and .Values.resources.requests) so
chart users can override resource settings. Ensure defaults exist in values.yaml
to preserve current behavior if not overridden.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/system/bucket/templates/deployment.yaml`:
- Around line 32-38: The deployment template currently hardcodes CPU/memory
limits and requests; move these into values.yaml and reference them from the
template. Add a resources section in values.yaml (e.g. resources.limits.cpu,
resources.limits.memory, resources.requests.cpu, resources.requests.memory) with
sensible defaults, then replace the hardcoded block in
packages/system/bucket/templates/deployment.yaml to read values from
.Values.resources (using the existing Helm templating/lookup pattern such as
.Values.resources.limits and .Values.resources.requests) so chart users can
override resource settings. Ensure defaults exist in values.yaml to preserve
current behavior if not overridden.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 464b049d-56c0-47eb-af48-670baa1511ec

📥 Commits

Reviewing files that changed from the base of the PR and between f38a047 and 74cbde1.

📒 Files selected for processing (1)
  • packages/system/bucket/templates/deployment.yaml

@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 adds resource requests and limits to the bucket deployment template. The review feedback highlights the need for a securityContext to adhere to the principle of least privilege as per the style guide. Additionally, the PR title must be corrected to follow the Conventional Commits format.

value: {{ $endpoint | quote }}
- name: SKIP_SSL_VERIFICATION
value: "true"
resources:

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.

security-medium medium

The container is missing a securityContext. According to the repository style guide, all containers should have a securityContext defined to ensure they follow the principle of least privilege and avoid running as root without justification.

        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - ALL
          runAsNonRoot: true
          seccompProfile:
            type: RuntimeDefault
        resources:
References
  1. Flag missing securityContext, containers running as root without an explicit reason, and hostPath/hostNetwork usage without clear rationale. (link)

- name: SKIP_SSL_VERIFICATION
value: "true"
resources:
limits:

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.

low

The PR title [bucket] Add resources requests/limits to s3manager container does not follow the required Conventional Commits format. It should be prefixed with a valid type (e.g., feat, fix, chore) followed by the scope in parentheses, such as fix(bucket): add resources requests/limits to s3manager container.

References
  1. Each commit must follow Conventional Commits format: type(scope): brief description. (link)

@lexfrei Aleksei Sviridkin (lexfrei) added the kind/cleanup Categorizes issue or PR as related to cleanup of code, process, or technical debt label Jul 3, 2026

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.

Correct fix. bucket is a standalone chart with no vendored upstream, so hardcoding the resources block directly on the s3manager container matches the existing pattern (csi-resizer, capi-providers) and the indentation lands the block as a proper sibling of env. Limits 500m/512Mi over requests 100m/128Mi are sane for a lightweight S3 browser UI. Sign-off is present; the only nit is the PR title not following Conventional Commits, which the labeler keys on.

Non-blocking: making the block configurable via values.yaml is optional — hardcoding is the established convention for these standalone charts.

The s3manager Deployment in the bucket package had no resources block,
triggering a 'no CPU limit' conformance warning. Set limits 500m/512Mi
and requests 100m/128Mi — comfortable headroom for the lightweight S3
browser UI. Bucket is a standalone chart (no vendored upstream), so
the values are set directly in the template, matching the existing
pattern in csi-resizer and capi-providers.

Signed-off-by: Matthieu <[email protected]>
@lexfrei
Aleksei Sviridkin (lexfrei) merged commit 04a05f6 into cozystack:main Jul 3, 2026
13 of 15 checks passed
Aleksei Sviridkin (lexfrei) added a commit that referenced this pull request Jul 3, 2026
## Summary

The `matchbox` container in
`packages/extra/bootbox/templates/matchbox/deployment.yaml` had no
`resources` block, triggering a `no CPU limit` conformance warning on
the `bootbox-matchbox` Deployment (PXE/iPXE provisioning service).

Bootbox is a standalone chart (no vendored upstream), so the values are
set directly in the template — same pattern as #2614 (csi-resizer) and
#2624 (s3manager).

- `limits` : `cpu: 200m`, `memory: 256Mi`
- `requests` : `cpu: 50m`, `memory: 128Mi`

Modest sizing since matchbox is a lightweight HTTP server serving iPXE
profiles and boot assets from ConfigMaps.

## Test plan

- [ ] `helm template bootbox . --namespace tenant-root --show-only
templates/matchbox/deployment.yaml --set _namespace.host=example.com
--set _cluster.solver=letsencrypt` from `packages/extra/bootbox/`
renders the `resources` block on the `matchbox` container (verified
locally)
- [ ] Re-run the conformance/lint tool — the `matchbox has no CPU limit`
warning should be gone
- [ ] CI passes

### Release note

\`\`\`release-note
Add CPU and memory requests/limits to the matchbox container of the
bootbox Deployment to clear the "no CPU limit" conformance warning.
\`\`\`

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

## Summary by CodeRabbit

* **Chores**
* Added Kubernetes resource limits and requests configuration to
optimize container resource allocation and improve deployment stability.

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/cozystack/cozystack/pull/2625)

<!-- 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

area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) kind/cleanup Categorizes issue or PR as related to cleanup of code, process, or technical debt quality-of-life QoL improvements 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