Skip to content

[kubernetes] Refactor controlPlane settings - #866

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
kubernetes-cp
Apr 24, 2025
Merged

[kubernetes] Refactor controlPlane settings#866
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
kubernetes-cp

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Apr 23, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Documentation
    • Updated documentation to rename and restructure the control plane resource configuration section, replacing the old naming with a unified "Kubernetes control plane configuration" and updated parameter prefixes.
  • Refactor
    • Consolidated and renamed control plane configuration from kamajiControlPlane to controlPlane across configuration files.
    • Flattened configuration structure and updated all related parameter references and hierarchy for improved clarity and consistency.
  • New Features
    • Enhanced resource preset options with expanded enum values for control plane components.
    • Introduced default configuration snippets for ingress-nginx and vertical-pod-autoscaler Helm releases.
  • Bug Fixes
    • Simplified HelmRelease manifests by embedding override values inline, removing dependency on external Secret resources for addons including cert-manager, GPU operator, ingress-nginx, vertical-pod-autoscaler, and fluxcd.

@coderabbitai

coderabbitai Bot commented Apr 23, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes consolidate and rename the Kubernetes control plane resource configuration across documentation, schema, Helm templates, and values files. The configuration section previously named kamajiControlPlane has been replaced with controlPlane, and all related parameter names and references have been updated accordingly. The controlPlane section now directly contains resource and preset settings for apiServer, controllerManager, scheduler, and konnectivity.server. No functional or logic changes were introduced; only the structure and naming of configuration keys have been unified and updated. Additionally, several HelmRelease manifests were modified to embed override values inline instead of using external Secrets.

Changes

File(s) Change Summary
packages/apps/kubernetes/README.md Updated documentation to rename and restructure the control plane configuration section from kamajiControlPlane to controlPlane. Adjusted parameter prefixes and order, but retained descriptions and default values.
packages/apps/kubernetes/templates/cluster.yaml Updated all Helm template references from .Values.kamajiControlPlane to .Values.controlPlane for control plane resource and preset fields. No logic changes.
packages/apps/kubernetes/values.schema.json Removed the kamajiControlPlane object and nested properties from the schema. Added equivalent properties under the controlPlane object, including resource preset and resource fields for apiServer, controllerManager, scheduler, and konnectivity.server.
packages/apps/kubernetes/values.yaml Removed the kamajiControlPlane configuration section. Introduced a new controlPlane section with updated nested configuration for all control plane components. Updated parameter comments and flattened the structure for konnectivity.server.
packages/apps/kubernetes/Makefile Extended the generate target to update values.schema.json in place, setting enum values for resourcesPreset under controlPlane components (apiServer, controllerManager, scheduler, konnectivity.server) to standardized presets.
packages/apps/kubernetes/templates/helmreleases/cert-manager.yaml Changed HelmRelease manifest to embed override values inline under values: instead of referencing an external Secret. Removed Secret resource creation and valuesFrom usage.
packages/apps/kubernetes/templates/helmreleases/gpu-operator.yaml Changed HelmRelease manifest to embed override values inline under values: instead of referencing an external Secret. Removed Secret resource creation and valuesFrom usage.
packages/apps/kubernetes/templates/helmreleases/ingress-nginx.yaml Changed HelmRelease manifest to embed override values inline under values: instead of referencing an external Secret. Removed Secret resource creation and valuesFrom usage. Added a new Helm template snippet cozystack.defaultIngressValues for default ingress-nginx configuration.
packages/apps/kubernetes/templates/helmreleases/vertical-pod-autoscaler.yaml Changed HelmRelease manifest to embed override values inline under values: instead of referencing an external Secret. Removed Secret resource creation and valuesFrom usage. Added a new Helm template snippet cozystack.defaultVPAValues for default vertical-pod-autoscaler configuration.
packages/apps/kubernetes/templates/helmreleases/fluxcd.yaml Changed HelmRelease manifest to embed override values inline under values: instead of referencing an external Secret. Removed Secret resource creation and valuesFrom usage.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant values.yaml
    participant Helm Chart
    participant Kubernetes Cluster

    User->>values.yaml: Defines controlPlane resource settings
    values.yaml->>Helm Chart: Supplies controlPlane configuration
    Helm Chart->>Kubernetes Cluster: Applies resource presets and limits for apiServer, controllerManager, scheduler, konnectivity.server
Loading
sequenceDiagram
    participant User
    participant values.yaml
    participant HelmRelease Template
    participant Kubernetes Cluster

    User->>values.yaml: Defines addon override values
    values.yaml->>HelmRelease Template: Supplies override values inline under `values:` key
    HelmRelease Template->>Kubernetes Cluster: Deploys addon with inline override values
Loading

Suggested labels

enhancement, size:M

Suggested reviewers

  • klinch0

Poem

In the warren of YAML, we hopped and we pruned,
From kamaji to controlPlane, our configs are tuned.
The presets are tidy, the docs now align,
Our cluster’s more readable—oh how divine!
With carrots and schemas, we leap with delight,
The control plane is unified, and all is just right! 🥕


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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
packages/apps/kubernetes/README.md (2)

62-69: Fix grammatical agreement in preset descriptions.

In each resourcesPreset row, update the phrasing from:

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

to:

… Ignored if resources are set (resources are recommended for production).

This ensures correct plural agreement and improves conciseness.

Example diff:

-| 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 one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). Ignored if resources are set (resources are recommended for production).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~62-~62: 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] ~62-~62: 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). | small ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~65-~65: 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] ~65-~65: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~66-~66: 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] ~66-~66: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~68-~68: 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] ~68-~68: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


64-65: Ensure consistent order of resourcesPreset and resources entries.

The controlPlane.controllerManager table currently lists resources before resourcesPreset, whereas other components list the preset first. Swap these two lines for consistency.

Proposed diff:

-| `controlPlane.controllerManager.resources`         | Resources                                                                             | `{}`    |
-| `controlPlane.controllerManager.resourcesPreset`   | Set container resources … Ignored if resources are set                                 | `micro` |
+| `controlPlane.controllerManager.resourcesPreset`   | Set container resources … Ignored if resources are set                                 | `micro` |
+| `controlPlane.controllerManager.resources`         | Resources                                                                             | `{}`    |
🧰 Tools
🪛 LanguageTool

[uncategorized] ~65-~65: 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] ~65-~65: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

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

118-119: Define defaults for controllerManager resources.

Defaults for the controller manager (resourcesPreset: "micro" and an empty resources map) are correct. Consider swapping the two ## @param comments above to mirror the key order (resourcesPreset before resources) to avoid confusion.

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

21-30: Fix grammatical agreement in resourcesPreset descriptions.

Each resourcesPreset description currently reads:

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

For grammatical correctness and clarity, update to:

… Ignored if resources is set (resources are recommended for production).

Apply this change consistently across apiServer, controllerManager, scheduler, and konnectivity.server.

Example diff for apiServer:

 "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).",
+    "description": "Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). Ignored if resources is set (resources are recommended for production).",
     "default": "small"
 },

Also applies to: 41-45, 51-60, 69-78

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8db92d5 and b1251ff.

📒 Files selected for processing (4)
  • packages/apps/kubernetes/README.md (1 hunks)
  • packages/apps/kubernetes/templates/cluster.yaml (2 hunks)
  • packages/apps/kubernetes/values.schema.json (1 hunks)
  • packages/apps/kubernetes/values.yaml (1 hunks)
🧰 Additional context used
🪛 LanguageTool
packages/apps/kubernetes/README.md

[uncategorized] ~62-~62: 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] ~62-~62: 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). | small ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~65-~65: 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] ~65-~65: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~66-~66: 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] ~66-~66: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~68-~68: 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] ~68-~68: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and Test
🔇 Additional comments (9)
packages/apps/kubernetes/templates/cluster.yaml (4)

113-117: Update apiServer resource references to controlPlane.

The Helm template now correctly sources .Values.controlPlane.apiServer instead of the old .Values.kamajiControlPlane. The conditional logic and indentation remain unchanged.


119-123: Update controllerManager resource references to controlPlane.

The .Values.controlPlane.controllerManager path is now used consistently for both direct resources and presets. Resource handling logic is preserved.


125-129: Update scheduler resource references to controlPlane.

The scheduler block correctly pulls from .Values.controlPlane.scheduler.resources and .Values.controlPlane.scheduler.resourcesPreset. No functional changes.


138-142: Update konnectivity.server resource references to controlPlane.

The nested addons.konnectivity.server block has been flattened to .Values.controlPlane.konnectivity.server. Both direct and preset‐based resource logic remain intact.

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

58-60: Rename section header to reflect unified naming.

The new "Kubernetes control plane configuration" header accurately replaces the previous kamajiControlPlane terminology with controlPlane, matching the refactor across the chart.

packages/apps/kubernetes/values.yaml (4)

94-99: Introduce new controlPlane section.

The previous kamajiControlPlane block has been removed and replaced with a top-level controlPlane section (including replicas: 2). This aligns the values file with the updated Helm templates and documentation.


112-113: Define defaults for apiServer resources.

Defaults for the API server (resourcesPreset: "small" and an empty resources map) are correctly set and match the schema.


124-125: Define defaults for scheduler resources.

The scheduler’s default settings (resourcesPreset: "micro", resources: {}) align with both the schema and chart logic.


131-132: Define defaults for konnectivity server resources.

The flattened controlPlane.konnectivity.server section (resourcesPreset: "micro", resources: {}) correctly reflects the new hierarchical structure.

Comment thread packages/apps/kubernetes/values.schema.json Outdated
@kvaps
Andrei Kvapil (kvaps) force-pushed the kubernetes-cp branch 3 times, most recently from 8525df6 to de2d71d Compare April 23, 2025 21:54

@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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b1251ff and de2d71d.

📒 Files selected for processing (9)
  • packages/apps/kubernetes/Makefile (1 hunks)
  • packages/apps/kubernetes/README.md (1 hunks)
  • packages/apps/kubernetes/templates/cluster.yaml (2 hunks)
  • packages/apps/kubernetes/templates/helmreleases/cert-manager.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/gpu-operator.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/ingress-nginx.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/vertical-pod-autoscaler.yaml (1 hunks)
  • packages/apps/kubernetes/values.schema.json (1 hunks)
  • packages/apps/kubernetes/values.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/apps/kubernetes/Makefile
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/apps/kubernetes/templates/cluster.yaml
  • packages/apps/kubernetes/values.schema.json
  • packages/apps/kubernetes/values.yaml
🧰 Additional context used
🪛 LanguageTool
packages/apps/kubernetes/README.md

[uncategorized] ~62-~62: 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] ~62-~62: 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). | small ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~65-~65: 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] ~65-~65: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~66-~66: 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] ~66-~66: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~68-~68: 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] ~68-~68: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build and Test
  • GitHub Check: pre-commit
🔇 Additional comments (7)
packages/apps/kubernetes/templates/helmreleases/cert-manager.yaml (1)

33-36: Inline override values block correctly replaces external Secret
The with .Values.addons.certManager.valuesOverride block cleanly embeds user-supplied overrides directly under values:. Using toYaml . | nindent 4 ensures proper indentation and aligns with the other HelmRelease templates in this PR.

packages/apps/kubernetes/templates/helmreleases/gpu-operator.yaml (1)

33-36: Consistent inline values override for GPU operator
Switching from a Secret-backed valuesFrom to an inline values: block via with and toYaml . | nindent 4 is implemented correctly, matching the pattern established across other addon HelmReleases.

packages/apps/kubernetes/README.md (4)

58-59: Skip trivial heading rename
The header change from the old section title to ### Kubernetes control plane configuration is clear and self-explanatory; no further review needed here.


62-63: Approve apiServer parameter rename and ordering
The entries for controlPlane.apiServer.resourcesPreset followed by controlPlane.apiServer.resources correctly reflect the new prefix and the intended ordering (preset first, then explicit resources).

🧰 Tools
🪛 LanguageTool

[uncategorized] ~62-~62: 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] ~62-~62: 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). | small ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


66-67: Approve scheduler parameter rename and ordering
The entries for controlPlane.scheduler.resourcesPreset followed by controlPlane.scheduler.resources correctly use the new prefix and the preset-then-resources ordering.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~66-~66: 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] ~66-~66: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


68-69: Approve konnectivity.server parameter rename and ordering
The entries for controlPlane.konnectivity.server.resourcesPreset followed by controlPlane.konnectivity.server.resources are correctly updated and ordered.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~68-~68: 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] ~68-~68: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/kubernetes/templates/helmreleases/vertical-pod-autoscaler.yaml (1)

56-59:

Details

❓ Verification inconclusive

Validate override injection and mapping structure

The new inline values: block replaces the external Secret reference, but please verify:

  1. Flux’s HelmRelease CRD supports multiple values: entries under spec and appends them rather than clobbering the first map.
  2. The override payload (.Values.addons.verticalPodAutoscaler.valuesOverride) is structured with the same root keys (e.g. vertical-pod-autoscaler:) so it merges into the default chart values.
  3. Rendering the final manifest yields valid YAML and the overrides apply as expected.

🏁 Script executed:

#!/usr/bin/env bash
# Verify HelmRelease rendering with an override value
helm template my-release path/to/chart \
  --set addons.verticalPodAutoscaler.valuesOverride.vertical-pod-autoscaler.recommender.extraArgs.container-name-label=foo \
| yq e '.spec.values' -

Length of output: 371


Validate override injection and mapping structure

Please manually verify the following in packages/apps/kubernetes/templates/helmreleases/vertical-pod-autoscaler.yaml (around lines 56–59):

  • Flux’s HelmRelease CRD merges multiple spec.values entries rather than overwriting earlier blocks.
  • The override object under .Values.addons.verticalPodAutoscaler.valuesOverride uses the same root key (vertical-pod-autoscaler:) so it merges into the chart’s defaults.
  • Rendering the final manifest (for example with helm template … --set addons.verticalPodAutoscaler.valuesOverride.vertical-pod-autoscaler…) produces valid YAML and shows both default and override values under .spec.values.

Comment thread packages/apps/kubernetes/README.md
Comment thread packages/apps/kubernetes/templates/helmreleases/ingress-nginx.yaml Outdated
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/apps/kubernetes/README.md (1)

64-65: Ensure consistent ordering of resourcesPreset before resources for controllerManager

The controlPlane.controllerManager section currently lists resources before resourcesPreset, which is inconsistent with the pattern used for other components. Swap these two lines so that resourcesPreset precedes resources.

- | `controlPlane.controllerManager.resources`         | Resources                                                                                                                    | `{}`    |
- | `controlPlane.controllerManager.resourcesPreset`   | 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). | `micro` |
+ | `controlPlane.controllerManager.resourcesPreset`   | 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). | `micro` |
+ | `controlPlane.controllerManager.resources`         | Resources                                                                                                                    | `{}`    |
🧰 Tools
🪛 LanguageTool

[uncategorized] ~65-~65: 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] ~65-~65: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

🧹 Nitpick comments (2)
packages/apps/kubernetes/README.md (1)

62-69: Improve description grammar for resourcesPreset entries

The phrase "This is ignored if resources is set (resources is recommended for production)" has a verb agreement issue and can be more concise. Consider rewriting to "This setting is ignored if resources are set (resources are recommended for production)" for clarity and consistency.

- This is ignored if resources is set (resources is recommended for production)
+ This setting is ignored if resources are set (resources are recommended for production)
🧰 Tools
🪛 LanguageTool

[uncategorized] ~62-~62: 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] ~62-~62: 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). | small ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~65-~65: 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] ~65-~65: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~66-~66: 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] ~66-~66: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~68-~68: 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] ~68-~68: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

packages/apps/kubernetes/templates/helmreleases/fluxcd.yaml (1)

76-79: Embed fluxcd override values inline
This block replaces the external Secret reference and inlines .Values.addons.fluxcd.valuesOverride under spec.values. Confirm that omitting spec.values entirely when no overrides are provided is acceptable and that the chart’s built-in defaults are applied correctly.

Consider adding a defaultFluxcdValues snippet
For consistency with other addons, you might introduce a default values snippet for FluxCD and merge it with overrides (using merge + toYaml | nindent).

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between de2d71d and 9f5230a.

📒 Files selected for processing (10)
  • packages/apps/kubernetes/Makefile (1 hunks)
  • packages/apps/kubernetes/README.md (1 hunks)
  • packages/apps/kubernetes/templates/cluster.yaml (2 hunks)
  • packages/apps/kubernetes/templates/helmreleases/cert-manager.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/fluxcd.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/gpu-operator.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/ingress-nginx.yaml (2 hunks)
  • packages/apps/kubernetes/templates/helmreleases/vertical-pod-autoscaler.yaml (2 hunks)
  • packages/apps/kubernetes/values.schema.json (1 hunks)
  • packages/apps/kubernetes/values.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/apps/kubernetes/templates/cluster.yaml
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/apps/kubernetes/Makefile
  • packages/apps/kubernetes/templates/helmreleases/cert-manager.yaml
  • packages/apps/kubernetes/values.yaml
  • packages/apps/kubernetes/templates/helmreleases/gpu-operator.yaml
  • packages/apps/kubernetes/values.schema.json
🧰 Additional context used
🪛 YAMLlint (1.35.1)
packages/apps/kubernetes/templates/helmreleases/vertical-pod-autoscaler.yaml

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

(syntax)

packages/apps/kubernetes/templates/helmreleases/ingress-nginx.yaml

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

(syntax)

🪛 LanguageTool
packages/apps/kubernetes/README.md

[uncategorized] ~62-~62: 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] ~62-~62: 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). | small ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~65-~65: 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] ~65-~65: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~66-~66: 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] ~66-~66: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~68-~68: 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] ~68-~68: 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). | micro ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and Test
🔇 Additional comments (4)
packages/apps/kubernetes/templates/helmreleases/vertical-pod-autoscaler.yaml (2)

4-24: Define defaultVPAValues snippet for DRY Helm values
The new snippet centralizes the VPA configuration, making it easier to maintain and update default settings. Using lookup to resolve the namespace and templating the tenant address is a clean approach.


59-59: Merge default VPA values with user overrides
Inlines the merged default settings and .Values.addons.verticalPodAutoscaler.valuesOverride, removing the external Secret indirection. This simplifies overrides and is consistent with the other addon templates.

packages/apps/kubernetes/templates/helmreleases/ingress-nginx.yaml (2)

1-11: Review default ingress-nginx values snippet
The defaultIngressValues snippet encapsulates common overrides (fullnameOverride, controller settings, nodeSelector). Please verify these defaults match the chart’s values.yaml, as any drift in chart parameters could lead to misconfigurations.

🧰 Tools
🪛 YAMLlint (1.35.1)

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

(syntax)


46-46: Inline merge of default and override ingress-nginx values
Replaces the previous valuesFrom Secret pattern with a direct merge of defaultIngressValues and .Values.addons.ingressNginx.valuesOverride. This streamlines value management and aligns with the refactoring of other HelmReleases.

Comment on lines +1 to 3
{{- define "cozystack.defaultVPAValues" -}}
{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }}
{{- $targetTenant := index $myNS.metadata.annotations "namespace.cozystack.io/monitoring" }}

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

Handle missing monitoring annotation gracefully
Indexing directly into metadata.annotations will cause a template error if the annotation is not present. Introduce a fallback using the default function so clusters without the annotation don’t break the chart rendering.

- {{- $targetTenant := index $myNS.metadata.annotations "namespace.cozystack.io/monitoring" }}
+ {{- $targetTenant := default .Release.Namespace (index $myNS.metadata.annotations "namespace.cozystack.io/monitoring") }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{{- define "cozystack.defaultVPAValues" -}}
{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }}
{{- $targetTenant := index $myNS.metadata.annotations "namespace.cozystack.io/monitoring" }}
{{- define "cozystack.defaultVPAValues" -}}
{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }}
{{- $targetTenant := default .Release.Namespace (index $myNS.metadata.annotations "namespace.cozystack.io/monitoring") }}
🧰 Tools
🪛 YAMLlint (1.35.1)

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

(syntax)

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