-
Notifications
You must be signed in to change notification settings - Fork 118
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
feat: add support for custom deployment annotations and labels #144
base: main
Are you sure you want to change the base?
feat: add support for custom deployment annotations and labels #144
Conversation
WalkthroughThis update refines the n8n Helm chart by raising its version and revising its description in Chart.yaml. The deployment templates for the main application, worker, and webhook now include conditional sections that add deployment labels and annotations when specified. In addition, the values.yaml file has been extended with new configuration options for custom annotations and labels on both deployments and pods. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Helm
participant Kubernetes
User->>Helm: Run helm install/upgrade with custom values
Helm->>Helm: Render templates (evaluate conditionals for labels/annotations)
Helm->>Kubernetes: Submit deployment manifests with custom metadata
Kubernetes-->>User: Confirm deployment creation
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 (6)
charts/n8n/templates/deployment.yaml (2)
7-9
: Ensure Correct Indentation for Main Deployment Labels
The conditional block for including custom deployment labels using
{{- if .Values.main.deploymentLabels }}
{{- toYaml .Values.main.deploymentLabels | nindent 4 }}
{{- end }}
is well implemented. Please confirm that the rendered YAML maintains the proper structure. (Note: YAML lint warnings here can be false positives due to Helm templating.)🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 7-7: wrong indentation: expected 2 but found 4
(indentation)
[warning] 8-8: wrong indentation: expected 2 but found 4
(indentation)
[warning] 9-9: wrong indentation: expected 2 but found 4
(indentation)
10-13
: Ensure Correct Indentation for Main Deployment Annotations
The new block for deployment annotations
{{- if .Values.main.deploymentAnnotations }}
annotations:
{{- toYaml .Values.main.deploymentAnnotations | nindent 4 }}
{{- end }}
is correct. Please verify that the final output YAML nests the annotations at the intended level.charts/n8n/templates/deployment.worker.yaml (2)
8-10
: Ensure Correct Indentation for Worker Deployment Labels
The addition of the conditional block forworker.deploymentLabels
(lines 8–10) usestoYaml
withnindent 4
appropriately. Confirm that the rendered YAML is correctly indented given the block’s context.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 9-9: wrong indentation: expected 2 but found 4
(indentation)
[warning] 10-10: wrong indentation: expected 2 but found 4
(indentation)
11-14
: Ensure Correct Indentation for Worker Deployment Annotations
The block adding deployment annotations for the worker (lines 11–14) appears well structured. As with the main deployment block, verify that the final YAML output meets your requirements—ignoring potential YAML lint false positives.charts/n8n/templates/deployment.webhook.yaml (2)
10-12
: Ensure Correct Indentation for Webhook Deployment Labels
The new conditional block forwebhook.deploymentLabels
(lines 10–12) is implemented similarly to the other components. Please double-check the rendered YAML for proper structure and spacing.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 11-11: wrong indentation: expected 2 but found 4
(indentation)
[warning] 12-12: wrong indentation: expected 2 but found 4
(indentation)
13-16
: Ensure Correct Indentation for Webhook Deployment Annotations
The block adding deployment annotations (lines 13–16) is clear and consistent with the other template changes. As always, validate the final produced YAML format.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
charts/n8n/Chart.yaml
(2 hunks)charts/n8n/templates/deployment.webhook.yaml
(1 hunks)charts/n8n/templates/deployment.worker.yaml
(1 hunks)charts/n8n/templates/deployment.yaml
(1 hunks)charts/n8n/values.yaml
(3 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
charts/n8n/templates/deployment.yaml
[warning] 7-7: wrong indentation: expected 2 but found 4
(indentation)
[warning] 8-8: wrong indentation: expected 2 but found 4
(indentation)
[warning] 9-9: wrong indentation: expected 2 but found 4
(indentation)
charts/n8n/templates/deployment.webhook.yaml
[warning] 11-11: wrong indentation: expected 2 but found 4
(indentation)
[warning] 12-12: wrong indentation: expected 2 but found 4
(indentation)
charts/n8n/templates/deployment.worker.yaml
[warning] 9-9: wrong indentation: expected 2 but found 4
(indentation)
[warning] 10-10: wrong indentation: expected 2 but found 4
(indentation)
🔇 Additional comments (5)
charts/n8n/Chart.yaml (2)
3-3
: Chart Version Updated
The chart version has been bumped from 1.1.0 to 1.2.0. This correctly signals the release of the new features.
37-37
: Updated Description for Deployment Metadata Enhancements
The annotation description now reads “Add support to add custom deployment annotations and labels,” which clearly describes the enhancement.charts/n8n/values.yaml (3)
149-157
: Main Service Deployment and Pod Metadata Configurations Added
New keys have been introduced for the main service:
•deploymentAnnotations: {}
•deploymentLabels: {}
•podAnnotations: {}
•podLabels: {}
These additions are clear, use default empty dictionaries for backward compatibility, and should be correctly picked up by your templates.
340-347
: Worker Metadata Configurations Introduced
The worker section now includes:
•deploymentAnnotations: {}
•deploymentLabels: {}
•podAnnotations: {}
•podLabels: {}
These changes mirror the main service configuration and increase consistency.
527-534
: Webhook Metadata Configurations Introduced
The new configuration options for the webhook section enable custom deployment annotations and labels as well as pod metadata overrides. This addition enhances flexibility while keeping backward compatibility.
Add support for custom deployment annotations and labels
Description
This PR is a follow up of the previously raised PR, it adds support for custom annotations and labels at the deployment level. Previously, the chart only supported pod-level annotations and labels. This enhancement allows users to add Kubernetes annotations and labels specifically at the deployment level, which is useful for various deployment management and integration scenarios.
Changes Made
deploymentAnnotations
anddeploymentLabels
fields on each component (main. worker, webhook) in values.yamlExample Usage
Summary by CodeRabbit