add n8n configs
This commit is contained in:
parent
c6dd35484d
commit
8424ede01a
9
n8n/README.md
Normal file
9
n8n/README.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
## What
|
||||||
|
|
||||||
|
a guide to install n8n in a unique namespace in my k8s cluster
|
||||||
|
|
||||||
|
## How to Init
|
||||||
|
|
||||||
|
```
|
||||||
|
./init.sh
|
||||||
|
```
|
8
n8n/init.sh
Executable file
8
n8n/init.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
mkdir /var/snap/microk8s/common/mnt/data/n8n/data || true
|
||||||
|
chmod 777 /var/snap/microk8s/common/mnt/data/n8n/ -R
|
||||||
|
microk8s.kubectl apply -f namespace.yaml
|
||||||
|
microk8s.kubectl apply -f pv-pvc.yaml
|
||||||
|
microk8s.kubectl apply -f redis.yaml
|
||||||
|
microk8s.kubectl apply -f n8n.yaml
|
||||||
|
microk8s.kubectl apply -f n8n-ingress.yaml
|
18
n8n/n8n-ingress.yaml
Normal file
18
n8n/n8n-ingress.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: n8n-ingress
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- host: n8n.k8s.xunlang.home
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
service:
|
||||||
|
name: n8n-service
|
||||||
|
port:
|
||||||
|
number: 5678
|
||||||
|
path: /
|
||||||
|
pathType: Prefix
|
50
n8n/n8n.yaml
Normal file
50
n8n/n8n.yaml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: n8n-deployment
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: n8n
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: n8n
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: n8n
|
||||||
|
image: docker.n8n.io/n8nio/n8n
|
||||||
|
ports:
|
||||||
|
- containerPort: 5678
|
||||||
|
env:
|
||||||
|
- name: GENERIC_TIMEZONE
|
||||||
|
value: "Europe/Berlin"
|
||||||
|
- name: N8N_SECURE_COOKIE
|
||||||
|
value: "false"
|
||||||
|
- name: TZ
|
||||||
|
value: "Europe/Berlin"
|
||||||
|
volumeMounts:
|
||||||
|
- name: n8n-data-volume
|
||||||
|
mountPath: /home/node/.n8n
|
||||||
|
volumes:
|
||||||
|
- name: n8n-data-volume
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: n8n-pvc
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: n8n-service
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
selector:
|
||||||
|
app: n8n
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 5678
|
||||||
|
targetPort: 5678
|
||||||
|
nodePort: 30080
|
4
n8n/namespace.yaml
Normal file
4
n8n/namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: n8n
|
29
n8n/pv-pvc.yaml
Normal file
29
n8n/pv-pvc.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: n8n-pv
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 10Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
storageClassName: microk8s-hostpath
|
||||||
|
hostPath:
|
||||||
|
path: /var/snap/microk8s/common/mnt/data/n8n/data
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: n8n-pvc
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
storageClassName: microk8s-hostpath
|
||||||
|
valumeName:
|
34
n8n/redis.yaml
Normal file
34
n8n/redis.yaml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: redis-deployment
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: redis
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: redis
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: redis
|
||||||
|
image: redis:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 6379
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: redis-service
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: redis
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 6379
|
||||||
|
targetPort: 6379
|
Loading…
x
Reference in New Issue
Block a user