Skip to content

[platform] decrease resources for system applications - #1054

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
(platform)--cut-requested-resources
Jun 14, 2025
Merged

[platform] decrease resources for system applications#1054
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
(platform)--cut-requested-resources

Conversation

@klinch0

@klinch0 klinch0 commented Jun 12, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added resource constraints for the flux-operator and multiple kube-ovn components, specifying CPU and memory requests and limits.
  • Improvements

    • Reduced default minimum CPU and memory requests for monitoring and seaweedfs components, as well as for the Redis master in the dashboard, to optimize resource usage.
  • Chores

    • Updated version numbers for monitoring and seaweedfs packages.
    • Refreshed version mappings to reflect new releases.

Signed-off-by: kklinch0 <kklinch0@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 12, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This update adjusts resource requests and limits for several components across the monitoring, seaweedfs, dashboard, fluxcd-operator, and kubeovn packages. It lowers default minimum CPU and memory for VerticalPodAutoscaler templates, adds explicit resource constraints in various values.yaml files, and increments chart versions and version mappings accordingly.

Changes

Files/Paths Change Summary
packages/extra/monitoring/Chart.yaml, packages/extra/seaweedfs/Chart.yaml Incremented chart version numbers for monitoring (1.10.0 → 1.10.1) and seaweedfs (0.4.0 → 0.4.1).
packages/extra/monitoring/templates/vpa.yaml, packages/extra/seaweedfs/... Lowered default minimum CPU and memory requests in VPA templates for monitoring and seaweedfs components.
packages/extra/versions_map Updated version mappings for monitoring and seaweedfs: replaced "HEAD" with commit hashes for old versions, added new ones.
packages/system/dashboard/values.yaml Reduced CPU and memory requests for the Redis master component in the dashboard.
packages/system/fluxcd-operator/values.yaml Added CPU and memory resource limits and requests for flux-operator.
packages/system/kubeovn/values.yaml Added explicit resource requests and limits for multiple kube-ovn components.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HelmChart
    participant Kubernetes
    participant VPA

    User->>HelmChart: Deploy/upgrade chart (monitoring/seaweedfs/others)
    HelmChart->>Kubernetes: Apply manifests (with updated resource requests/limits)
    Kubernetes->>VPA: Enforce new min CPU/memory defaults
    VPA-->>Kubernetes: Manage pod resources within new constraints
Loading

Possibly related PRs

  • cozystack/cozystack#741: Updates version commit hashes for monitoring and seaweedfs, similar to this PR's versions_map changes.
  • cozystack/cozystack#668: Updates monitoring package's Helm chart version and versions_map, directly related to similar changes here.
  • cozystack/cozystack#569: Updates version mappings for monitoring and seaweedfs, closely related to this PR's versioning updates.

Suggested labels

enhancement, size:M

Suggested reviewers

  • kvaps

Poem

Hopping through charts, a rabbit’s delight,
Lowering CPU and memory—now things feel light!
With versions updated, and limits set right,
Our pods will be nimble, resourceful, and bright.
🐇✨

“Efficiency’s carrot, in YAML tonight!”


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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

@klinch0
klinch0 marked this pull request as ready for review June 12, 2025 22:07

@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: 2

🧹 Nitpick comments (2)
packages/system/kubeovn/values.yaml (1)

19-60: Ensure consistent unit formatting and review limits
Multiple resources blocks were added for ovn-central, ovs-ovn, kube-ovn-controller, kube-ovn-cni, kube-ovn-pinger, and kube-ovn-monitor.

  • CPU values mix plain numbers (e.g., "3", "2") and millicores (e.g., "1000m", "200m"); standardize on millicores (e.g., "3000m") for clarity.
  • Memory limits use "1000Mi" instead of "1Gi" in some blocks—prefer Gi suffix for consistency.
  • Validate that these resource levels meet performance requirements for each component.
packages/extra/seaweedfs/templates/vpa.yaml (1)

16-17: Reduce duplication with Helm templating
The minAllowed CPU/memory settings are repeated across filer, master, and volume VPA resources. Consider extracting these values into values.yaml or a common Helm helper to DRY the templates and simplify future updates.

Also applies to: 39-40, 62-63

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b14c82d and 0fa70d9.

📒 Files selected for processing (8)
  • packages/extra/monitoring/Chart.yaml (1 hunks)
  • packages/extra/monitoring/templates/vpa.yaml (3 hunks)
  • packages/extra/seaweedfs/Chart.yaml (1 hunks)
  • packages/extra/seaweedfs/templates/vpa.yaml (3 hunks)
  • packages/extra/versions_map (1 hunks)
  • packages/system/dashboard/values.yaml (1 hunks)
  • packages/system/fluxcd-operator/values.yaml (1 hunks)
  • packages/system/kubeovn/values.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
packages/extra/monitoring/templates/vpa.yaml

[warning] 21-21: wrong indentation: expected 8 but found 10

(indentation)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build
🔇 Additional comments (5)
packages/system/dashboard/values.yaml (1)

29-30: Review resource request reduction for Redis master
The CPU request has been lowered from 200m to 20m and memory from 256Mi to 32Mi, which drastically reduces the footprint. However, there is no CPU limit specified under limits; consider adding an explicit CPU limit to avoid potential CPU spikes.

packages/system/fluxcd-operator/values.yaml (1)

8-14: Resource constraints added for flux-operator are valid
The new resources block defines sensible defaults (limits: 1000m CPU, 1Gi memory; requests: 10m CPU, 64Mi memory). Configuration looks correct and aligns with patterns in other packages.

packages/extra/monitoring/Chart.yaml (1)

6-6: Verify chart version bump is synced in versions_map
The chart version was bumped to 1.10.1. Ensure the corresponding entry in packages/extra/versions_map has been updated to match this change.

packages/extra/seaweedfs/Chart.yaml (1)

19-19: Version bump consistency check
Chart version incremented to 0.4.1 aligns with the VPA template and versions_map updates.

packages/extra/versions_map (1)

48-49:

Details

❓ Verification inconclusive

Verify seaweedfs version mapping
Ensure seaweedfs 0.4.0 maps to commit 632224a3 and that the new 0.4.1 HEAD reference is correct for the release.

Run the following script to confirm the commit exists in the upstream SeaweedFS repo:


🏁 Script executed:

#!/bin/bash
# Verify commit for seaweedfs v0.4.0
commit=$(awk '/seaweedfs 0.4.0/{print $3}' packages/extra/versions_map)
git ls-remote https://github.com/chrislusf/seaweedfs.git | grep "$commit"

Length of output: 157


This will surface the exact commit SHAs for both releases so we can confirm whether 632224a3 and HEAD are correct.


🏁 Script executed:

#!/bin/bash
# Verify remote tag commits for seaweedfs

echo "Inspecting commit for seaweedfs v0.4.0 tag:"
git ls-remote --tags https://github.com/chrislusf/seaweedfs.git refs/tags/v0.4.0

echo
echo "Inspecting commit for seaweedfs v0.4.1 tag:"
git ls-remote --tags https://github.com/chrislusf/seaweedfs.git refs/tags/v0.4.1

Length of output: 367


🏁 Script executed:

#!/bin/bash
# List all v0.4.x tags in the SeaweedFS repo
git ls-remote --tags https://github.com/chrislusf/seaweedfs.git | grep -E 'refs/tags/v0\.4\.[0-9]+'

Length of output: 101


Verify seaweedfs version mapping
I ran git ls-remote --tags against the upstream repo and didn’t find any tags for v0.4.0 or v0.4.1. Please manually verify that:

  • commit 632224a3 is the correct SHA for the v0.4.0 release
  • HEAD indeed references the correct commit for the v0.4.1 release

Comment on lines +21 to +22
cpu: 25m
memory: 64Mi

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.

🛠️ Refactor suggestion

Fix indentation for fallback minAllowed blocks
The cpu and memory lines in all three fallback minAllowed sections are under-indented by two spaces. Incorrect indentation will break the YAML manifest.

Apply this patch:

--- a/packages/extra/monitoring/templates/vpa.yaml
+++ b/packages/extra/monitoring/templates/vpa.yaml
@@ -21,7 +21,7 @@
           {{- else }}
-          cpu: 25m
-          memory: 64Mi
+            cpu: 25m
+            memory: 64Mi
           {{- end }}
@@ -50,7 +50,7 @@
           {{- else }}
-          cpu: 25m
-          memory: 64Mi
+            cpu: 25m
+            memory: 64Mi
           {{- end }}
@@ -79,7 +79,7 @@
           {{- else }}
-          cpu: 25m
-          memory: 64Mi
+            cpu: 25m
+            memory: 64Mi
           {{- end }}

Also applies to: 50-51, 79-80

🧰 Tools
🪛 YAMLlint (1.37.1)

[warning] 21-21: wrong indentation: expected 8 but found 10

(indentation)

🤖 Prompt for AI Agents
In packages/extra/monitoring/templates/vpa.yaml at lines 21-22, 50-51, and
79-80, the cpu and memory fields under the fallback minAllowed blocks are
under-indented by two spaces. Fix this by increasing the indentation of these
lines to align properly under their respective minAllowed keys, ensuring the
YAML structure is valid and the manifest will not break.

Comment on lines +42 to +43
monitoring 1.10.0 632224a3
monitoring 1.10.1 HEAD

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.

💡 Verification agent

❓ Verification inconclusive

Verify monitoring version mapping
Ensure monitoring 1.10.0 maps to commit 632224a3 and that the new 1.10.1 HEAD reference corresponds to the intended release.

Run the following script to confirm the commit exists in the upstream monitoring repo:


🏁 Script executed:

#!/bin/bash
# Verify commit for monitoring v1.10.0
commit=$(awk '/monitoring 1.10.0/{print $3}' packages/extra/versions_map)
git ls-remote https://github.com/prometheus-operator/prometheus-operator.git | grep "$commit"

Length of output: 179


Update monitoring version mapping
The SHA 632224a3 for monitoring 1.10.0 does not exist in the upstream Prometheus Operator repository. Please fetch the correct commit for the v1.10.0 tag and update the entry in packages/extra/versions_map. Also confirm that the 1.10.1 HEAD reference points to the intended release by retrieving the current default-branch HEAD.

You can verify with:

# Retrieve the v1.10.0 commit SHA
git ls-remote https://github.com/prometheus-operator/prometheus-operator.git refs/tags/v1.10.0

# Retrieve the current HEAD SHA for 1.10.1
git ls-remote https://github.com/prometheus-operator/prometheus-operator.git HEAD

File: packages/extra/versions_map (lines 42–43)

-monitoring 1.10.0 632224a3
+monitoring 1.10.0 <correct-commit-SHA>
 monitoring 1.10.1 HEAD
🤖 Prompt for AI Agents
In packages/extra/versions_map at lines 42 to 43, the commit SHA 632224a3 for
monitoring 1.10.0 is incorrect and does not exist in the upstream Prometheus
Operator repository. Fetch the correct commit SHA for the v1.10.0 tag using git
ls-remote on the upstream repo and update the mapping accordingly. Also verify
the HEAD commit for 1.10.1 by retrieving the current default branch HEAD SHA
from the upstream repo and update the entry to ensure it points to the intended
release.

@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

@kvaps Andrei Kvapil (kvaps) changed the title [platform] cut resources [platform] decrease resources for system applications Jun 14, 2025

@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

@kvaps Andrei Kvapil (kvaps) added the backport Should change be backported on previous release label Jun 14, 2025
@kvaps
Andrei Kvapil (kvaps) merged commit 0c9c688 into main Jun 14, 2025
@kvaps
Andrei Kvapil (kvaps) deleted the (platform)--cut-requested-resources branch June 14, 2025 06:21
@github-actions

Copy link
Copy Markdown

Successfully created backport PR for release-0.31:

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 previous release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants