Spaces:
Sleeping
Sleeping
Commit
·
4b695a0
1
Parent(s):
a7a6ad0
Add Kubernetes manifests for n8n deployment
Browse filesIntroduces base and overlay kustomize configurations for deploying n8n on Kubernetes. Includes namespace, network policy, deployment, and service definitions, as well as a desktop overlay with a LoadBalancer service type.
- docker/bridge/base/0-docker-namespace.yaml +8 -0
- docker/bridge/base/default-network-policy.yaml +24 -0
- docker/bridge/base/kustomization.yaml +10 -0
- docker/bridge/base/n8n-deployment.yaml +88 -0
- docker/bridge/base/n8n-expose.yaml +18 -0
- docker/bridge/base/n8n-service.yaml +21 -0
- docker/bridge/overlays/desktop/kustomization.yaml +8 -0
- docker/bridge/overlays/desktop/n8n-service.yaml +11 -0
docker/bridge/base/0-docker-namespace.yaml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#! 0-docker-namespace.yaml
|
2 |
+
# Generated code, do not edit
|
3 |
+
apiVersion: v1
|
4 |
+
kind: Namespace
|
5 |
+
metadata:
|
6 |
+
name: docker
|
7 |
+
labels:
|
8 |
+
com.docker.compose.project: docker
|
docker/bridge/base/default-network-policy.yaml
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#! default-network-policy.yaml
|
2 |
+
# Generated code, do not edit
|
3 |
+
apiVersion: networking.k8s.io/v1
|
4 |
+
kind: NetworkPolicy
|
5 |
+
metadata:
|
6 |
+
name: default-network-policy
|
7 |
+
namespace: docker
|
8 |
+
spec:
|
9 |
+
podSelector:
|
10 |
+
matchLabels:
|
11 |
+
com.docker.compose.network.default: "true"
|
12 |
+
policyTypes:
|
13 |
+
- Ingress
|
14 |
+
- Egress
|
15 |
+
ingress:
|
16 |
+
- from:
|
17 |
+
- podSelector:
|
18 |
+
matchLabels:
|
19 |
+
com.docker.compose.network.default: "true"
|
20 |
+
egress:
|
21 |
+
- to:
|
22 |
+
- podSelector:
|
23 |
+
matchLabels:
|
24 |
+
com.docker.compose.network.default: "true"
|
docker/bridge/base/kustomization.yaml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#! kustomization.yaml
|
2 |
+
# Generated code, do not edit
|
3 |
+
apiVersion: kustomize.config.k8s.io/v1beta1
|
4 |
+
kind: Kustomization
|
5 |
+
resources:
|
6 |
+
- 0-docker-namespace.yaml
|
7 |
+
- default-network-policy.yaml
|
8 |
+
- n8n-deployment.yaml
|
9 |
+
- n8n-expose.yaml
|
10 |
+
- n8n-service.yaml
|
docker/bridge/base/n8n-deployment.yaml
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#! n8n-deployment.yaml
|
2 |
+
# Generated code, do not edit
|
3 |
+
apiVersion: apps/v1
|
4 |
+
kind: Deployment
|
5 |
+
metadata:
|
6 |
+
name: n8n
|
7 |
+
namespace: docker
|
8 |
+
labels:
|
9 |
+
com.docker.compose.project: docker
|
10 |
+
com.docker.compose.service: n8n
|
11 |
+
spec:
|
12 |
+
replicas: 1
|
13 |
+
selector:
|
14 |
+
matchLabels:
|
15 |
+
com.docker.compose.project: docker
|
16 |
+
com.docker.compose.service: n8n
|
17 |
+
strategy:
|
18 |
+
type: Recreate
|
19 |
+
template:
|
20 |
+
metadata:
|
21 |
+
labels:
|
22 |
+
com.docker.compose.project: docker
|
23 |
+
com.docker.compose.service: n8n
|
24 |
+
com.docker.compose.network.default: "true"
|
25 |
+
spec:
|
26 |
+
restartPolicy: unless-stopped
|
27 |
+
containers:
|
28 |
+
- name: n8n-local
|
29 |
+
image: n8nio/n8n:1.108.2
|
30 |
+
imagePullPolicy: IfNotPresent
|
31 |
+
env:
|
32 |
+
- name: DB_POSTGRESDB_DATABASE
|
33 |
+
value: ""
|
34 |
+
- name: DB_POSTGRESDB_HOST
|
35 |
+
value: ""
|
36 |
+
- name: DB_POSTGRESDB_PASSWORD
|
37 |
+
value: ""
|
38 |
+
- name: DB_POSTGRESDB_PORT
|
39 |
+
value: ""
|
40 |
+
- name: DB_POSTGRESDB_SCHEMA
|
41 |
+
value: "public"
|
42 |
+
- name: DB_POSTGRESDB_SSL
|
43 |
+
value: "true"
|
44 |
+
- name: DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED
|
45 |
+
value: "false"
|
46 |
+
- name: DB_POSTGRESDB_USER
|
47 |
+
value: ""
|
48 |
+
- name: DB_TYPE
|
49 |
+
value: "postgresdb"
|
50 |
+
- name: EXECUTIONS_DATA_MAX_AGE
|
51 |
+
value: "336"
|
52 |
+
- name: EXECUTIONS_DATA_PRUNE
|
53 |
+
value: "true"
|
54 |
+
- name: EXECUTIONS_DATA_SAVE_ON_ERROR
|
55 |
+
value: "all"
|
56 |
+
- name: EXECUTIONS_DATA_SAVE_ON_SUCCESS
|
57 |
+
value: "none"
|
58 |
+
- name: EXECUTIONS_MODE
|
59 |
+
value: "regular"
|
60 |
+
- name: N8N_ENCRYPTION_KEY
|
61 |
+
value: ""
|
62 |
+
- name: N8N_METRICS
|
63 |
+
value: "true"
|
64 |
+
- name: N8N_PORT
|
65 |
+
value: "5678"
|
66 |
+
- name: N8N_PROTOCOL
|
67 |
+
value: "http"
|
68 |
+
- name: N8N_USER_MANAGEMENT_JWT_SECRET
|
69 |
+
value: ""
|
70 |
+
- name: QUEUE_HEALTH_CHECK_ACTIVE
|
71 |
+
value: "true"
|
72 |
+
- name: WEBHOOK_URL
|
73 |
+
value: "http://localhost:5678/"
|
74 |
+
ports:
|
75 |
+
- name: n8n-5678
|
76 |
+
containerPort: 5678
|
77 |
+
volumeMounts:
|
78 |
+
- name: config
|
79 |
+
mountPath: /config
|
80 |
+
- name: workflows
|
81 |
+
mountPath: /workflows
|
82 |
+
volumes:
|
83 |
+
- name: config
|
84 |
+
hostPath:
|
85 |
+
path: /Users/danilonovais/N8N-Infrastructure/docker/config
|
86 |
+
- name: workflows
|
87 |
+
hostPath:
|
88 |
+
path: /Users/danilonovais/N8N-Infrastructure/docker/workflows
|
docker/bridge/base/n8n-expose.yaml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#! n8n-expose.yaml
|
2 |
+
# Generated code, do not edit
|
3 |
+
apiVersion: v1
|
4 |
+
kind: Service
|
5 |
+
metadata:
|
6 |
+
name: n8n
|
7 |
+
namespace: docker
|
8 |
+
labels:
|
9 |
+
com.docker.compose.project: docker
|
10 |
+
com.docker.compose.service: n8n
|
11 |
+
spec:
|
12 |
+
selector:
|
13 |
+
com.docker.compose.project: docker
|
14 |
+
com.docker.compose.service: n8n
|
15 |
+
ports:
|
16 |
+
- name: n8n-5678
|
17 |
+
port: 5678
|
18 |
+
targetPort: n8n-5678
|
docker/bridge/base/n8n-service.yaml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# check if there is at least one published port
|
2 |
+
|
3 |
+
#! n8n-service.yaml
|
4 |
+
# Generated code, do not edit
|
5 |
+
apiVersion: v1
|
6 |
+
kind: Service
|
7 |
+
metadata:
|
8 |
+
name: n8n-published
|
9 |
+
namespace: docker
|
10 |
+
labels:
|
11 |
+
com.docker.compose.project: docker
|
12 |
+
com.docker.compose.service: n8n
|
13 |
+
spec:
|
14 |
+
selector:
|
15 |
+
com.docker.compose.project: docker
|
16 |
+
com.docker.compose.service: n8n
|
17 |
+
ports:
|
18 |
+
- name: n8n-5678
|
19 |
+
port: 5678
|
20 |
+
protocol: TCP
|
21 |
+
targetPort: n8n-5678
|
docker/bridge/overlays/desktop/kustomization.yaml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#! kustomization.yaml
|
2 |
+
# Generated code, do not edit
|
3 |
+
apiVersion: kustomize.config.k8s.io/v1beta1
|
4 |
+
kind: Kustomization
|
5 |
+
resources:
|
6 |
+
- ../../base
|
7 |
+
patches:
|
8 |
+
- path: n8n-service.yaml
|
docker/bridge/overlays/desktop/n8n-service.yaml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# check if there is at least one published port
|
2 |
+
|
3 |
+
#! n8n-service.yaml
|
4 |
+
# Generated code, do not edit
|
5 |
+
apiVersion: v1
|
6 |
+
kind: Service
|
7 |
+
metadata:
|
8 |
+
name: n8n-published
|
9 |
+
namespace: docker
|
10 |
+
spec:
|
11 |
+
type: LoadBalancer
|