Skip to content

feat: add hpa for workers and webhooks#186

Open
simonefrancia wants to merge 8 commits into8gears:mainfrom
simonefrancia:main
Open

feat: add hpa for workers and webhooks#186
simonefrancia wants to merge 8 commits into8gears:mainfrom
simonefrancia:main

Conversation

@simonefrancia
Copy link

@simonefrancia simonefrancia commented May 19, 2025

Add HPA Support for Webhook and Worker Components

✨ Summary

This PR introduces support for Horizontal Pod Autoscalers (HPA) for both the webhook and worker components in the Helm chart.

🆕 Changes Introduced

  • Added a new template:
    charts/n8n/templates/hpa.webhook.yaml
    Defines an HPA resource for the webhook deployment, conditionally created based on .Values.webhook.autoscaling.enabled.

  • Added a new template:
    charts/n8n/templates/hpa.worker.yaml
    Defines an HPA resource for the worker deployment, conditionally created based on .Values.worker.autoscaling.enabled.

⚙️ Configuration

Each HPA supports:

  • minReplicas
  • maxReplicas
  • CPU utilization threshold (targetCPUUtilizationPercentage)
  • Memory utilization threshold (targetMemoryUtilizationPercentage)

These values are configurable via:

webhook:
  autoscaling:
    enabled: true
    minReplicas: 1
    maxReplicas: 5
    targetCPUUtilizationPercentage: 80
    targetMemoryUtilizationPercentage: 75

worker:
  autoscaling:
    enabled: true
    minReplicas: 1
    maxReplicas: 5
    targetCPUUtilizationPercentage: 80
    targetMemoryUtilizationPercentage: 75

🧪 Notes

  • The HPA definitions are optional and only deployed if enabled in values.
  • This enhances scalability and resource efficiency for webhook and worker components.

Summary by CodeRabbit

  • New Features

    • Added autoscaling support for webhook and worker components using HorizontalPodAutoscalers, with configurable minimum/maximum replicas and optional CPU and/or memory utilization targets.
  • Chores

    • Helm chart and app version bumped; release annotations updated to document the new autoscaling support.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 19, 2025

Walkthrough

Adds two conditional Helm templates that create Kubernetes HorizontalPodAutoscaler resources for n8n's webhook and worker when enabled via values; updates chart metadata by bumping version to 1.0.16 and appVersion to 1.112.1 and adjusts the artifacthub changelog entry.

Changes

Cohort / File(s) Change Summary
HPAs (new templates)
charts/n8n/templates/hpa.webhook.yaml, charts/n8n/templates/hpa.worker.yaml
Added conditional Helm templates that create HorizontalPodAutoscaler resources for webhook and worker deployments; support min/max replicas and optional CPU and memory utilization targets driven by values.
Chart metadata
charts/n8n/Chart.yaml
Bumped version from 1.0.15 to 1.0.16 and appVersion from 1.112.0 to 1.112.1; updated annotations.artifacthub.io/changes to an "added" note describing autoscaling support for workers and webhooks.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Helm
    participant K8sAPI

    User->>Helm: helm install/upgrade n8n (values)
    Helm->>K8sAPI: render/create Deployment(webhook) and Deployment(worker)
    alt .Values.webhook.autoscaling.enabled
        note right of Helm #D0F0C0: webhook HPA rendered if enabled
        Helm->>K8sAPI: render/create HPA(webhook) with min/max and CPU/memory metrics (if set)
    end
    alt .Values.worker.autoscaling.enabled
        note right of Helm #D0F0C0: worker HPA rendered if enabled
        Helm->>K8sAPI: render/create HPA(worker) with min/max and CPU/memory metrics (if set)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: add hpa for workers and webhooks" is concise, uses a conventional "feat:" prefix, and directly describes the primary change—adding Horizontal Pod Autoscalers for the worker and webhook components—so it accurately summarizes the main change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly uses the conventional commit prefix to indicate a new feature and clearly states the core change—adding HPA support for both worker and webhook components—without including unnecessary details. It is concise and specific, allowing teammates to quickly grasp the pull request’s purpose at a glance. The phrasing directly reflects the main enhancement implemented by the developer and follows the recommended style guidelines. Overall, it provides a clear and focused summary of the primary change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 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 504a379 and 4beedf5.

📒 Files selected for processing (1)
  • charts/n8n/Chart.yaml (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-02T08:05:39.372Z
Learnt from: tsch157
PR: 8gears/n8n-helm-chart#239
File: charts/n8n/Chart.yaml:3-4
Timestamp: 2025-09-02T08:05:39.372Z
Learning: n8n 1.110.0 is a pre-release version and should not be used in production deployments. Always verify if a version is stable before recommending upgrades in the n8n Helm chart.

Applied to files:

  • charts/n8n/Chart.yaml
🔇 Additional comments (2)
charts/n8n/Chart.yaml (2)

37-38: Fix YAML lint (trailing space) and polish wording in change log

There’s trailing whitespace after “added” that fails yamllint, and the description can be clearer/capitalized.

-    - kind: added 
-      description: "add support autoscaling workers and webhooks"
+    - kind: added
+      description: "Add autoscaling support for workers and webhooks"

3-4: Confirm stable appVersion
n8n v1.112.1 is a GA release (released Sep 17, 2025) (docs.n8n.io). No prerelease annotation required.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🧹 Nitpick comments (1)
charts/n8n/templates/hpa.webhook.yaml (1)

33-33: Remove trailing blank line
Eliminate the extra blank line at the end of the file to satisfy YAMLLint’s empty‐lines rule.

🧰 Tools
🪛 YAMLlint (1.37.1)

[warning] 33-33: too many blank lines

(1 > 0) (empty-lines)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 565fbf7 and 4500e1e.

📒 Files selected for processing (2)
  • charts/n8n/templates/hpa.webhook.yaml (1 hunks)
  • charts/n8n/templates/hpa.worker.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
charts/n8n/templates/hpa.webhook.yaml

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

(syntax)


[warning] 33-33: too many blank lines

(1 > 0) (empty-lines)

charts/n8n/templates/hpa.worker.yaml

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

(syntax)

🔇 Additional comments (9)
charts/n8n/templates/hpa.webhook.yaml (5)

1-4: Conditional HPA creation is correctly scoped
Using {{- if .Values.webhook.autoscaling.enabled }} ensures the HPA is only instantiated when autoscaling is explicitly enabled for the webhook.

🧰 Tools
🪛 YAMLlint (1.37.1)

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

(syntax)


5-7: Metadata configuration aligns with chart conventions
The name and labels fields correctly leverage the n8n.fullname and n8n.labels helper templates for consistency across resources.


9-12: Correct scaleTargetRef targeting the webhook Deployment
This block accurately references the webhook Deployment in apps/v1 and matches the naming used elsewhere in the chart.


13-14: Verify default values for replica counts
Ensure that .Values.webhook.autoscaling.minReplicas and .Values.webhook.autoscaling.maxReplicas have sensible defaults in values.yaml to prevent template rendering errors when omitted.


32-32: Properly close the conditional block
The {{- end }} correctly matches the opening if; no changes needed here.

charts/n8n/templates/hpa.worker.yaml (4)

1-4: Conditional HPA creation is correctly scoped
Using {{- if .Values.worker.autoscaling.enabled }} ensures the HPA is only instantiated when autoscaling is explicitly enabled for the worker.

🧰 Tools
🪛 YAMLlint (1.37.1)

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

(syntax)


5-7: Metadata configuration aligns with chart conventions
The name and labels fields correctly leverage the n8n.fullname and n8n.labels helpers for consistency.


9-12: Correct scaleTargetRef targeting the worker Deployment
This block accurately references the worker Deployment in apps/v1 and matches the naming used elsewhere in the chart.


13-14: Verify default values for replica counts
Ensure that .Values.worker.autoscaling.minReplicas and .Values.worker.autoscaling.maxReplicas have sensible defaults in values.yaml to prevent template rendering errors when omitted.

Comment on lines +15 to +31
metrics:
{{- if .Values.webhook.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.webhook.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.webhook.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.webhook.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Guard the metrics section to avoid emitting an empty list
If neither CPU nor memory targets are set, the template will create an empty metrics: field, which is invalid. Wrap the entire block in a conditional that checks for at least one metric. For example:

-  metrics:
-    {{- if .Values.webhook.autoscaling.targetCPUUtilizationPercentage }}
-    - type: Resource
-      resource:
-        name: cpu
-        target:
-          type: Utilization
-          averageUtilization: {{ .Values.webhook.autoscaling.targetCPUUtilizationPercentage }}
-    {{- end }}
-    {{- if .Values.webhook.autoscaling.targetMemoryUtilizationPercentage }}
-    - type: Resource
-      resource:
-        name: memory
-        target:
-          type: Utilization
-          averageUtilization: {{ .Values.webhook.autoscaling.targetMemoryUtilizationPercentage }}
-    {{- end }}
+  {{- if or .Values.webhook.autoscaling.targetCPUUtilizationPercentage .Values.webhook.autoscaling.targetMemoryUtilizationPercentage }}
+  metrics:
+    {{- if .Values.webhook.autoscaling.targetCPUUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: cpu
+        target:
+          type: Utilization
+          averageUtilization: {{ .Values.webhook.autoscaling.targetCPUUtilizationPercentage }}
+    {{- end }}
+    {{- if .Values.webhook.autoscaling.targetMemoryUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: memory
+        target:
+          type: Utilization
+          averageUtilization: {{ .Values.webhook.autoscaling.targetMemoryUtilizationPercentage }}
+    {{- end }}
+  {{- end }}
🤖 Prompt for AI Agents
In charts/n8n/templates/hpa.webhook.yaml around lines 15 to 31, the metrics
section can emit an empty list if neither CPU nor memory utilization targets are
set, which is invalid. To fix this, wrap the entire metrics block in a
conditional that checks if at least one of the targetCPUUtilizationPercentage or
targetMemoryUtilizationPercentage values is defined, so the metrics field is
only included when there is at least one metric specified.

Comment on lines +15 to +31
metrics:
{{- if .Values.worker.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.worker.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.worker.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.worker.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Guard the metrics section to avoid emitting an empty list
If neither CPU nor memory targets are set, the template will create an empty metrics: field, which is invalid. Wrap the entire block in a conditional that checks for at least one metric. For example:

-  metrics:
-    {{- if .Values.worker.autoscaling.targetCPUUtilizationPercentage }}
-    - type: Resource
-      resource:
-        name: cpu
-        target:
-          type: Utilization
-          averageUtilization: {{ .Values.worker.autoscaling.targetCPUUtilizationPercentage }}
-    {{- end }}
-    {{- if .Values.worker.autoscaling.targetMemoryUtilizationPercentage }}
-    - type: Resource
-      resource:
-        name: memory
-        target:
-          type: Utilization
-          averageUtilization: {{ .Values.worker.autoscaling.targetMemoryUtilizationPercentage }}
-    {{- end }}
+  {{- if or .Values.worker.autoscaling.targetCPUUtilizationPercentage .Values.worker.autoscaling.targetMemoryUtilizationPercentage }}
+  metrics:
+    {{- if .Values.worker.autoscaling.targetCPUUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: cpu
+        target:
+          type: Utilization
+          averageUtilization: {{ .Values.worker.autoscaling.targetCPUUtilizationPercentage }}
+    {{- end }}
+    {{- if .Values.worker.autoscaling.targetMemoryUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: memory
+        target:
+          type: Utilization
+          averageUtilization: {{ .Values.worker.autoscaling.targetMemoryUtilizationPercentage }}
+    {{- end }}
+  {{- end }}
🤖 Prompt for AI Agents
In charts/n8n/templates/hpa.worker.yaml around lines 15 to 31, the metrics
section may emit an empty list if neither CPU nor memory targets are set, which
is invalid. Wrap the entire metrics block in a conditional that checks if either
.Values.worker.autoscaling.targetCPUUtilizationPercentage or
.Values.worker.autoscaling.targetMemoryUtilizationPercentage is set, so the
metrics field is only included when there is at least one metric defined.

@simonefrancia
Copy link
Author

@Vad1mo could you merge this please?
I have tested personally and it works

@SamyDjemai
Copy link
Contributor

Hi @simonefrancia, you also need to bump the chart version and write out your changes in Chart.yaml as stated in the contribution guide before your PR can be merged

@simonefrancia
Copy link
Author

simonefrancia commented Jun 11, 2025

@SamyDjemai @Vad1mo I should have done, thank you

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)
charts/n8n/Chart.yaml (1)

37-38: Remove trailing whitespace and refine annotation. YAMLlint flags a trailing space on line 37. Also consider capitalizing and adding “for” in the description for consistency. Suggested diff:

-    - kind: added 
-      description: "add support autoscaling workers and webhooks"
+    - kind: added
+      description: "Add support for autoscaling workers and webhooks"
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 37-37: trailing spaces

(trailing-spaces)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4500e1e and 553d930.

📒 Files selected for processing (1)
  • charts/n8n/Chart.yaml (2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
charts/n8n/Chart.yaml

[error] 37-37: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
charts/n8n/Chart.yaml (1)

3-3: Verify the semantic version bump. The chart version was incremented from 1.0.7 to 1.0.8, but since this PR introduces a new feature (HPA support for workers and webhooks), a minor version bump (e.g., 1.1.0) may be more semantically appropriate. Please confirm the intended versioning strategy.

@SamyDjemai
Copy link
Contributor

Hi @simonefrancia, new chart versions have been released, you're going to need to bump the chart version in this PR.
By the way @Vad1mo I think that this chart version bumping workflow is quite painful for contributors in cases like this, any chance of automating this? I can look into a PR for this

@Vad1mo
Copy link
Member

Vad1mo commented Jun 25, 2025

I think that this chart version bumping workflow is quite painful for contributors in cases like this, any chance of automating this? I can look into a PR for this

happy to accept proposals on how this can be automated, and following that PRs too.

@simonefrancia
Copy link
Author

@SamyDjemai @Vad1mo I think it's possible to do a kind of bumping inside a pipeline / github action automatically.
I can bump the version my self, but if some other pr will be merge, the problem still remains.

@tkhaiops
Copy link

tkhaiops commented Jul 1, 2025

Hi @simonefrancia, thanks for pushing this additions to n8n Helm chart. I run into the same problem when deploying n8n in my organization. I unfortunately had to push the HPAs for the webhook and works separately.

Can you please follow up on resolving the conflics and finalizing this merge so the community can benefit from these changes?

@simonefrancia
Copy link
Author

@SamyDjemai @Vad1mo @tkhaiops
i think we can merge

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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 553d930 and 29ecbf9.

📒 Files selected for processing (1)
  • charts/n8n/Chart.yaml (2 hunks)
🪛 YAMLlint (1.37.1)
charts/n8n/Chart.yaml

[error] 37-37: trailing spaces

(trailing-spaces)

🧰 Additional context used
🪛 YAMLlint (1.37.1)
charts/n8n/Chart.yaml

[error] 37-37: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
charts/n8n/Chart.yaml (1)

3-4: Confirm semantic-versioning alignment — feature addition usually warrants a minor bump

The added HPA templates introduce new functionality, i.e. a feature rather than a bug-fix.
According to Helm/semver conventions the chart version should increment the minor digit (e.g. 1.1.0) instead of the patch digit.

Please double-check the project’s versioning policy and adjust if required; otherwise consumers depending on version semantics may miss the new capability.

Comment on lines +37 to +38
- kind: added
description: "add support autoscaling workers and webhooks"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Lint failure: trailing spaces + wording tweak in change-log annotation

YAML-lint flags trailing whitespace at line 37, which can break CI pipelines that enforce linting.
While touching the line, consider a small wording polish.

-    - kind: added␠
-      description: "add support autoscaling workers and webhooks"
+    - kind: added
+      description: "Add autoscaling support for workers and webhooks"
📝 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
- kind: added
description: "add support autoscaling workers and webhooks"
- kind: added
description: "Add autoscaling support for workers and webhooks"
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 37-37: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In charts/n8n/Chart.yaml at lines 37 to 38, remove the trailing whitespace after
"kind: added" to fix the YAML lint error. Also, improve the description wording
for clarity and correctness, for example, change it to "Add support for
autoscaling workers and webhooks" with proper capitalization and grammar.

@simonefrancia
Copy link
Author

@Vad1mo please

@nemcikjan
Copy link

Do you plan to merge this?

@tahasonmez
Copy link

we are awaiting for merging too..

@dtr-rgolubowicz
Copy link

Hey @simonefrancia, @Vad1mo any plans for merging that?

@Vad1mo
Copy link
Member

Vad1mo commented Aug 22, 2025

We need more eyes and feedback from the community

Also the readme is missing

@JHTosas
Copy link

JHTosas commented Aug 22, 2025

For feedback, we've been using this as part of our umbrella chart to successfully add HPA to our workers/webhook nodes.

@ghost
Copy link

ghost commented Aug 25, 2025

I can also contribute to the feedback - that changes allowed us to add HPA to workers, webhooks and the main pods as well. Scales as expected under increased load. Merging of that PR will be very useful from our perspective.

@dtr-rgolubowicz
Copy link

@simonefrancia pls resolve conflicts and update the readme with HPA; and we can merge it then

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: 1

♻️ Duplicate comments (1)
charts/n8n/Chart.yaml (1)

37-38: Fix YAML lint error and polish changelog wording

There’s trailing whitespace after “added” and the description grammar/capitalization can be improved. This also resolves the YAMLlint failure.

Apply:

-    - kind: added 
-      description: "add support autoscaling workers and webhooks"
+    - kind: added
+      description: "Add autoscaling support for workers and webhooks"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 29ecbf9 and 37f0aef.

📒 Files selected for processing (1)
  • charts/n8n/Chart.yaml (2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
charts/n8n/Chart.yaml

[error] 37-37: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
charts/n8n/Chart.yaml (1)

4-4: Chart version and image tag are aligned

  • Chart.yaml’s appVersion is set to 1.108.0.
  • In values.yaml, image.tag defaults to an empty string and the templates use
    {{ .Values.image.tag | default .Chart.AppVersion }}, which resolves to 1.108.0.
  • There is no chart-level README.md or example files under charts/n8n—no local docs to update.

Everything is in sync.

@@ -1,7 +1,7 @@
apiVersion: v2
name: n8n
version: 1.0.12
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Bump chart version per contribution guide before merge

A feature addition warrants a chart version bump. Please increment version accordingly (respecting whatever scheme the repo follows) and update any release notes.

Example (patch bump shown; adjust as needed to avoid conflicts):

-version: 1.0.12
+version: 1.0.13

Optionally verify current version across the repo:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n '^version:\s*\d+\.\d+\.\d+$' charts/n8n/Chart.yaml

Length of output: 96


Bump n8n Helm chart version to 1.0.13

A new feature addition requires incrementing the chart version before merging.

• Affected file:

  • charts/n8n/Chart.yaml (line 3)
    • Apply this diff:
-version: 1.0.12
+version: 1.0.13

You can re-verify with:

rg -n '^version:\s*\d+\.\d+\.\d+$' charts/n8n/Chart.yaml
🤖 Prompt for AI Agents
In charts/n8n/Chart.yaml around line 3 the chart version is still 1.0.12 and
needs to be bumped to 1.0.13; update the version field on line 3 to "1.0.13" and
save the file, then verify the change by ensuring the version line matches the
regex ^version:\s*\d+\.\d+\.\d+$ (e.g., with rg).

@simonefrancia
Copy link
Author

@dtr-rgolubowicz resolved conflicts. README has alreay references about autoscaling on worker and webhooks.

@dtr-rgolubowicz
Copy link

@Vad1mo can we merge it?

fank added a commit to fank/n8n-helm-chart that referenced this pull request Sep 3, 2025
This PR introduces StatefulSet support for n8n deployments, enabling better handling
of persistent storage when running multiple replicas.

## Key Changes

- Add new StatefulSet template with volumeClaimTemplates for individual PVCs per replica
- Add headless Service for StatefulSet DNS management and pod identity
- Add useStatefulSet flag to toggle between Deployment and StatefulSet modes
- Update PVC template to skip creation when using StatefulSet (handled by volumeClaimTemplates)
- Add validation to prevent incompatible persistence configurations (existingClaim with StatefulSet)
- Include example configuration file for StatefulSet deployments
- Add comprehensive documentation explaining when and how to use StatefulSets

## Implementation Details

- StatefulSet creates individual PVCs for each replica, preventing data corruption from shared volumes
- Headless service provides stable network identity for StatefulSet pods
- Regular service (-svc suffix) provides load balancing for external access
- Validation helper ensures users don't misconfigure persistence settings
- All templates include namespace field for proper scoping

## Use Cases

StatefulSets are recommended when:
- Running multiple n8n replicas that need individual persistent storage
- Each instance needs to maintain its own workflow data
- Implementing high availability with proper data isolation

For proper multi-replica operation, users should:
- Enable Redis/Valkey for session state management
- Use external database instead of SQLite
- Configure shared encryption key across all replicas

Fixes 8gears#186
@simonefrancia
Copy link
Author

@Vad1mo @dtr-rgolubowicz @SamyDjemai
Sorry for bothering you, but if we don't merge just after we resolve conflicts, conflicts will be always there.

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: 1

♻️ Duplicate comments (1)
charts/n8n/Chart.yaml (1)

37-38: Fix YAML lint failure: trailing space + improve wording, add final newline

Remove the trailing space after added, polish the description, and ensure the file ends with a newline.

-    - kind: added 
-      description: "add support autoscaling workers and webhooks"
+    - kind: added
+      description: "Add autoscaling support for workers and webhooks"
+ 
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f6bedbe and 504a379.

📒 Files selected for processing (1)
  • charts/n8n/Chart.yaml (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-02T08:05:39.372Z
Learnt from: tsch157
PR: 8gears/n8n-helm-chart#239
File: charts/n8n/Chart.yaml:3-4
Timestamp: 2025-09-02T08:05:39.372Z
Learning: n8n 1.110.0 is a pre-release version and should not be used in production deployments. Always verify if a version is stable before recommending upgrades in the n8n Helm chart.

Applied to files:

  • charts/n8n/Chart.yaml
🪛 YAMLlint (1.37.1)
charts/n8n/Chart.yaml

[error] 37-37: trailing spaces

(trailing-spaces)


[error] 38-38: no new line character at the end of file

(new-line-at-end-of-file)

Comment on lines 3 to 4
version: 1.0.15
appVersion: 1.110.1
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Version bump OK; verify appVersion stability and prerelease flag

Nice bump. Please confirm 1.110.1 is GA (1.110.0 was a pre-release per prior learning). If 1.110.1 is pre-release, set artifacthub.io/prerelease: "true" or pick a stable appVersion. Also verify templates don’t consume .Chart.AppVersion for image tags unless intended.

Run to check template usage:

Check release status on the web:


🏁 Script executed:

#!/bin/bash
rg -nP -C3 '\.Chart\.AppVersion\b|image:\s|tag:\s' --type=yaml charts/

Length of output: 3390


🌐 Web query:

Is n8n v1.110.1 a stable (GA) release? Provide the official release notes/source.

💡 Result:

No — there is no official GA/stable release listed for n8n v1.110.1. The n8n release notes show 1.109.1 as the current "latest" (stable) and 1.110.0 as the "next" (pre-release/beta). [1] The n8n GitHub Releases page also lists 1.110.0 as a pre-release and does not show a 1.110.1 stable tag. [2]

Sources:

  • n8n Release Notes (shows latest 1.109.1 and next 1.110.0). [1]
  • n8n GitHub Releases page (no 1.110.1; 1.110.0 marked pre-release). [2]

Action required: Chart appVersion set to non‑GA n8n v1.110.1 — change or mark prerelease

  • Verified: n8n v1.110.1 is not listed as a GA release (1.110.0 is pre-release; latest stable is 1.109.1).
  • Problem: templates fall back to .Chart.AppVersion when .Values.image.tag is empty, so deployments will try image n8nio/n8n:1.110.1.
  • Action (choose one):
    • Set Chart.yaml appVersion to a known stable release (e.g., 1.109.1), OR
    • Add chart annotation artifacthub.io/prerelease: "true", AND/OR
    • Require/Document an explicit .Values.image.tag (don’t rely on Chart.AppVersion fallback).
  • Precise locations:
    • charts/n8n/Chart.yaml (lines 3-4)
    • charts/n8n/values.yaml (tag: "" at line ~19; commented default usage at ~230)
    • charts/n8n/templates/deployment.yaml:65, deployment.worker.yaml:60, deployment.webhook.yaml:60

@kutysam
Copy link
Contributor

kutysam commented Sep 16, 2025

We should merge this in. There are values file and its misleading as there is no hpa lol.

Copy link
Contributor

@kutysam kutysam left a comment

Choose a reason for hiding this comment

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

lgtm!

@obsidian33
Copy link

Is there anything holding this back from merging?

@Vad1mo
Copy link
Member

Vad1mo commented Oct 7, 2025

There are three notes from the AI review bot: guard around metrics and some minor linter issues.

Also the Linter fails

@Chrislevi
Copy link

Any news with this? we are really looking forward into using this change, it's pretty confusing to have the autoscaling values exist but no actual templates for these values.

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.

Comments