infra/home/cluster/n8n/n8n-deployment.yaml
2025-10-06 09:17:32 -05:00

107 lines
No EOL
2.4 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: n8n-config
namespace: n8n
data:
N8N_HOST: "n8n.w5isp.com"
N8N_PORT: "5678"
N8N_PROTOCOL: "https"
N8N_EDITOR_BASE_URL: "https://n8n.w5isp.com/"
WEBHOOK_URL: "https://n8n.w5isp.com/"
N8N_METRICS: "true"
N8N_BASIC_AUTH_ACTIVE: "false"
DB_TYPE: "postgresdb"
DB_POSTGRESDB_HOST: "postgres.n8n.svc.cluster.local"
DB_POSTGRESDB_PORT: "5432"
DB_POSTGRESDB_DATABASE: "n8n"
DB_POSTGRESDB_USER: "n8n"
EXECUTIONS_MODE: "regular"
N8N_PERSONALIZATION_ENABLED: "false"
N8N_VERSION_NOTIFICATIONS_ENABLED: "true"
N8N_HIDE_USAGE_PAGE: "true"
GENERIC_TIMEZONE: "America/Chicago"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: n8n
namespace: n8n
spec:
replicas: 1
selector:
matchLabels:
app: n8n
template:
metadata:
labels:
app: n8n
spec:
initContainers:
- name: fix-permissions
image: busybox
command: ['sh', '-c', 'chown -R 1000:1000 /home/node/.n8n']
volumeMounts:
- name: n8n-data
mountPath: /home/node/.n8n
containers:
- name: n8n
image: n8nio/n8n:latest
ports:
- containerPort: 5678
env:
- name: DB_POSTGRESDB_PASSWORD
valueFrom:
secretKeyRef:
name: n8n-secret
key: DB_POSTGRESDB_PASSWORD
- name: N8N_ENCRYPTION_KEY
valueFrom:
secretKeyRef:
name: n8n-secret
key: N8N_ENCRYPTION_KEY
envFrom:
- configMapRef:
name: n8n-config
volumeMounts:
- name: n8n-data
mountPath: /home/node/.n8n
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "2048Mi"
cpu: "1000m"
livenessProbe:
httpGet:
path: /healthz
port: 5678
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /healthz
port: 5678
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
volumes:
- name: n8n-data
persistentVolumeClaim:
claimName: n8n-data
---
apiVersion: v1
kind: Service
metadata:
name: n8n
namespace: n8n
spec:
type: ClusterIP
selector:
app: n8n
ports:
- port: 5678
targetPort: 5678
name: http