Skip to content

feature/add-presets - #695

Merged
Timofei Larkin (lllamnyp) merged 2 commits into
cozystack:mainfrom
klinch0:feature/add-presets
Mar 13, 2025
Merged

Timofei Larkin (lllamnyp) merged 2 commits into
cozystack:mainfrom
klinch0:feature/add-presets

Conversation

@klinch0

@klinch0 klinch0 commented Mar 13, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Enhanced resource management across multiple applications, allowing users to configure container resources directly or via predefined presets.
    • Tenant isolation is now enabled by default for improved security.
  • Version Updates

    • Chart versions have been upgraded across applications (e.g., ClickHouse 0.7.0, FerretDB 0.5.0, Kafka 0.4.0, MySQL 0.6.0, NATS 0.5.0, Postgres 0.10.0, RabbitMQ 0.5.0, Redis 0.6.0) to reflect recent improvements.
  • Infrastructure Updates

    • Updated installer image naming and registry address for enhanced consistency.

@coderabbitai

coderabbitai Bot commented Mar 13, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request adds resource management options to multiple Helm charts. New parameters, resources and resourcesPreset, are introduced in documentation, JSON schemas, and configuration files. The templates have been updated with conditional logic to render resource settings based on either explicit values or preset definitions, and new Mustache templates are added to support these presets. In addition, several chart version numbers and version mappings have been updated. Minor changes include a default value change in the tenant app, an image tag update in the installer Makefile, and an update to a registry address in the kubeovn configuration.

Changes

File(s) Change Summary
packages/apps/*/Chart.yaml (ClickHouse, FerretDB, Kafka, MySQL, NATS, Postgres, RabbitMQ, Redis) Chart version numbers incremented (e.g. 0.6.2 → 0.7.0, 0.4.2 → 0.5.0, etc.)
packages/apps/*/README.md (ClickHouse, FerretDB, Kafka, MySQL, NATS, Postgres, RabbitMQ, Redis) Expanded configuration tables to add new parameters: resources and resourcesPreset; tenant README updated to change isolated default from false to true
packages/apps/*/templates/_resources.tpl (ClickHouse, FerretDB, Kafka, MySQL, NATS, RabbitMQ, Redis, Postgres) New Mustache template defined ({{ define "resources.preset" }}) for generating resource request/limit objects based on presets
packages/apps/*/templates/*.yaml (e.g. clickhouse.yaml, postgres.yaml, kafka.yaml, mariadb.yaml, nats.yaml, rabbitmq.yaml, redisfailover.yaml, db.yaml) Conditional logic added to render resource configurations from .Values.resources or via the preset template if .Values.resourcesPreset is defined and not "none"
packages/apps/*/values.schema.json (ClickHouse, FerretDB, Kafka, MySQL, NATS, Postgres, RabbitMQ, Redis) New properties added: "resources" (object) and "resourcesPreset" (string with default "nano") with appropriate descriptions
packages/apps/*/values.yaml (ClickHouse, FerretDB, Kafka, MySQL, NATS, Postgres, RabbitMQ, Redis) New parameters added for resource management: resources: {} and resourcesPreset: "nano" (with commented examples for resource limits/requests)
packages/apps/tenant/README.md and packages/apps/tenant/values.schema.json Default value for the isolated parameter/property updated from false to true (enforcing tenant namespace isolation)
packages/apps/versions_map Versions mapping updated: existing HEAD pointers replaced with specific commit hashes and new version entries added
packages/core/installer/Makefile Changed the IMAGE variable assignment from using the cozystack tag to the installer tag
packages/system/kubeovn/values.yaml Updated registry address from ghcr.io/aenix-io/cozystack to ghcr.io/cozystack/cozystack

Sequence Diagram(s)

sequenceDiagram
    participant U as User Values File
    participant T as Template Engine
    participant P as resources.preset Template

    U->>T: Provide values (resources & resourcesPreset)
    T->>T: Check if `.Values.resources` is defined
    alt resources provided
        T->>T: Render resources using provided values
    else resources not provided
        T->>T: Check if `.Values.resourcesPreset` ≠ "none"
        alt Preset condition met
            T->>P: Call preset template to generate resource config
            P-->>T: Return YAML snippet for resources
        else
            T->>T: Omit resources configuration
        end
    end
    T-->>Final: Merge resource configuration into final YAML output
Loading

Suggested reviewers

  • lllamnyp

Poem

I’m a bunny with hops so spry,
Coding charts ‘neath an open sky,
New resources now leap in view,
Presets and values, fresh and new,
With commit hashes as carrots in sight 🥕,
My whiskers twitch with pure delight!
Happy changes, let’s bounce to new heights!

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 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 ea3b092 and b4584b4.

📒 Files selected for processing (1)
  • packages/apps/rabbitmq/templates/rabbitmq.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/apps/rabbitmq/templates/rabbitmq.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.

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

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

21-21: Registry Address Update Consistency Check

The registry address is now updated to ghcr.io/cozystack/cozystack as intended in the PR. Please verify that this new address is consistent with your image repository configuration and that any related documentation or references are updated accordingly.

packages/core/installer/Makefile (1)

39-40: Update IMAGE variable to reflect installer image naming
The updated assignment on line 39 now uses the "installer" tag instead of "cozystack", which aligns with the new naming convention for the built image. However, the subsequent YAML update on line 40 still writes to the key .cozystack.image. Please verify whether this is intentional or if the YAML key should also be updated (e.g., to .installer.image) to maintain consistency across configurations.

packages/apps/redis/templates/_resources.tpl (1)

1-50: Well-structured resource presets template

This template provides a comprehensive set of resource presets with good error handling and clear documentation.

Consider the following refinements:

  1. CPU requests for xlarge and 2xlarge are the same as large (1.0), while limits increase significantly. This might cause scheduling inefficiencies.

  2. The comment on line 14 states "limits are the requests increased by 50%", but for xlarge/2xlarge, CPU limits are 3x and 6x the requests.

  "xlarge" (dict 
-      "requests" (dict "cpu" "1.0" "memory" "3072Mi" "ephemeral-storage" "50Mi")
+      "requests" (dict "cpu" "2.0" "memory" "3072Mi" "ephemeral-storage" "50Mi")
      "limits" (dict "cpu" "3.0" "memory" "6144Mi" "ephemeral-storage" "2Gi")
   )
  "2xlarge" (dict 
-      "requests" (dict "cpu" "1.0" "memory" "3072Mi" "ephemeral-storage" "50Mi")
+      "requests" (dict "cpu" "4.0" "memory" "3072Mi" "ephemeral-storage" "50Mi")
      "limits" (dict "cpu" "6.0" "memory" "12288Mi" "ephemeral-storage" "2Gi")
   )
packages/apps/ferretdb/templates/_resources.tpl (1)

1-50: Template appears to be duplicated across applications

This template is identical to the one in packages/apps/rabbitmq/templates/_resources.tpl. While having application-specific templates gives flexibility, it introduces maintenance overhead if preset definitions need to change in the future.

Consider whether it might be better to have a shared template in a common location, or use a configuration management approach to keep these templates in sync.

packages/apps/kafka/templates/_resources.tpl (1)

36-43: Consider adjusting CPU requests for larger presets

For xlarge and 2xlarge presets, the CPU request remains at 1.0 while the limits are significantly higher (3.0 and 6.0). This large gap between requested and limit CPU could potentially lead to CPU throttling during peak usage, as the container might try to use more resources than what was requested from the scheduler.

Consider adjusting the CPU requests to better match the expected usage pattern for these larger workloads.

packages/apps/ferretdb/values.schema.json (1)

85-94: Consider adding enum validation for resourcesPreset

The schema properties are well-defined with good descriptions. However, consider adding an "enum" property to validate the resourcesPreset values at the schema level, which would provide better validation and documentation:

"resourcesPreset": {
    "type": "string",
    "description": "Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).",
    "default": "nano",
+   "enum": ["none", "nano", "micro", "small", "medium", "large", "xlarge", "2xlarge"]
}
packages/apps/clickhouse/templates/_resources.tpl (1)

1-50: Consider a common library approach for resource presets

The implementation is consistent with other applications, which is excellent. However, since this exact template appears in multiple applications (kafka, postgres, etc.), consider whether these resource presets could be refactored into a common library template that all applications reference. This would reduce duplication and make maintenance easier when changes to the presets are needed.

The same consideration about CPU requests for xlarge and 2xlarge presets applies here as well.

packages/apps/ferretdb/README.md (1)

24-35: Refine Resource Preset Description Grammar

The new table rows introducing the resources and resourcesPreset parameters look good overall. However, the description for resourcesPreset contains a minor grammatical inconsistency. Consider revising the text from:

"... This is ignored if resources is set (resources is recommended for production)."

to something like:

"... This is ignored if resources is specified (using resources is recommended for production)."

This change will improve clarity and ensure proper subject–verb agreement.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~35-~35: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~35-~35: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/rabbitmq/values.yaml (2)

52-52: Remove Trailing Spaces

There appear to be trailing spaces on line 52. Please remove these to comply with YAML linting standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 52-52: trailing spaces

(trailing-spaces)


42-54: Improve Resource Preset Description

The introduction of the resources and resourcesPreset parameters is well integrated into the documentation. However, similar to the FerretDB README, the description for resourcesPreset would benefit from a slight rewording for clarity. Consider changing:

"... This is ignored if resources is set (resources is recommended for production)."

to

"... This is ignored if resources is specified (using resources is recommended for production)."

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 52-52: trailing spaces

(trailing-spaces)

packages/apps/redis/values.yaml (1)

15-26: Resource configuration parameters look good.

The addition of resource management options with both explicit configuration and preset-based options provides flexibility for different deployment scenarios.

There's a trailing space at the end of line 24 that should be removed:

 #     cpu: 100m
 #     memory: 512Mi
-  
+
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 24-24: trailing spaces

(trailing-spaces)

packages/apps/kafka/values.yaml (1)

43-54: Resource configuration parameters look good.

The addition of resource management options with both explicit configuration and preset-based options provides flexibility for different deployment scenarios.

There's a trailing space at the end of line 52 that should be removed:

 #     cpu: 100m
 #     memory: 512Mi
-  
+
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 52-52: trailing spaces

(trailing-spaces)

packages/apps/clickhouse/values.yaml (2)

49-58: Resource Parameters Documentation in ClickHouse Values
The new block introducing the resources parameter—with its empty object default and commented-out examples for limits and requests—is clear and useful for guiding users on how to override defaults when needed.


59-59: Trailing Whitespace Detected
Static analysis has flagged trailing whitespace on this line. Please remove the extra spaces to maintain YAML style compliance.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 59-59: trailing spaces

(trailing-spaces)

packages/apps/postgres/values.yaml (2)

79-88: Resource Parameters Documentation for Postgres
The addition of the resources parameter along with the commented examples gives users a clear starting point for configuring resource limits and requests. This mirrors the approach taken in other charts, ensuring consistency across the repository.


89-89: Trailing Whitespace Detected
Static analysis has detected trailing whitespace on this line. Please remove the extra spaces to conform with YAML linting standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 89-89: trailing spaces

(trailing-spaces)

packages/apps/nats/README.md (1)

7-19: Updated Documentation with New Resource Parameters
The README table now includes rows for resources and resourcesPreset, each with clear descriptions and default values. Note that the explanation for resourcesPreset (e.g., "This is ignored if resources is set (resources is recommended for production)") could be rephrased for improved grammatical clarity. Consider revising the verb agreement to enhance readability.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~18-~18: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~18-~18: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/mysql/values.yaml (2)

57-66: Resource Parameters Documentation for MySQL
The new resources section—including the empty object default and commented examples—is consistent with the changes made in other services. This clear documentation will help users understand how to override resource defaults when needed.


67-67: Trailing Whitespace Detected
Static analysis has flagged trailing whitespace on this line. Removing the extra spaces will help maintain a clean YAML style.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 67-67: trailing spaces

(trailing-spaces)

packages/apps/clickhouse/README.md (1)

39-50: Clarify Resource Parameter Descriptions

The new resources and resourcesPreset entries enhance configuration flexibility. To improve clarity and grammatical correctness, consider rephrasing the resourcesPreset text. For example, modify the phrase from:

This is ignored if resources is set (resources is recommended for production).

to something like:

- This is ignored if resources is set (resources is recommended for production).
+ This parameter is ignored if `resources` is explicitly specified (using `resources` is recommended for production).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~50-~50: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~50-~50: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/nats/values.yaml (1)

65-76: Enhance Resource Parameters and Remove Trailing Spaces

The addition of the resources and resourcesPreset parameters is clear and consistent with the changes in other applications. Consider revising the resourcesPreset description for improved readability and grammatical accuracy. For instance, change it from:

Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).

to:

- Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).
+ Set container resources according to a common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This parameter is ignored if `resources` is specified (using `resources` is recommended for production).

Additionally, static analysis flagged trailing whitespace at line 74. Please remove any extraneous spaces to ensure YAML lint compliance.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 74-74: trailing spaces

(trailing-spaces)

packages/apps/mysql/README.md (1)

86-98: Fix Typo and Clarify Descriptions in Backup Parameters

In the backup parameters table, there is a small typo—"pereiodic" should be corrected to "periodic." Also, similar to other files, consider updating the resourcesPreset description for consistency and clarity. For example, update it from:

- Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).
+ Set container resources according to a common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This parameter is ignored if `resources` is specified (using `resources` is recommended for production).

and

- | `backup.enabled`         | Enable pereiodic backups | `false` |
+ | `backup.enabled`         | Enable periodic backups | `false` |
🧰 Tools
🪛 LanguageTool

[uncategorized] ~97-~97: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~97-~97: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/rabbitmq/README.md (1)

25-30: Improve resourcesPreset Description

The new resources and resourcesPreset parameters are a valuable addition. However, the description for resourcesPreset can be made clearer. Consider rephrasing it from:

- Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).
+ Set container resources according to a common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This parameter is ignored if `resources` is specified (using `resources` is recommended for production).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~30-~30: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~30-~30: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano |...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/redis/values.schema.json (1)

35-38: Refine Schema Description for resourcesPreset

The JSON schema now includes the new resource management properties. To improve clarity and maintain consistency with other documentation, consider updating the resourcesPreset description as follows:

- "Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production)."
+ "Set container resources according to a common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This parameter is ignored if `resources` is specified (using `resources` is recommended for production)."
packages/apps/ferretdb/values.yaml (1)

61-61: Fix trailing whitespace

There is trailing whitespace on this line that should be removed.

-resourcesPreset: "nano"
- 
+resourcesPreset: "nano"
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 61-61: trailing spaces

(trailing-spaces)

packages/apps/redis/README.md (1)

16-24: Resource management parameters look good.

The addition of resource management parameters (resources and resourcesPreset) follows best practices for Kubernetes deployments. This standardization will help users configure resource limits and requests consistently across different services.

Small grammar suggestion in line 24: Consider changing "if resources is set (resources is recommended..." to "if resources is set (the resources parameter is recommended..." to improve clarity.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~24-~24: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~24-~24: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/postgres/README.md (1)

61-72: Resource management parameters correctly added to backup section.

The addition of resource management parameters is consistent with the changes in other services. These parameters will allow users to appropriately size the backup container resources.

Small grammar suggestion in line 72: Consider changing "if resources is set (resources is recommended..." to "if resources is set (the resources parameter is recommended..." to improve clarity.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~72-~72: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~72-~72: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 728743d and ea3b092.

📒 Files selected for processing (53)
  • packages/apps/clickhouse/Chart.yaml (1 hunks)
  • packages/apps/clickhouse/README.md (1 hunks)
  • packages/apps/clickhouse/templates/_resources.tpl (1 hunks)
  • packages/apps/clickhouse/templates/clickhouse.yaml (1 hunks)
  • packages/apps/clickhouse/values.schema.json (1 hunks)
  • packages/apps/clickhouse/values.yaml (1 hunks)
  • packages/apps/ferretdb/Chart.yaml (1 hunks)
  • packages/apps/ferretdb/README.md (1 hunks)
  • packages/apps/ferretdb/templates/_resources.tpl (1 hunks)
  • packages/apps/ferretdb/templates/postgres.yaml (1 hunks)
  • packages/apps/ferretdb/values.schema.json (1 hunks)
  • packages/apps/ferretdb/values.yaml (1 hunks)
  • packages/apps/kafka/Chart.yaml (1 hunks)
  • packages/apps/kafka/README.md (1 hunks)
  • packages/apps/kafka/templates/_resources.tpl (1 hunks)
  • packages/apps/kafka/templates/kafka.yaml (1 hunks)
  • packages/apps/kafka/values.schema.json (1 hunks)
  • packages/apps/kafka/values.yaml (1 hunks)
  • packages/apps/mysql/Chart.yaml (1 hunks)
  • packages/apps/mysql/README.md (1 hunks)
  • packages/apps/mysql/templates/_resources.tpl (1 hunks)
  • packages/apps/mysql/templates/mariadb.yaml (1 hunks)
  • packages/apps/mysql/values.schema.json (1 hunks)
  • packages/apps/mysql/values.yaml (1 hunks)
  • packages/apps/nats/Chart.yaml (1 hunks)
  • packages/apps/nats/README.md (1 hunks)
  • packages/apps/nats/templates/_resources.tpl (1 hunks)
  • packages/apps/nats/templates/nats.yaml (1 hunks)
  • packages/apps/nats/values.schema.json (1 hunks)
  • packages/apps/nats/values.yaml (1 hunks)
  • packages/apps/postgres/Chart.yaml (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/templates/_resources.tpl (1 hunks)
  • packages/apps/postgres/templates/db.yaml (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (1 hunks)
  • packages/apps/rabbitmq/Chart.yaml (1 hunks)
  • packages/apps/rabbitmq/README.md (1 hunks)
  • packages/apps/rabbitmq/templates/_resources.tpl (1 hunks)
  • packages/apps/rabbitmq/templates/rabbitmq.yaml (1 hunks)
  • packages/apps/rabbitmq/values.schema.json (1 hunks)
  • packages/apps/rabbitmq/values.yaml (1 hunks)
  • packages/apps/redis/Chart.yaml (1 hunks)
  • packages/apps/redis/README.md (1 hunks)
  • packages/apps/redis/templates/_resources.tpl (1 hunks)
  • packages/apps/redis/templates/redisfailover.yaml (1 hunks)
  • packages/apps/redis/values.schema.json (1 hunks)
  • packages/apps/redis/values.yaml (1 hunks)
  • packages/apps/tenant/README.md (1 hunks)
  • packages/apps/tenant/values.schema.json (1 hunks)
  • packages/apps/versions_map (4 hunks)
  • packages/core/installer/Makefile (1 hunks)
  • packages/system/kubeovn/values.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
packages/apps/clickhouse/values.yaml

[error] 59-59: trailing spaces

(trailing-spaces)

packages/apps/redis/values.yaml

[error] 24-24: trailing spaces

(trailing-spaces)

packages/apps/postgres/templates/db.yaml

[error] 9-9: syntax error: could not find expected ':'

(syntax)

packages/apps/kafka/templates/kafka.yaml

[error] 12-12: syntax error: could not find expected ':'

(syntax)

packages/apps/mysql/values.yaml

[error] 67-67: trailing spaces

(trailing-spaces)

packages/apps/kafka/values.yaml

[error] 52-52: trailing spaces

(trailing-spaces)

packages/apps/ferretdb/values.yaml

[error] 61-61: trailing spaces

(trailing-spaces)

packages/apps/postgres/values.yaml

[error] 89-89: trailing spaces

(trailing-spaces)

packages/apps/rabbitmq/values.yaml

[error] 52-52: trailing spaces

(trailing-spaces)

packages/apps/nats/values.yaml

[error] 74-74: trailing spaces

(trailing-spaces)

🪛 LanguageTool
packages/apps/ferretdb/README.md

[uncategorized] ~35-~35: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~35-~35: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/redis/README.md

[uncategorized] ~24-~24: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~24-~24: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/nats/README.md

[uncategorized] ~18-~18: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~18-~18: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/rabbitmq/README.md

[uncategorized] ~30-~30: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~30-~30: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano |...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/clickhouse/README.md

[uncategorized] ~50-~50: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~50-~50: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/mysql/README.md

[uncategorized] ~97-~97: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~97-~97: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/postgres/README.md

[uncategorized] ~72-~72: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... 2xlarge). This is ignored if resources is set (resources is recommended for produ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~72-~72: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... ignored if resources is set (resources is recommended for production). | nano ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

🔇 Additional comments (36)
packages/apps/tenant/README.md (1)

60-60: Updated Default for the isolated Parameter

The default value for the isolated parameter has been updated from false to true to enforce tenant namespace isolation by default. This change aligns well with the intended security posture and is clearly reflected in the documentation through the updated table entry.

packages/apps/tenant/values.schema.json (1)

33-33: Synchronized Default for isolated in JSON Schema

The JSON schema now sets the default value for the isolated property to true, ensuring consistency with the documentation update in the README. This update enforces tenant isolation by default, which is crucial for maintaining secure network policies.

packages/apps/redis/Chart.yaml (1)

19-19: Version Update for Redis Chart
The chart version is correctly updated to 0.6.0, aligning with the coordinated version bump across applications.

packages/apps/postgres/Chart.yaml (1)

19-19: Postgres Version Bump Confirmation
The version field is bumped to 0.10.0, which reflects the updates and anticipated changes (such as the addition of resource management options) in this chart.

packages/apps/nats/Chart.yaml (1)

19-19: NATS Chart Version Updated
The version increment to 0.5.0 is in line with similar changes across the charts. Please ensure that any resource management presets (if applied in related configuration or README files) are consistent with this version update.

packages/apps/rabbitmq/Chart.yaml (1)

19-19: RabbitMQ Chart Version Adjustment
The version update to 0.5.0 is appropriate. Since this chart now integrates new parameters for resource management (as mentioned in the related PR objectives and documentation updates), verify that the corresponding documentation (e.g., README.md) correctly reflects these new options.

packages/apps/mysql/Chart.yaml (1)

19-19: MySQL Chart Version Increment
The version update to 0.6.0 is properly applied. Ensure that the new resource management features (i.e., the resources and resourcesPreset parameters described in the PR objectives) are consistently configured within the associated values and documentations.

packages/apps/clickhouse/Chart.yaml (1)

19-19: Version number updated appropriately

The chart version has been incremented from 0.6.2 to 0.7.0, which correctly follows semantic versioning practices for adding new functionality (resource management capabilities) without breaking changes.

packages/apps/ferretdb/Chart.yaml (1)

19-19: Version number updated appropriately

The chart version has been incremented from 0.4.2 to 0.5.0, correctly following semantic versioning practices for the addition of the new resource management features.

packages/apps/kafka/Chart.yaml (1)

19-19: Version number updated appropriately

The chart version has been incremented from 0.3.3 to 0.4.0, which correctly follows semantic versioning practices and maintains consistency with the versioning approach used in other charts in this PR.

packages/apps/mysql/templates/mariadb.yaml (1)

76-80: Resource configuration logic looks good

The conditional logic for resource management is well-implemented, using either explicit values or preset definitions. The code handles two scenarios: when custom resources are defined and when a preset is specified.

Note: There's an implicit third case where both .Values.resources is undefined AND .Values.resourcesPreset is "none". In this case, no resources would be defined. Please verify this is the intended behavior.

packages/apps/rabbitmq/templates/_resources.tpl (2)

14-44: Resource preset definitions look well-structured with graduated sizes

The preset structure provides a good range of resource options from nano to 2xlarge. I notice a few patterns:

  1. For smaller sizes (nano through large), limits are consistently 150% of requests for CPU and memory
  2. For xlarge and 2xlarge, the CPU limits scale more aggressively (3x and 6x respectively)
  3. Ephemeral storage has a consistent 50Mi request but much larger 2Gi limit across all sizes

This implementation should provide good flexibility for different workload requirements.


45-49: Good error handling for invalid preset types

The template appropriately validates that the provided preset type exists in the dictionary and fails with a clear error message listing allowed values if an invalid type is specified.

packages/apps/clickhouse/templates/clickhouse.yaml (1)

124-128:

Details

✅ Verification successful

Resource configuration looks good with proper indentation

The conditional logic for resource configuration is implemented correctly with proper indentation (16 spaces) for the container spec context. The implementation provides flexibility by allowing either custom resources or predefined presets.

Note that this implementation directly uses .Values.resources while the RabbitMQ template uses .Values.podTemplate.resources. Ensure this difference is intentional based on your values schema structure.


🏁 Script executed:

#!/bin/bash
# Verify if this resources implementation difference is intentional by checking the values schema

# Check clickhouse values.yaml for resources structure
echo "Checking ClickHouse values.yaml structure:"
cat packages/apps/clickhouse/values.yaml | grep -A 10 "resources\|resourcesPreset"

# Compare with RabbitMQ values structure
echo -e "\nComparing with RabbitMQ values.yaml structure:"
cat packages/apps/rabbitmq/values.yaml | grep -A 10 "resources\|resourcesPreset"

Length of output: 1217


Resource configuration verified with values schema consistency

  • The conditional logic in the ClickHouse template is implemented correctly with proper indentation (16 spaces) and flexibility for custom or preset resources.
  • Verification of both packages/apps/clickhouse/values.yaml and packages/apps/rabbitmq/values.yaml confirms they share an identical structure with a top-level resources key.
  • The original note mentioned that the RabbitMQ template uses .Values.podTemplate.resources, but the values file for RabbitMQ does not define a podTemplate key. Please verify that the RabbitMQ template reference is intentional or update it accordingly if it’s using legacy logic.
packages/apps/kafka/templates/_resources.tpl (3)

1-12: Well-structured template with clear documentation

The header documentation clearly explains the purpose and usage of the template, which helps other developers understand how to use it correctly.


14-14: Good explanation of the resource allocation strategy

The comment explaining the general pattern for setting limits (requests + 50%) helps maintain consistency and makes the implementation more understandable.


45-49: Effective error handling implementation

The error handling is well-implemented, providing clear feedback when an invalid preset type is provided, including listing the allowed values. This will help users quickly identify and fix configuration issues.

packages/apps/postgres/templates/_resources.tpl (1)

1-50: Consistent implementation across applications

The resource presets template is consistent with the implementation in other applications (kafka, clickhouse, etc.), which is excellent for maintainability and user experience. Users will have a predictable experience when configuring resources across different components.

The same consideration about CPU requests for xlarge and 2xlarge presets applies here as well - consider whether the 1.0 CPU request with much higher limits (3.0/6.0) is the intended pattern for these workload sizes.

packages/apps/redis/templates/redisfailover.yaml (2)

28-32: Conditional Resource Configuration for Sentinel

The conditional block for the Sentinel resource configuration is well implemented by checking for .Values.resources and falling back to a preset when it is not specified. Please ensure that the referenced resources.preset template returns valid YAML and that the indentation (with nindent 6) remains correct in all cases.


35-39: Conditional Resource Configuration for Redis

This block mirrors the Sentinel logic and maintains consistency for the Redis resource configuration. As with the Sentinel block, confirm that the generated YAML from the resources.preset template is correct and that the indentation meets expectations.

packages/apps/postgres/templates/db.yaml (1)

8-12: Ensure Valid YAML Output for Resource Configuration

The conditional resource configuration introduced here is a good approach for offering both custom resource definitions and preset-based configurations. However, YAMLlint has flagged a potential syntax error on line 9 (e.g., "could not find expected ':'"). Please verify the rendered YAML output after templating to ensure that the toYaml conversion and subsequent indentation produce valid YAML.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 9-9: syntax error: could not find expected ':'

(syntax)

packages/apps/nats/values.schema.json (1)

50-59: JSON Schema Update: Resource Properties

The addition of the resources (object) and resourcesPreset (string) fields is well documented and aligns with the unified resource management strategy. The default values (an empty object for resources and "nano" for resourcesPreset) seem appropriate. Please verify that these defaults integrate smoothly with downstream templating and schema validation.

packages/apps/mysql/values.schema.json (1)

70-79: MySQL JSON Schema: New Resource Fields

The new resources and resourcesPreset properties are correctly added and documented. Their definitions and default values are consistent with similar changes elsewhere in the project. This unified approach should improve configurability across deployments.

packages/apps/postgres/values.schema.json (1)

105-113: Postgres JSON Schema: Consistent Resource Properties

The additions of resources and resourcesPreset are clear and maintain consistency with the other applications’ schemas. Ensure that these changes integrate seamlessly with the rest of the schema definitions and that validations pass without conflicts in your CI pipeline.

packages/apps/rabbitmq/values.schema.json (1)

30-39: Good addition of resource management options.

The new resources and resourcesPreset properties provide flexible resource configuration options for RabbitMQ deployments. The comprehensive description for resourcesPreset clearly explains its relationship with the resources property and provides guidance on production usage.

packages/apps/nats/templates/_resources.tpl (1)

1-50: Well-structured resource presets template.

The template provides a comprehensive set of resource presets with appropriate scaling across different sizes. The implementation is robust with:

  • Clear documentation and attribution
  • Well-defined resource tiers from nano to 2xlarge
  • Proper error handling for invalid preset types
  • Consistent pattern of setting limits at approximately 150% of requests
packages/apps/clickhouse/values.yaml (1)

60-60: Resource Preset Parameter Implementation
The new resourcesPreset parameter is defined with a default value of "nano". Its documentation clearly states that it is ignored if explicit resource settings are provided—a design decision that aligns with best practices for production environments.

packages/apps/postgres/values.yaml (1)

90-90: Resource Preset Parameter Implementation
The resourcesPreset parameter is appropriately set to "nano" by default and its purpose—using a common preset unless explicit resources are specified—is clearly documented.

packages/apps/nats/templates/nats.yaml (1)

41-51: Conditional Resource Configuration in NATS Template
The new podTemplate section under nats introduces dynamic resource configuration. The conditional logic properly checks for an explicit .Values.resources value and falls back to using a preset—via the resources.preset Mustache template—if .Values.resourcesPreset is not set to "none". This implementation provides the flexibility intended by the PR objectives.

packages/apps/mysql/values.yaml (1)

68-68: Resource Preset Parameter Implementation
The resourcesPreset parameter is defined with a default value of "nano" and comes with a clear explanation that it will be ignored when resources is explicitly configured. This aligned approach ensures consistency across the charts.

packages/apps/ferretdb/values.yaml (1)

51-63: Appropriate resource management parameters added

The addition of resources and resourcesPreset parameters provides useful configuration options for managing container resources. This follows good Helm chart practices by allowing both explicit resource definitions and simplified preset-based configurations.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 61-61: trailing spaces

(trailing-spaces)

packages/apps/kafka/values.schema.json (1)

55-65: Schema properly configured for new resource parameters

The schema correctly defines the new resources and resourcesPreset properties with appropriate types, descriptions, and default values. This ensures proper validation of user input and provides clear documentation about parameter usage.

packages/apps/mysql/templates/_resources.tpl (2)

1-50: Well-structured resource presets template

This template provides a robust implementation of resource presets with:

  • Clear documentation and purpose
  • Well-defined preset configurations for different resource sizes
  • Proper error handling for invalid preset types
  • Consistent pattern of setting limits as requests + 50%

The warning about presets being for testing rather than production is a good practice to set appropriate expectations.


46-49: Excellent error handling implementation

The error reporting includes both the invalid key and all allowed values, which provides actionable information to users. This follows best practices for user-friendly error messages.

packages/apps/kafka/README.md (1)

19-23: Documentation properly updated with new parameters

The README has been correctly updated to document the new resources and resourcesPreset parameters with clear descriptions and default values. The table formatting is consistent with the rest of the documentation.

packages/apps/versions_map (1)

10-11: Version mapping updates look appropriate.

The changes follow a consistent pattern of:

  1. Updating previous versions from HEAD to specific commit hashes
  2. Adding new versions with HEAD reference

This is good practice for version management and ensures that the versions properly track the development history.

Also applies to: 18-19, 32-33, 63-64, 70-71, 84-85, 93-94, 100-101

Comment thread packages/apps/rabbitmq/templates/rabbitmq.yaml
Comment thread packages/apps/clickhouse/values.schema.json
Comment thread packages/apps/kafka/templates/kafka.yaml
Comment thread packages/apps/ferretdb/templates/postgres.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants