From b81087515d347f0e97d447a01b810540d8187520 Mon Sep 17 00:00:00 2001 From: Ultradesu Date: Thu, 5 Feb 2026 17:39:42 +0200 Subject: [PATCH] moved to manifests from chart --- k8s/apps/n8n/kustomization.yaml | 17 ++-- k8s/apps/n8n/plain/deployment-main.yaml | 106 ++++++++++++++++++++++ k8s/apps/n8n/plain/deployment-worker.yaml | 90 ++++++++++++++++++ k8s/apps/n8n/plain/ingress.yaml | 28 ++++++ k8s/apps/n8n/plain/kustomization.yaml | 13 +++ k8s/apps/n8n/plain/service.yaml | 17 ++++ k8s/apps/n8n/plain/storage.yaml | 12 +++ 7 files changed, 274 insertions(+), 9 deletions(-) create mode 100644 k8s/apps/n8n/plain/deployment-main.yaml create mode 100644 k8s/apps/n8n/plain/deployment-worker.yaml create mode 100644 k8s/apps/n8n/plain/ingress.yaml create mode 100644 k8s/apps/n8n/plain/kustomization.yaml create mode 100644 k8s/apps/n8n/plain/service.yaml create mode 100644 k8s/apps/n8n/plain/storage.yaml diff --git a/k8s/apps/n8n/kustomization.yaml b/k8s/apps/n8n/kustomization.yaml index 2055662..6085721 100644 --- a/k8s/apps/n8n/kustomization.yaml +++ b/k8s/apps/n8n/kustomization.yaml @@ -4,17 +4,16 @@ kind: Kustomization resources: - external-secrets.yaml - - storage.yaml - - rbac.yaml + - plain/kustomization.yaml helmCharts: - - name: n8n - repo: https://community-charts.github.io/helm-charts - version: 1.16.28 - releaseName: n8n - namespace: n8n - valuesFile: values-n8n.yaml - includeCRDs: true +# - name: n8n +# repo: https://community-charts.github.io/helm-charts +# version: 1.16.28 +# releaseName: n8n +# namespace: n8n +# valuesFile: values-n8n.yaml +# includeCRDs: true - name: yacy repo: https://gt.hexor.cy/api/packages/ab/helm version: 0.1.2 diff --git a/k8s/apps/n8n/plain/deployment-main.yaml b/k8s/apps/n8n/plain/deployment-main.yaml new file mode 100644 index 0000000..6a001ec --- /dev/null +++ b/k8s/apps/n8n/plain/deployment-main.yaml @@ -0,0 +1,106 @@ +--- +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: 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 \ No newline at end of file diff --git a/k8s/apps/n8n/plain/deployment-worker.yaml b/k8s/apps/n8n/plain/deployment-worker.yaml new file mode 100644 index 0000000..f45b3cf --- /dev/null +++ b/k8s/apps/n8n/plain/deployment-worker.yaml @@ -0,0 +1,90 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: n8n-worker + labels: + app: n8n + component: worker +spec: + replicas: 2 + 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: N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS + value: "true" + - 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: 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 \ No newline at end of file diff --git a/k8s/apps/n8n/plain/ingress.yaml b/k8s/apps/n8n/plain/ingress.yaml new file mode 100644 index 0000000..bbf0b3c --- /dev/null +++ b/k8s/apps/n8n/plain/ingress.yaml @@ -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 \ No newline at end of file diff --git a/k8s/apps/n8n/plain/kustomization.yaml b/k8s/apps/n8n/plain/kustomization.yaml new file mode 100644 index 0000000..8874718 --- /dev/null +++ b/k8s/apps/n8n/plain/kustomization.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - storage.yaml + - deployment-main.yaml + - deployment-worker.yaml + - service.yaml + - ingress.yaml + +commonLabels: + app.kubernetes.io/name: n8n + app.kubernetes.io/instance: n8n-plain \ No newline at end of file diff --git a/k8s/apps/n8n/plain/service.yaml b/k8s/apps/n8n/plain/service.yaml new file mode 100644 index 0000000..46d204f --- /dev/null +++ b/k8s/apps/n8n/plain/service.yaml @@ -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 \ No newline at end of file diff --git a/k8s/apps/n8n/plain/storage.yaml b/k8s/apps/n8n/plain/storage.yaml new file mode 100644 index 0000000..0b47702 --- /dev/null +++ b/k8s/apps/n8n/plain/storage.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: n8n-data +spec: + accessModes: + - ReadWriteMany + storageClassName: nfs-csi + resources: + requests: + storage: 10Gi \ No newline at end of file