diff --git a/k8s/apps/n8n/deployment-main.yaml b/k8s/apps/n8n/deployment-main.yaml index 4264fd3..bcc52f0 100644 --- a/k8s/apps/n8n/deployment-main.yaml +++ b/k8s/apps/n8n/deployment-main.yaml @@ -85,6 +85,8 @@ spec: value: "queue" - name: QUEUE_BULL_REDIS_HOST value: "n8n-redis" + - name: QUEUE_BULL_REDIS_PORT + value: "6379" - name: NODE_ENV value: "production" - name: WEBHOOK_URL @@ -132,7 +134,7 @@ spec: memory: 512Mi limits: cpu: 4000m - memory: 2048Gi + memory: 2048Mi livenessProbe: httpGet: path: /healthz diff --git a/k8s/apps/n8n/deployment-worker.yaml b/k8s/apps/n8n/deployment-worker.yaml new file mode 100644 index 0000000..5dd6851 --- /dev/null +++ b/k8s/apps/n8n/deployment-worker.yaml @@ -0,0 +1,84 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: n8n-worker + labels: + app: n8n + component: worker +spec: + replicas: 2 + selector: + matchLabels: + app: n8n + component: worker + template: + metadata: + labels: + app: n8n + component: worker + spec: + serviceAccountName: n8n + containers: + - name: n8n-worker + image: n8nio/n8n:latest + command: + - n8n + - worker + env: + - name: HOME + value: "/home/node" + - name: N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS + value: "true" + - name: EXECUTIONS_MODE + value: "queue" + - name: QUEUE_BULL_REDIS_HOST + value: "n8n-redis" + - name: QUEUE_BULL_REDIS_PORT + value: "6379" + - name: NODE_ENV + value: "production" + - 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 + volumeMounts: + - name: n8n-data + mountPath: /home/node/.n8n + resources: + requests: + cpu: 500m + memory: 512Mi + limits: + cpu: 2000m + memory: 2048Mi + volumes: + - name: n8n-data + persistentVolumeClaim: + claimName: n8n-data + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + runAsNonRoot: true + fsGroup: 1000 diff --git a/k8s/apps/n8n/kustomization.yaml b/k8s/apps/n8n/kustomization.yaml index 3e0ace7..0930e9d 100644 --- a/k8s/apps/n8n/kustomization.yaml +++ b/k8s/apps/n8n/kustomization.yaml @@ -10,7 +10,7 @@ resources: - paddleocr-deployment.yaml - paddleocr-service.yaml - deployment-main.yaml -# - deployment-worker.yaml + - deployment-worker.yaml - deployment-runner.yaml - service.yaml - ingress.yaml