Compare commits
18 Commits
auto-updat
...
auto-updat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
025c227a76 | ||
|
|
1221dbf7b5 | ||
|
|
42ebe4cbda | ||
|
|
4059bc1a70 | ||
|
|
65f8056ef7 | ||
|
|
8fca12c674 | ||
|
|
51cc40377c | ||
|
|
ff58069789 | ||
|
|
6b5a120fc4 | ||
|
|
499da735f7 | ||
|
|
3054a9242b | ||
|
|
4d095e2773 | ||
|
|
09562a6cb9 | ||
|
|
b81087515d | ||
|
|
39232d422d | ||
|
|
40b565b5c8 | ||
|
|
a7aaa3e4a5 | ||
|
|
5f882c7beb |
@@ -10,8 +10,9 @@ spec:
|
|||||||
template:
|
template:
|
||||||
type: Opaque
|
type: Opaque
|
||||||
data:
|
data:
|
||||||
postgres-password: "{{ .psql | trim }}"
|
password: "{{ .psql | trim }}"
|
||||||
N8N_ENCRYPTION_KEY: "{{ .enc_pass | trim }}"
|
username: "n8n"
|
||||||
|
encryptionkey: "{{ .enc_pass | trim }}"
|
||||||
data:
|
data:
|
||||||
- secretKey: psql
|
- secretKey: psql
|
||||||
sourceRef:
|
sourceRef:
|
||||||
|
|||||||
@@ -4,16 +4,16 @@ kind: Kustomization
|
|||||||
|
|
||||||
resources:
|
resources:
|
||||||
- external-secrets.yaml
|
- external-secrets.yaml
|
||||||
- storage.yaml
|
- plain/
|
||||||
|
|
||||||
helmCharts:
|
helmCharts:
|
||||||
- name: n8n
|
# - name: n8n
|
||||||
repo: https://community-charts.github.io/helm-charts
|
# repo: https://community-charts.github.io/helm-charts
|
||||||
version: 1.16.28
|
# version: 1.16.28
|
||||||
releaseName: n8n
|
# releaseName: n8n
|
||||||
namespace: n8n
|
# namespace: n8n
|
||||||
valuesFile: values-n8n.yaml
|
# valuesFile: values-n8n.yaml
|
||||||
includeCRDs: true
|
# includeCRDs: true
|
||||||
- name: yacy
|
- name: yacy
|
||||||
repo: https://gt.hexor.cy/api/packages/ab/helm
|
repo: https://gt.hexor.cy/api/packages/ab/helm
|
||||||
version: 0.1.2
|
version: 0.1.2
|
||||||
|
|||||||
109
k8s/apps/n8n/plain/deployment-main.yaml
Normal file
109
k8s/apps/n8n/plain/deployment-main.yaml
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: n8n-main
|
||||||
|
labels:
|
||||||
|
app: n8n
|
||||||
|
component: main
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: n8n
|
||||||
|
component: main
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: n8n
|
||||||
|
component: main
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: n8n
|
||||||
|
image: docker.n8n.io/n8nio/n8n:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 5678
|
||||||
|
name: http
|
||||||
|
env:
|
||||||
|
- name: HOME
|
||||||
|
value: "/home/node"
|
||||||
|
- name: N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS
|
||||||
|
value: "true"
|
||||||
|
- name: N8N_HOST
|
||||||
|
value: "n8n.hexor.cy"
|
||||||
|
- name: N8N_PORT
|
||||||
|
value: "5678"
|
||||||
|
- name: N8N_PROTOCOL
|
||||||
|
value: "https"
|
||||||
|
- name: N8N_RUNNERS_ENABLED
|
||||||
|
value: "true"
|
||||||
|
- name: N8N_RUNNERS_MODE
|
||||||
|
value: "external"
|
||||||
|
- name: EXECUTIONS_MODE
|
||||||
|
value: "queue"
|
||||||
|
- name: QUEUE_BULL_REDIS_HOST
|
||||||
|
value: "n8n-redis"
|
||||||
|
- name: NODE_ENV
|
||||||
|
value: "production"
|
||||||
|
- name: WEBHOOK_URL
|
||||||
|
value: "https://n8n.hexor.cy/"
|
||||||
|
- 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: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 512m
|
||||||
|
memory: 512Mi
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 120
|
||||||
|
periodSeconds: 30
|
||||||
|
timeoutSeconds: 10
|
||||||
|
failureThreshold: 6
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthz/readiness
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 60
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 10
|
||||||
|
volumes:
|
||||||
|
- name: n8n-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: n8n-data
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
|
runAsNonRoot: true
|
||||||
|
fsGroup: 1000
|
||||||
95
k8s/apps/n8n/plain/deployment-worker.yaml
Normal file
95
k8s/apps/n8n/plain/deployment-worker.yaml
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: n8n-worker
|
||||||
|
labels:
|
||||||
|
app: n8n
|
||||||
|
component: worker
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: n8n
|
||||||
|
component: worker
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: n8n
|
||||||
|
component: worker
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: n8n-worker
|
||||||
|
image: docker.n8n.io/n8nio/n8n:latest
|
||||||
|
command: ["n8n", "worker"]
|
||||||
|
env:
|
||||||
|
- name: HOME
|
||||||
|
value: "/home/node"
|
||||||
|
- name: N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS
|
||||||
|
value: "true"
|
||||||
|
- name: N8N_RUNNERS_ENABLED
|
||||||
|
value: "true"
|
||||||
|
- name: N8N_RUNNERS_MODE
|
||||||
|
value: "external"
|
||||||
|
- name: N8N_PORT
|
||||||
|
value: "80"
|
||||||
|
- name: EXECUTIONS_MODE
|
||||||
|
value: "queue"
|
||||||
|
- name: QUEUE_BULL_REDIS_HOST
|
||||||
|
value: "n8n-redis"
|
||||||
|
- 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: 100m
|
||||||
|
memory: 256Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 1Gi
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- "ps aux | grep '[n]8n worker' || exit 1"
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 30
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
volumes:
|
||||||
|
- name: n8n-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: n8n-data
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
|
runAsNonRoot: true
|
||||||
|
fsGroup: 1000
|
||||||
28
k8s/apps/n8n/plain/ingress.yaml
Normal file
28
k8s/apps/n8n/plain/ingress.yaml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: n8n
|
||||||
|
labels:
|
||||||
|
app: n8n
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: letsencrypt
|
||||||
|
traefik.ingress.kubernetes.io/router.middlewares: kube-system-https-redirect@kubernetescrd
|
||||||
|
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- n8n.hexor.cy
|
||||||
|
secretName: n8n-tls
|
||||||
|
rules:
|
||||||
|
- host: n8n.hexor.cy
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: n8n
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
15
k8s/apps/n8n/plain/kustomization.yaml
Normal file
15
k8s/apps/n8n/plain/kustomization.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- storage.yaml
|
||||||
|
- redis-deployment.yaml
|
||||||
|
- redis-service.yaml
|
||||||
|
- deployment-main.yaml
|
||||||
|
- deployment-worker.yaml
|
||||||
|
- service.yaml
|
||||||
|
- ingress.yaml
|
||||||
|
|
||||||
|
commonLabels:
|
||||||
|
app.kubernetes.io/name: n8n
|
||||||
|
app.kubernetes.io/instance: n8n-plain
|
||||||
57
k8s/apps/n8n/plain/redis-deployment.yaml
Normal file
57
k8s/apps/n8n/plain/redis-deployment.yaml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: n8n-redis
|
||||||
|
labels:
|
||||||
|
app: redis
|
||||||
|
component: n8n
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: redis
|
||||||
|
component: n8n
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: redis
|
||||||
|
component: n8n
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: redis
|
||||||
|
image: redis:7-alpine
|
||||||
|
ports:
|
||||||
|
- containerPort: 6379
|
||||||
|
name: redis
|
||||||
|
command:
|
||||||
|
- redis-server
|
||||||
|
- --appendonly
|
||||||
|
- "yes"
|
||||||
|
- --save
|
||||||
|
- "900 1"
|
||||||
|
volumeMounts:
|
||||||
|
- name: redis-data
|
||||||
|
mountPath: /data
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 256Mi
|
||||||
|
livenessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: 6379
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- redis-cli
|
||||||
|
- ping
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 5
|
||||||
|
volumes:
|
||||||
|
- name: redis-data
|
||||||
|
emptyDir: {}
|
||||||
18
k8s/apps/n8n/plain/redis-service.yaml
Normal file
18
k8s/apps/n8n/plain/redis-service.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: n8n-redis
|
||||||
|
labels:
|
||||||
|
app: redis
|
||||||
|
component: n8n
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: redis
|
||||||
|
component: n8n
|
||||||
|
ports:
|
||||||
|
- name: redis
|
||||||
|
port: 6379
|
||||||
|
targetPort: 6379
|
||||||
|
protocol: TCP
|
||||||
|
type: ClusterIP
|
||||||
17
k8s/apps/n8n/plain/service.yaml
Normal file
17
k8s/apps/n8n/plain/service.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: n8n
|
||||||
|
labels:
|
||||||
|
app: n8n
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: n8n
|
||||||
|
component: main
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 80
|
||||||
|
targetPort: 5678
|
||||||
|
protocol: TCP
|
||||||
|
type: ClusterIP
|
||||||
12
k8s/apps/n8n/plain/storage.yaml
Normal file
12
k8s/apps/n8n/plain/storage.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: n8n-data
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
storageClassName: nfs-csi
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
71
k8s/apps/n8n/rbac.yaml
Normal file
71
k8s/apps/n8n/rbac.yaml
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: n8n-readonly
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources:
|
||||||
|
- pods
|
||||||
|
- services
|
||||||
|
- endpoints
|
||||||
|
- persistentvolumeclaims
|
||||||
|
- persistentvolumes
|
||||||
|
- configmaps
|
||||||
|
- secrets
|
||||||
|
- nodes
|
||||||
|
- namespaces
|
||||||
|
- events
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["apps"]
|
||||||
|
resources:
|
||||||
|
- deployments
|
||||||
|
- replicasets
|
||||||
|
- statefulsets
|
||||||
|
- daemonsets
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["networking.k8s.io"]
|
||||||
|
resources:
|
||||||
|
- ingresses
|
||||||
|
- networkpolicies
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["extensions"]
|
||||||
|
resources:
|
||||||
|
- ingresses
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["autoscaling"]
|
||||||
|
resources:
|
||||||
|
- horizontalpodautoscalers
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["batch"]
|
||||||
|
resources:
|
||||||
|
- jobs
|
||||||
|
- cronjobs
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["metrics.k8s.io"]
|
||||||
|
resources:
|
||||||
|
- pods
|
||||||
|
- nodes
|
||||||
|
verbs: ["get", "list"]
|
||||||
|
- apiGroups: ["storage.k8s.io"]
|
||||||
|
resources:
|
||||||
|
- storageclasses
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["policy"]
|
||||||
|
resources:
|
||||||
|
- poddisruptionbudgets
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: n8n-readonly
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: n8n-readonly
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: n8n-readonly
|
||||||
|
namespace: n8n
|
||||||
@@ -1,10 +1,19 @@
|
|||||||
nodeSelector:
|
nodeSelector:
|
||||||
kubernetes.io/hostname: master.tail2fe2d.ts.net
|
kubernetes.io/hostname: master.tail2fe2d.ts.net
|
||||||
|
|
||||||
|
|
||||||
db:
|
db:
|
||||||
type: postgresdb
|
type: postgresdb
|
||||||
|
|
||||||
|
podSecurityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
|
runAsNonRoot: true
|
||||||
|
|
||||||
|
# Configure health probes for slow startup
|
||||||
main:
|
main:
|
||||||
|
extraEnvVars:
|
||||||
|
NODES_EXCLUDE: "[]"
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
@@ -16,20 +25,23 @@ main:
|
|||||||
enabled: true
|
enabled: true
|
||||||
existingClaim: n8n-home
|
existingClaim: n8n-home
|
||||||
mountPath: /home/node/.n8n
|
mountPath: /home/node/.n8n
|
||||||
|
|
||||||
podSecurityContext:
|
|
||||||
runAsUser: 1000
|
|
||||||
runAsGroup: 1000
|
|
||||||
runAsNonRoot: true
|
|
||||||
|
|
||||||
# Disable all health probes to avoid startup issues
|
|
||||||
main:
|
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
enabled: false
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 120
|
||||||
|
periodSeconds: 30
|
||||||
|
timeoutSeconds: 10
|
||||||
|
failureThreshold: 6
|
||||||
|
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
enabled: false
|
httpGet:
|
||||||
startupProbe:
|
path: /healthz/readiness
|
||||||
enabled: false
|
port: http
|
||||||
|
initialDelaySeconds: 60
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 10
|
||||||
|
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
@@ -43,6 +55,12 @@ redis:
|
|||||||
|
|
||||||
existingEncryptionKeySecret: credentials
|
existingEncryptionKeySecret: credentials
|
||||||
|
|
||||||
|
serviceAccount:
|
||||||
|
create: true
|
||||||
|
automount: true
|
||||||
|
annotations: {}
|
||||||
|
name: "n8n-readonly"
|
||||||
|
|
||||||
externalPostgresql:
|
externalPostgresql:
|
||||||
existingSecret: credentials
|
existingSecret: credentials
|
||||||
host: "psql.psql.svc"
|
host: "psql.psql.svc"
|
||||||
|
|||||||
Reference in New Issue
Block a user