Skip to content

Commit e0d5e59

Browse files
committed
Do not supply CMD or ARGS for v2 runners.
Signed-off-by: Josh Baird <jbaird@galileo.io>
1 parent 78e33b5 commit e0d5e59

4 files changed

Lines changed: 23 additions & 11 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,11 +836,15 @@ worker:
836836
image:
837837
repository: n8nio/runners
838838
tag: "2.0.0"
839+
# IMPORTANT: Do NOT set command or commandArgs when using n8nio/runners
840+
# The runners image has its own launcher and doesn't use "n8n worker" commands
839841
```
840842

841843
**Key points:**
842844
- The main n8n application continues to use `n8nio/n8n`
843845
- Workers/task runners must use `n8nio/runners` for n8n v2.0+
846+
- **Do not set `worker.command` or `worker.commandArgs`** when using the runners image - it has its own entrypoint/launcher
847+
- The chart automatically omits command/args when a custom worker image is specified
844848
- If `worker.image.*` is not specified, it defaults to the global `image.*` configuration (backwards compatible)
845849
- You can specify different tags for main and worker if needed
846850

charts/n8n/templates/deployment.worker.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,21 @@ spec:
8282
{{- toYaml $value | nindent 14 }}
8383
{{- end }}
8484
{{- if .Values.worker.command }}
85+
{{- /* User has specified a custom command, use it */ -}}
8586
command:
8687
{{- toYaml .Values.worker.command | nindent 12 }}
88+
{{- else if .Values.worker.image.repository }}
89+
{{- /* Worker is using a custom image (likely n8nio/runners for v2) - don't set command, let image entrypoint run */ -}}
8790
{{- else }}
91+
{{- /* Default to n8n v1 worker command */ -}}
8892
command: ["n8n"]
8993
{{- end }}
9094
{{- if .Values.worker.commandArgs }}
95+
{{- /* User has specified custom args, use them */ -}}
9196
args:
9297
{{- toYaml .Values.worker.commandArgs | nindent 12 }}
93-
{{- else }}
98+
{{- else if not .Values.worker.image.repository }}
99+
{{- /* Only set default args if using the main n8n image (v1 behavior) */ -}}
94100
args:
95101
- "worker"
96102
- "--concurrency={{ .Values.worker.concurrency }}"

charts/n8n/values.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ worker:
283283
# For n8n v2.0+, you should use the separate task runner image: n8nio/runners
284284
# For n8n v1.x, leave these empty to use the main n8n image.
285285
# See: https://docs.n8n.io/2-0-breaking-changes/#remove-task-runner-from-n8nion8n-docker-image
286+
#
287+
# IMPORTANT: When using n8nio/runners image, do NOT set command/commandArgs below.
288+
# The runners image has its own launcher and doesn't use the "n8n worker" command.
289+
# The chart will automatically omit command/args when a custom image is specified.
286290
image:
287291
# For n8n v2+, set to n8nio/runners
288292
# If empty, defaults to .Values.image.repository (n8nio/n8n)
@@ -395,19 +399,15 @@ worker:
395399
# command: ["/bin/sh", "-c", "apk add mysql-client"]
396400

397401
# here you can override a command for worker container
398-
# it may be used to override a starting script (e.g., to resolve issues like https://github.com/n8n-io/n8n/issues/6412) or
399-
# run additional preparation steps (e.g., installing additional software)
402+
# IMPORTANT: When using n8nio/runners (n8n v2), do NOT set this. The runners image
403+
# has its own launcher. Only set this for custom configurations.
404+
# For n8n v1 workers, the default is ["n8n"] which is set automatically.
400405
command: []
401406

402-
# sample configuration that overrides starting script and solves above issue (also it runs n8n as root, so be careful):
403-
# command:
404-
# - tini
405-
# - --
406-
# - /bin/sh
407-
# - -c
408-
# - chmod o+rx /root; chown -R node /root/.n8n || true; chown -R node /root/.n8n; ln -s /root/.n8n /home/node; chown -R node /home/node || true; node /usr/local/bin/n8n
409-
410407
# command args
408+
# IMPORTANT: When using n8nio/runners (n8n v2), do NOT set this. The runners image
409+
# manages its own process. Only set this for custom configurations.
410+
# For n8n v1 workers, the default is ["worker", "--concurrency=X"] which is set automatically.
411411
commandArgs: []
412412

413413
# here you can override the livenessProbe for the main container

examples/values_full.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ worker:
7373
# image:
7474
# repository: n8nio/runners
7575
# tag: 2.0.0
76+
# IMPORTANT: Do NOT set command or commandArgs when using n8nio/runners
77+
# The runners image has its own launcher and doesn't accept "n8n worker" commands
7678
# See: https://docs.n8n.io/2-0-breaking-changes/#remove-task-runner-from-n8nion8n-docker-image
7779
extraEnv: *extraEnv # using YAML magic (anchors) to reference main extraEnv
7880
extraVolumeMounts: *extraVolumeMounts # using YAML magic (anchors) to reference main extraVolumeMounts

0 commit comments

Comments
 (0)