add n8n deployment, update pgcat with n8n pool
This commit is contained in:
56
n8n/deployment.yaml
Normal file
56
n8n/deployment.yaml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: n8n
|
||||||
|
labels:
|
||||||
|
app: n8n
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: n8n
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: n8n
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: n8n
|
||||||
|
image: n8nio/n8n:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 5678
|
||||||
|
env:
|
||||||
|
- name: DB_TYPE
|
||||||
|
value: postgresdb
|
||||||
|
- name: DB_POSTGRESDB_HOST
|
||||||
|
value: pgcat.tools.svc.cluster.local
|
||||||
|
- name: DB_POSTGRESDB_PORT
|
||||||
|
value: "6432"
|
||||||
|
- name: DB_POSTGRESDB_DATABASE
|
||||||
|
value: n8n
|
||||||
|
- name: DB_POSTGRESDB_USER
|
||||||
|
value: n8n
|
||||||
|
- name: DB_POSTGRESDB_PASSWORD
|
||||||
|
value: n8n
|
||||||
|
- name: N8N_HOST
|
||||||
|
value: n8n.inouter.com
|
||||||
|
- name: N8N_PROTOCOL
|
||||||
|
value: https
|
||||||
|
- name: WEBHOOK_URL
|
||||||
|
value: https://n8n.inouter.com/
|
||||||
|
- name: GENERIC_TIMEZONE
|
||||||
|
value: Asia/Seoul
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /home/node/.n8n
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 256Mi
|
||||||
|
limits:
|
||||||
|
cpu: "1"
|
||||||
|
memory: 1Gi
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: n8n-data
|
||||||
23
n8n/ingress.yaml
Normal file
23
n8n/ingress.yaml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: n8n
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- host: n8n.inouter.com
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: n8n
|
||||||
|
port:
|
||||||
|
number: 5678
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- n8n.inouter.com
|
||||||
|
secretName: wildcard-inouter-com-tls
|
||||||
11
n8n/pvc.yaml
Normal file
11
n8n/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: n8n-data
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: longhorn
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 5Gi
|
||||||
10
n8n/service.yaml
Normal file
10
n8n/service.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: n8n
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: n8n
|
||||||
|
ports:
|
||||||
|
- port: 5678
|
||||||
|
targetPort: 5678
|
||||||
@@ -64,3 +64,24 @@ data:
|
|||||||
["10.100.3.185", 5432, "replica"],
|
["10.100.3.185", 5432, "replica"],
|
||||||
["10.100.1.83", 5432, "replica"]
|
["10.100.1.83", 5432, "replica"]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[pools.n8n]
|
||||||
|
pool_mode = "transaction"
|
||||||
|
default_role = "primary"
|
||||||
|
query_parser_enabled = false
|
||||||
|
query_parser_read_write_splitting = false
|
||||||
|
primary_reads_enabled = true
|
||||||
|
load_balancing_mode = "random"
|
||||||
|
|
||||||
|
[pools.n8n.users.0]
|
||||||
|
username = "n8n"
|
||||||
|
password = "n8n"
|
||||||
|
pool_size = 10
|
||||||
|
min_pool_size = 2
|
||||||
|
server_lifetime = 86400000
|
||||||
|
|
||||||
|
[pools.n8n.shards.0]
|
||||||
|
database = "n8n"
|
||||||
|
servers = [
|
||||||
|
["10.100.2.5", 5432, "primary"]
|
||||||
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user