40 Commits

Author SHA1 Message Date
47e32cbc2e ci: use helm plugin
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-14 23:58:29 +03:00
ddb4a2eb9b Bump n8n version up to 0.215.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-02-13 00:55:51 +03:00
b0162f4908 Bump n8n version up to 0.213.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-02-13 00:43:52 +03:00
ef8f635aba Bump n8n version up to 0.213.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-01-31 18:53:34 +03:00
3497a9537e Bump n8n version up to 0.205.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-12-10 18:46:53 +03:00
4e01f912ed fix worker-hpa labels
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 17:38:06 +03:00
bf6002c156 fix webhook-deployment labels 2022-11-16 17:37:56 +03:00
ad9a7b248f Remove redundant suffix
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 17:30:55 +03:00
b143ede98b Fix collisions with labels and selectors
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 17:28:54 +03:00
7155146e00 Fix service name for webhook ingress
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 16:42:09 +03:00
3639069556 Revert "Remove $fullName var from ingress templates"
This reverts commit 92f8d4442c.
2022-11-16 16:41:43 +03:00
92f8d4442c Remove $fullName var from ingress templates
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 16:37:50 +03:00
5500ec6642 Fix: checksum must be on pod template
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 16:32:16 +03:00
fba44456e6 Include default secrets if extraEnvVarsSecret not present
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 16:28:54 +03:00
8bdea5fba6 Add N8N_PROTOCOL
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 16:10:41 +03:00
cdbceb1396 add startupProbe to main process
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 14:39:18 +03:00
e7598dc380 add checksum/secret annotation 2022-11-16 14:37:07 +03:00
c2c9255462 add checksum/config annotation
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 14:33:18 +03:00
9ca2cac8b1 add N8N_HOST and N8N_PORT to config
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 14:23:47 +03:00
744613584d fix N8N_DIAGNOSTICS_ENABLED var
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 14:17:58 +03:00
36532aef3b fix redis host
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 13:33:54 +03:00
a140216365 Remove *.tgz from .helmignore
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 13:26:41 +03:00
623fefe1d3 Add redis architecture and auth
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 12:38:07 +03:00
00f087b635 Remove redis alias
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 12:29:35 +03:00
5306094c0c bump redis dependency up to 17.3.11
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-16 12:17:25 +03:00
00d1b8dcf0 unwrap booleans
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-15 22:56:27 +03:00
0fa2dac744 add redis.enabled to values.yaml
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-15 22:51:53 +03:00
3f46388a06 add command for webhook and worker
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-15 22:46:38 +03:00
3c787efb0a Remove unnecessary node_env 2022-11-15 22:45:02 +03:00
61f92c0075 Add N8N_LOG_LEVEL and config.debug value
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-15 22:22:59 +03:00
a667ff2f96 Drone: helm repo add bitnami
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-15 22:19:37 +03:00
862cb62d2f helm update dependency
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing
2022-11-15 22:12:07 +03:00
2d2f9b48fd Remove v prefix from appVersion
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-15 22:04:03 +03:00
42cb58acc5 Fix configMapRef is a map
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-15 21:57:31 +03:00
60ed1e8fc5 Remove duplication of envFrom
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-15 21:55:01 +03:00
1129489739 fix configMap kind
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-15 21:53:19 +03:00
e673d59fdc Add redis dependency
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-15 21:50:32 +03:00
921e7948bc add EXECUTIONS_MODE 2022-11-15 21:49:36 +03:00
285fe88796 add maintainers
All checks were successful
continuous-integration/drone/push Build is passing
2022-11-15 21:33:46 +03:00
0d0d8836bf cs fix
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-11-15 21:25:37 +03:00
15 changed files with 150 additions and 74 deletions

View File

@ -6,45 +6,18 @@ name: default
trigger:
event:
- push
- tag
steps:
- name: lint
image: cr.grachevko.ru/docker.io/alpine/helm:latest
pull: always
commands:
- helm lint .
- name: version
image: cr.grachevko.ru/docker.io/mikefarah/yq:latest
pull: always
user: root
commands:
- yq -i '.version = "'$DRONE_TAG'"' Chart.yaml
- cat Chart.yaml
depends_on:
- lint
when:
event:
- tag
- name: release
image: cr.grachevko.ru/docker.io/alpine/helm:latest
pull: always
commands:
- helm dependency build
- helm plugin install https://github.com/chartmuseum/helm-push
- helm repo add $HELM_REPO_NAME $HELM_REPO_REGISTRY/$HELM_REPO_NAME --username $HELM_REPO_USERNAME --password $HELM_REPO_PASSWORD
- helm cm-push . $HELM_REPO_REGISTRY/$HELM_REPO_NAME
environment:
HELM_REPO_NAME: n8n
HELM_REPO_REGISTRY: https://harbor.grachevko.ru/chartrepo
HELM_REPO_USERNAME:
image: cr.grachevko.ru/drone/helm:0.1.4
settings:
name: n8n
registry: https://harbor.grachevko.ru/chartrepo
username:
from_secret: HELM_REPO_USERNAME
HELM_REPO_PASSWORD:
password:
from_secret: HELM_REPO_PASSWORD
depends_on:
- version
when:
event:
- tag
branch:
- master
- rc

View File

@ -21,4 +21,3 @@
.idea/
*.tmproj
.vscode/
*.tgz

6
Chart.lock Normal file
View File

@ -0,0 +1,6 @@
dependencies:
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 17.3.11
digest: sha256:40f0dad12458b527f362dd152bbeb042a415b0bb48376357901d2062489b0650
generated: "2022-11-16T12:29:15.310122534+03:00"

View File

@ -3,5 +3,15 @@ name: n8n
description: A Helm chart for Kubernetes
type: application
version: 0.0.1
appVersion: v0.202.1
appVersion: 0.215.1
icon: https://github.com/n8n-io/n8n/raw/master/assets/n8n-logo.png
maintainers:
- email: me@grachevko.ru
name: Konstantin Grachev
sources:
- https://git.grachevko.ru/n8n/chart
dependencies:
- name: redis
version: ^17
repository: https://charts.bitnami.com/bitnami
condition: redis.enabled

1
TODO.md Normal file
View File

@ -0,0 +1 @@
- [ ] external redis config

View File

@ -5,6 +5,14 @@ Expand the name of the chart.
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- define "n8n-webhook.name" -}}
{{ include "n8n.name" . }}-webhook
{{- end }}
{{- define "n8n-worker.name" -}}
{{ include "n8n.name" . }}-worker
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
@ -23,6 +31,14 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}
{{- define "n8n-webhook.fullname" -}}
{{ include "n8n.fullname" . }}-webhook
{{- end }}
{{- define "n8n-worker.fullname" -}}
{{ include "n8n.fullname" . }}-worker
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
@ -33,15 +49,32 @@ Create chart name and version as used by the chart label.
{{/*
Common labels
*/}}
{{- define "n8n.labels" -}}
{{- define "common.labels" -}}
helm.sh/chart: {{ include "n8n.chart" . }}
{{ include "n8n.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
n8n labels
*/}}
{{- define "n8n.labels" -}}
{{ include "common.labels" . }}
{{ include "n8n.selectorLabels" . }}
{{- end }}
{{- define "n8n-webhook.labels" -}}
{{ include "common.labels" . }}
{{ include "n8n-webhook.selectorLabels" . }}
{{- end }}
{{- define "n8n-worker.labels" -}}
{{ include "common.labels" . }}
{{ include "n8n-worker.selectorLabels" . }}
{{- end }}
{{/*
Selector labels
*/}}
@ -49,3 +82,13 @@ Selector labels
app.kubernetes.io/name: {{ include "n8n.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- define "n8n-webhook.selectorLabels" -}}
app.kubernetes.io/name: {{ include "n8n-webhook.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- define "n8n-worker.selectorLabels" -}}
app.kubernetes.io/name: {{ include "n8n-worker.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

View File

@ -1,19 +1,25 @@
{{- if not .Values.existingSecret }}
apiVersion: v1
kind: Secret
kind: ConfigMap
metadata:
name: {{ include "n8n.fullname" . }}
labels:
{{- include "n8n.labels" . | nindent 4 }}
type: Opaque
data:
NODE_ENV: {{ .Values.config.node_env | quote }}
N8N_HOST: {{ .Values.config.host | quote }}
N8N_PORT: {{ .Values.config.port | quote }}
N8N_PROTOCOL: {{ .Values.config.protocol | quote }}
WEBHOOK_URL: {{ .Values.config.webhook_url | quote }}
EXECUTIONS_MODE: "queue"
EXECUTIONS_PROCESS: {{ .Values.config.executions.process | quote }}
GENERIC_TIMEZONE: {{ .Values.config.timezone | quote }}
EXECUTIONS_DATA_PRUNE: {{ .Values.config.executions.data.prune | quote }}
EXECUTIONS_DATA_MAX_AGE: {{ .Values.config.executions.data.max_age | quote }}
N8N_DIAGNOSTICS_ENABLED: {{ .Values.config.executions.data.max_age | quote }}
N8N_DIAGNOSTICS_ENABLED: {{ .Values.config.diagnostics.enabled | quote }}
NODE_FUNCTION_ALLOW_BUILTIN: {{ .Values.config.node.function.allow.builtin | quote }}
NODE_FUNCTION_ALLOW_EXTERNAL: {{ .Values.config.node.function.allow.external | quote }}
QUEUE_BULL_REDIS_HOST: {{ include "n8n.fullname" . }}-redis-master
{{- if .Values.config.debug }}
N8N_LOG_LEVEL: debug
{{- end }}
{{- end }}

View File

@ -4,6 +4,9 @@ metadata:
name: {{ include "n8n.fullname" . }}
labels:
{{- include "n8n.labels" . | nindent 4 }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
spec:
replicas: 1
selector:
@ -11,8 +14,10 @@ spec:
{{- include "n8n.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.n8n.podAnnotations }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- with .Values.n8n.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
@ -32,11 +37,13 @@ spec:
imagePullPolicy: {{ .Values.n8n.image.pullPolicy }}
envFrom:
- configMapRef:
- name: {{ include "n8n.fullname" . }}
envFrom:
name: {{ include "n8n.fullname" . }}
{{- if .Values.n8n.extraEnvVarsSecret }}
- secretRef:
name: {{ .Values.n8n.extraEnvVarsSecret }}
{{- else }}
- secretRef:
name: {{ include "n8n.fullname" . }}
{{- end }}
ports:
- name: http
@ -50,6 +57,12 @@ spec:
httpGet:
path: /healthz
port: http
startupProbe:
httpGet:
path: /healthz
port: http
failureThreshold: 30
periodSeconds: 10
resources:
{{- toYaml .Values.n8n.resources | nindent 12 }}
{{- with .Values.n8n.nodeSelector }}

View File

@ -12,7 +12,6 @@ data:
{{- else }}
N8N_ENCRYPTION_KEY: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }}
{{- if .Values.config.db_type }}
DB_TYPE: {{ .Values.config.db_type | b64enc | quote }}
{{- end }}

View File

@ -1,24 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "n8n.fullname" . }}-webhook
name: {{ include "n8n-webhook.fullname" . }}
labels:
{{- include "n8n.labels" . | nindent 4 }}
{{- include "n8n-webhook.labels" . | nindent 4 }}
spec:
{{- if not .Values.webhook.autoscaling.enabled }}
replicas: {{ .Values.webhook.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "n8n.selectorLabels" . | nindent 6 }}
{{- include "n8n-webhook.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.webhook.podAnnotations }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- with .Values.webhook.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "n8n.selectorLabels" . | nindent 8 }}
{{- include "n8n-webhook.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.webhook.image.pullSecrets }}
imagePullSecrets:
@ -32,13 +34,18 @@ spec:
{{- toYaml .Values.webhook.securityContext | nindent 12 }}
image: "{{ .Values.webhook.image.registry }}/{{ .Values.webhook.image.repository }}:{{ .Values.webhook.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.webhook.image.pullPolicy }}
command:
- n8n
- webhook
envFrom:
- configMapRef:
- name: {{ include "n8n.fullname" . }}
envFrom:
name: {{ include "n8n.fullname" . }}
{{- if .Values.webhook.extraEnvVarsSecret }}
- secretRef:
name: {{ .Values.webhook.extraEnvVarsSecret }}
{{- else }}
- secretRef:
name: {{ include "n8n.fullname" . }}
{{- end }}
ports:
- name: http

View File

@ -1,5 +1,5 @@
{{- if .Values.webhook.ingress.enabled -}}
{{- $fullName := include "n8n.fullname" . -}}
{{- $fullName := include "n8n-webhook.fullname" . -}}
{{- $svcPort := .Values.webhook.service.port -}}
{{- if and .Values.webhook.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.webhook.ingress.annotations "kubernetes.io/ingress.class") }}
@ -15,9 +15,9 @@ apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}-webhook
name: {{ $fullName }}
labels:
{{- include "n8n.labels" . | nindent 4 }}
{{- include "n8n-webhook.labels" . | nindent 4 }}
{{- with .Values.webhook.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}

View File

@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "n8n.fullname" . }}-webhook
name: {{ include "n8n-webhook.fullname" . }}
labels:
{{- include "n8n.labels" . | nindent 4 }}
{{- include "n8n-webhook.labels" . | nindent 4 }}
spec:
type: {{ .Values.webhook.service.type }}
ports:
@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "n8n.selectorLabels" . | nindent 4 }}
{{- include "n8n-webhook.selectorLabels" . | nindent 4 }}

View File

@ -1,24 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "n8n.fullname" . }}-worker
name: {{ include "n8n-worker.fullname" . }}
labels:
{{- include "n8n.labels" . | nindent 4 }}
{{- include "n8n-worker.labels" . | nindent 4 }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
spec:
{{- if not .Values.worker.autoscaling.enabled }}
replicas: {{ .Values.worker.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "n8n.selectorLabels" . | nindent 6 }}
{{- include "n8n-worker.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.worker.podAnnotations }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- with .Values.worker.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "n8n.selectorLabels" . | nindent 8 }}
{{- include "n8n-worker.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.worker.image.pullSecrets }}
imagePullSecrets:
@ -32,13 +37,18 @@ spec:
{{- toYaml .Values.worker.securityContext | nindent 12 }}
image: "{{ .Values.worker.image.registry }}/{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.worker.image.pullPolicy }}
command:
- n8n
- worker
envFrom:
- configMapRef:
- name: {{ include "n8n.fullname" . }}
envFrom:
name: {{ include "n8n.fullname" . }}
{{- if .Values.worker.extraEnvVarsSecret }}
- secretRef:
name: {{ .Values.worker.extraEnvVarsSecret }}
{{- else }}
- secretRef:
name: {{ include "n8n.fullname" . }}
{{- end }}
resources:
{{- toYaml .Values.worker.resources | nindent 12 }}

View File

@ -2,14 +2,14 @@
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "n8n.fullname" . }}-worker
name: {{ include "n8n-worker.fullname" . }}
labels:
{{- include "n8n.labels" . | nindent 4 }}
{{- include "n8n-worker.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "n8n.fullname" . }}
name: {{ include "n8n-worker.fullname" . }}
minReplicas: {{ .Values.worker.autoscaling.minReplicas }}
maxReplicas: {{ .Values.worker.autoscaling.maxReplicas }}
metrics:

View File

@ -1,4 +1,8 @@
config:
host: ""
port: "5678"
protocol: http
debug: false
db_type: postgresdb
postgres:
database: n8n
@ -10,20 +14,25 @@ config:
encryption_key: ""
timezone: Europe/Moscow
webhook_url: ""
node_env: production
executions:
process: main
data:
prune: 'true'
prune: true
max_age: 8760
diagnostics:
enabled: 'false'
enabled: false
node:
function:
allow:
builtin: '*'
external: '*'
redis:
enabled: false
architecture: standalone
auth:
enabled: false
existingSecret: ""
nameOverride: ""