Files
homelab/k8s/apps/n8n/deployment-main.yaml

118 lines
2.9 KiB
YAML
Raw Normal View History

2026-02-05 17:39:42 +02:00
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: n8n-main
labels:
app: n8n
component: main
spec:
replicas: 1
selector:
matchLabels:
app: n8n
component: main
template:
metadata:
labels:
app: n8n
component: main
spec:
2026-02-05 19:06:55 +02:00
serviceAccountName: n8n
2026-02-05 17:39:42 +02:00
containers:
- name: n8n
image: docker.n8n.io/n8nio/n8n:latest
ports:
- containerPort: 5678
name: http
env:
2026-02-05 17:55:41 +02:00
- name: HOME
value: "/home/node"
2026-02-05 17:39:42 +02:00
- name: N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS
value: "true"
2026-02-05 18:43:04 +02:00
- name: NODES_EXCLUDE
value: "[]"
2026-02-05 17:39:42 +02:00
- name: N8N_HOST
value: "n8n.hexor.cy"
- name: N8N_PORT
value: "5678"
- name: N8N_PROTOCOL
value: "https"
- name: N8N_RUNNERS_ENABLED
value: "true"
- name: N8N_RUNNERS_MODE
value: "external"
- name: EXECUTIONS_MODE
value: "queue"
- name: QUEUE_BULL_REDIS_HOST
value: "n8n-redis"
- name: NODE_ENV
value: "production"
- name: WEBHOOK_URL
value: "https://n8n.hexor.cy/"
- name: GENERIC_TIMEZONE
value: "Europe/Moscow"
- name: TZ
value: "Europe/Moscow"
- name: DB_TYPE
value: "postgresdb"
- name: DB_POSTGRESDB_HOST
value: "psql.psql.svc"
- name: DB_POSTGRESDB_DATABASE
value: "n8n"
- name: DB_POSTGRESDB_USER
valueFrom:
secretKeyRef:
name: credentials
key: username
- name: DB_POSTGRESDB_PASSWORD
valueFrom:
secretKeyRef:
name: credentials
key: password
- name: N8N_ENCRYPTION_KEY
valueFrom:
secretKeyRef:
name: credentials
key: encryptionkey
2026-02-05 18:15:37 +02:00
- name: N8N_RUNNERS_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: credentials
key: runnertoken
2026-02-05 17:39:42 +02:00
volumeMounts:
- name: n8n-data
mountPath: /home/node/.n8n
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 512m
memory: 512Mi
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 120
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 6
readinessProbe:
httpGet:
path: /healthz/readiness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 10
volumes:
- name: n8n-data
persistentVolumeClaim:
claimName: n8n-data
securityContext:
2026-02-05 17:57:22 +02:00
runAsUser: 1000
runAsGroup: 1000
2026-02-05 17:47:38 +02:00
runAsNonRoot: true
2026-02-05 17:57:22 +02:00
fsGroup: 1000