8000 Enable user-added params in tenant cluster Cilium by lllamnyp · Pull Request #917 · cozystack/cozystack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enable user-added params in tenant cluster Cilium #917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025

Conversation

lllamnyp
Copy link
Member
@lllamnyp lllamnyp commented May 5, 2025

Users requested the possibility of passing custom values to the Cilium HelmRelease in tenant k8s clusters to enable its latest features, such as support for the Gateway API. This customization is now available via the valuesOverride field under addons.cilium in the kubernetes' app values.

Summary by CodeRabbit

  • New Features
    • Added support for custom override values for the Cilium addon, allowing users to configure Cilium settings via the values file.
  • Chores
    • Updated the Kubernetes chart version to 0.20.0.
    • Updated version mappings to reflect the new chart version.
  • Documentation
    • Updated Kubernetes managed service docs to include configuration details for Cilium addon overrides.

@lllamnyp lllamnyp requested review from kvaps and klinch0 as code owners May 5, 2025 12:02
Copy link
Contributor
coderabbitai bot commented May 5, 2025

Walkthrough

This change introduces a new configuration section for the Cilium CNI plugin within the Kubernetes Helm chart. It centralizes default Cilium values in a reusable Helm template and allows users to override these defaults via a new valuesOverride field under addons.cilium. The HelmRelease resource for Cilium now dynamically merges user overrides with default values. The chart version is incremented to 0.20.0, and the version mapping is updated accordingly. Schema and default values files are updated to support the new configuration pattern. Additionally, a new minimal bucket app was introduced with placeholder files including README, values, and schema.

Changes

File(s) Change Summary
packages/apps/kubernetes/Chart.yaml Chart version incremented from 0.19.0 to 0.20.0.
packages/apps/kubernetes/templates/helmreleases/cilium.yaml Introduced cozystack.defaultCiliumValues template; switched to dynamic merge of user overrides and defaults.
packages/apps/kubernetes/values.schema.json
packages/apps/kubernetes/values.yaml
Added new addons.cilium configuration section with valuesOverride field in schema and default values.
packages/apps/versions_map Updated kubernetes version 0.19.0 to a specific commit; added 0.20.0 with HEAD.
packages/apps/bucket/README.md
packages/apps/bucket/values.schema.json
packages/apps/bucket/values.yaml
Added new minimal bucket app with placeholder README, empty values schema, and empty default values.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Helm Chart
    participant Cilium HelmRelease

    User->>Helm Chart: Provide .Values.addons.cilium.valuesOverride (optional)
    Helm Chart->>Helm Chart: Merge valuesOverride with defaultCiliumValues
    Helm Chart->>Cilium HelmRelease: Apply merged Cilium values
    Cilium HelmRelease->>Kubernetes: Deploy Cilium with final configuration
Loading

Suggested labels

ok-to-test

Suggested reviewers

  • klinch0

Poem

In the Kubernetes garden where Cilium weaves,
A rabbit hops with Helm up its sleeves.
Merging defaults with user delight,
Overriding values, making things right.
Chart bumps ahead, the map’s up to date—
Oh what a cozy, configurable fate!
🐇✨


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.

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.

Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

8000

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/apps/kubernetes/values.yaml (1)

45-49: Add Cilium addon configuration placeholder
A new cilium block with valuesOverride: {} has been introduced under addons, following the pattern established by other plugins. This gives users a hook to supply custom Helm values for the Cilium deployment.
Consider whether an explicit enabled flag should be added for consistency with other addons, or document that Cilium is always installed by design.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 062d728 and 3633cf7.

📒 Files selected for processing (5)
  • packages/apps/kubernetes/Chart.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/cilium.yaml (2 hunks)
  • packages/apps/kubernetes/values.schema.json (1 hunks)
  • packages/apps/kubernetes/values.yaml (1 hunks)
  • packages/apps/versions_map (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
packages/apps/kubernetes/templates/helmreleases/cilium.yaml

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

(syntax)

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

19-19: Chart version bump to 0.20.0
The version field has been correctly incremented from 0.19.0 to 0.20.0 to reflect the new Cilium addon feature. Ensure that any downstream automation, release notes, or documentation referencing the previous chart version are updated accordingly.

packages/apps/versions_map (1)

62-63: Pinned previous version and added new version
The entry for kubernetes 0.19.0 is now pinned to commit 93bdf411, and a new 0.20.0 version is mapped to HEAD, aligning perfectly with the chart bump. This maintains reproducible deployments for existing users while allowing the new release to track the latest code.

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

148-157: Schema for Cilium addon valuesOverride
The JSON schema now includes a cilium object under addons with a valuesOverride property defaulting to an empty object, mirroring the YAML defaults.
Please verify that omitting an enabled boolean is intentional, as it diverges from the pattern used by other addons.

packages/apps/kubernetes/templates/helmreleases/cilium.yaml (2)

1-8: Introduce reusable defaultCiliumValues template
The cozystack.defaultCiliumValues Helm template centralizes all default Cilium configuration values, reducing duplication and streamlining future updates. This is a solid application of Helm library chart best practices.

🧰 Tools
🪛 YAMLlint (1.35.1)

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

(syntax)


43-43: Merge user overrides with default Cilium values
Leveraging deepCopy, mergeOverwrite, and toYaml ensures that .Values.addons.cilium.valuesOverride takes precedence over the built-in defaults. Make sure to run helm lint or helm template across various override scenarios to confirm the output is syntactically valid YAML.

Copy link
Member
@kvaps kvaps left a comment

Choose a reason for hiding this comment

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

LGTM

@lllamnyp lllamnyp force-pushed the parametrize-tenant-cilium branch from 3633cf7 to 5f84246 Compare May 5, 2025 12:23
Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/apps/kubernetes/templates/helmreleases/cilium.yaml (1)

1-8: Suppress YAMLlint false positives on Helm templates
YAMLlint is flagging the Jinja blocks as syntax errors (see static analysis hint). These are false positives in the context of Helm templating. Consider disabling or ignoring linting for this file (e.g., via a # yamllint disable directive) or updating your linter configuration to recognize Helm template syntax and reduce noise.

🧰 Tools
🪛 YAMLlint (1.35.1)

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

(syntax)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3633cf7 and 5f84246.

📒 Files selected for processing (8)
  • packages/apps/bucket/README.md (1 hunks)
  • packages/apps/bucket/values.schema.json (1 hunks)
  • packages/apps/bucket/values.yaml (1 hunks)
  • packages/apps/kubernetes/Chart.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/cilium.yaml (2 hunks)
  • packages/apps/kubernetes/values.schema.json (1 hunks)
  • packages/apps/kubernetes/values.yaml (1 hunks)
  • packages/apps/versions_map (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • packages/apps/bucket/values.yaml
  • packages/apps/bucket/README.md
  • packages/apps/bucket/values.schema.json
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/apps/kubernetes/Chart.yaml
  • packages/apps/kubernetes/values.yaml
  • packages/apps/kubernetes/values.schema.json
  • packages/apps/versions_map
🧰 Additional context used
🪛 YAMLlint (1.35.1)
packages/apps/kubernetes/templates/helmreleases/cilium.yaml

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

(syntax)

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

1-8: Centralize default Cilium configuration
Great use of a reusable Helm template (cozystack.defaultCiliumValues) to define and centralize default Cilium settings. This will improve maintainability and ensure consistent defaults across all tenant clusters.

🧰 Tools
🪛 YAMLlint (1.35.1)

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

(syntax)


43-43: Verify override merging precedence
The pipeline merges user-provided valuesOverride onto the default values template via mergeOverwrite. Please confirm that:

  1. If valuesOverride is unset or empty, the defaults from cozystack.defaultCiliumValues are still applied.
  2. Any keys specified in valuesOverride correctly override the defaults.

You might add a brief inline comment here to clarify merge order, or run a quick helm template test with a sample override to validate the behavior.

Users requested the possibility of passing custom values to the Cilium
HelmRelease in tenant k8s clusters to enable its latest features, such
as support for the Gateway API. This customization is now available via
the `valuesOverride` field under `addons.cilium` in the kubernetes' app
values.

Additionally add dummy schema for S3 bucket, as it breaks the pre-commit
checks.

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
@lllamnyp lllamnyp force-pushed the parametrize-tenant-cilium branch from 5f84246 to a03cdef Compare May 5, 2025 12:37
Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/apps/kubernetes/templates/helmreleases/cilium.yaml (2)

1-8: Centralize default values & suppress YAMLlint false positives

  • Extracting default Cilium settings into the cozystack.defaultCiliumValues template is a strong DRY improvement.
  • YAMLlint flags the leading hyphens in {{- define ... -}} as a syntax error, but this is valid Helm templating—ignore or disable YAMLlint for Helm templates.
  • Confirm that 8000 k8sServiceHost: {{ .Release.Name }}.{{ .Release.Namespace }}.svc resolves to your Kubernetes API server (commonly kubernetes.default.svc), or consider aligning with the upstream chart default to avoid DNS mismatches.
🧰 Tools
🪛 YAMLlint (1.35.1)

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

(syntax)


43-43: Verify mergeOverwrite order & improve readability of override logic
Ensure mergeOverwrite is applied so that user-supplied values in valuesOverride always take precedence. The one-liner works if the override map is piped first, but consider refactoring into intermediate variables for clarity:

{{- $defaults   := fromYaml (include "cozystack.defaultCiliumValues" .) }}
{{- $overrides  := deepCopy .Values.addons.cilium.valuesOverride }}
{{- $merged     := mergeOverwrite $overrides $defaults }}
{{- toYaml $merged | nindent 4 }}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5f84246 and a03cdef.

📒 Files selected for processing (9)
  • packages/apps/bucket/README.md (1 hunks)
  • packages/apps/bucket/values.schema.json (1 hunks)
  • packages/apps/bucket/values.yaml (1 hunks)
  • packages/apps/kubernetes/Chart.yaml (1 hunks)
  • packages/apps/kubernetes/README.md (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/cilium.yaml (2 hunks)
  • packages/apps/kubernetes/values.schema.json (1 hunks)
  • packages/apps/kubernetes/values.yaml (1 hunks)
  • packages/apps/versions_map (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/apps/bucket/values.yaml
  • packages/apps/kubernetes/README.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/apps/kubernetes/Chart.yaml
  • packages/apps/versions_map
  • packages/apps/bucket/README.md
  • packages/apps/bucket/values.schema.json
  • packages/apps/kubernetes/values.yaml
  • packages/apps/kubernetes/values.schema.json
🧰 Additional context used
🪛 YAMLlint (1.35.1)
packages/apps/kubernetes/templates/helmreleases/cilium.yaml

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

(syntax)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and Test

@lllamnyp lllamnyp enabled auto-merge May 5, 2025 12:51
@lllamnyp lllamnyp merged commit 0346dc0 into main May 5, 2025
6 checks passed
@lllamnyp lllamnyp deleted the parametrize-tenant-cilium branch May 5, 2025 12:55
lllamnyp added a commit that referenced this pull request May 20, 2025
Users requested the possibility of passing custom values to the Cilium
HelmRelease in tenant k8s clusters to enable its latest features, such
as support for the Gateway API. This customization is now available via
the `valuesOverride` field under `addons.cilium` in the kubernetes' app
values.

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

- **New Features**
- Added support for custom override values for the Cilium addon,
allowing users to configure Cilium settings via the values file.
- **Chores**
  - Updated the Kubernetes chart version to 0.20.0.
  - Updated version mappings to reflect the new chart version.
- **Documentation**
- Updated Kubernetes managed service docs to include configuration
details for Cilium addon overrides.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit 0346dc0)
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
@lllamnyp lllamnyp mentioned this pull request May 20, 2025
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
0