From 7a43c83b34836e1962dcc111f9badc219ef2a840 Mon Sep 17 00:00:00 2001 From: Moritz Graf Date: Mon, 30 Mar 2026 16:06:09 +0200 Subject: [PATCH] Updating n8n to latest version --- k8s/README.md | 14 ------- k8s/n8n/AGENTS.md | 55 +++++++++++++++++++++++++ k8s/n8n/garmin-mcp.yaml | 90 ----------------------------------------- k8s/n8n/n8n.secret.yml | 2 +- 4 files changed, 56 insertions(+), 105 deletions(-) create mode 100644 k8s/n8n/AGENTS.md delete mode 100644 k8s/n8n/garmin-mcp.yaml diff --git a/k8s/README.md b/k8s/README.md index eb1337f..b8f2faf 100644 --- a/k8s/README.md +++ b/k8s/README.md @@ -743,20 +743,6 @@ To verify installation was correcet, use the following command: helm get manifest mop-n8n -n n8n | less ``` -Apply the garth mcp server: - -```sh -kubectl apply -f n8n/garmin-mcp.yaml -``` - -Generate token: - -```sh -uvx garth login -#login with user+pw+token -#take output, put in in garth_tkomen.txt -kubectl create secret generic garth-token-secret --from-file=GARTH_TOKEN=./garth_token.txt -n n8n -``` ## n8n-fabi diff --git a/k8s/n8n/AGENTS.md b/k8s/n8n/AGENTS.md new file mode 100644 index 0000000..d90c841 --- /dev/null +++ b/k8s/n8n/AGENTS.md @@ -0,0 +1,55 @@ +# n8n Workload + +> [!NOTE] +> This directory contains the configuration and deployment manifests for **n8n**, a workflow automation tool, deployed in the `n8n` namespace. + +## Workload Information + +* **Namespace**: `n8n` +* **Deployment**: `mop-n8n` (Managed via Helm) +* **Database**: PostgreSQL managed by CloudNativePG operator with cluster name `db`. +* **Ingress**: `n8n.moritzgraf.de` (NGINX Ingress, Let's Encrypt certificates). + + +### Key Files + +* `n8n.secret.yml`: The Helm values file containing configurations, secrets, DB connections, and Ingress settings. Use git-crypt to unlock before editing. + + +## Maintenance Instructions + +> [!IMPORTANT] +> **Update Strategy**: Never update two things at the same time! Update only one component at a time (e.g., the Helm chart OR the n8n application image). After updating one component, automatically verify its functionality and **always ask the human to verify functionality before continuing** to the next update. + +### 1. How to Redeploy/Apply Changes to n8n + +When making changes to `n8n.secret.yml` (e.g., updating configuration or resource limits), you need to re-apply the Helm chart from the `k8s` directory: + +```bash +# Run this from the infrapuzzle/k8s directory +cd ../k8s # if you are in n8n +helm upgrade --cleanup-on-fail --install mop-n8n \ +oci://8gears.container-registry.com/library/n8n \ +--namespace n8n --values n8n/n8n.secret.yml --version 2.0.1 +``` +*(Note: The `--version 2.0.1` flag specifies the Helm Chart version. See Section 2 for updating the chart.)* + +To verify the installation: +```bash +helm get manifest mop-n8n -n n8n | less +``` + +### 2. How to Update the n8n Helm Chart Version + +1. Check the [8gears n8n-helm-chart Releases page](https://github.com/8gears/n8n-helm-chart/releases) for the latest chart version. +2. When running the `helm upgrade` command, change the `--version` argument (e.g., `--version 2.0.1`) to the latest version. +3. Verify the deployment functionality automatically and with the human user before proceeding. + +### 3. How to Update the n8n Application Version + +1. Check the [n8n GitHub Releases page](https://github.com/n8n-io/n8n/releases) for the latest version tag (e.g., `2.13.4`). +2. Update the `tag:` value in `n8n/n8n.secret.yml`. +3. Re-run the `helm upgrade` command mentioned above. +4. Verify the deployment functionality automatically and with the human user before proceeding. + + diff --git a/k8s/n8n/garmin-mcp.yaml b/k8s/n8n/garmin-mcp.yaml deleted file mode 100644 index 9ad0e5e..0000000 --- a/k8s/n8n/garmin-mcp.yaml +++ /dev/null @@ -1,90 +0,0 @@ -# --- 1. Secret to hold your Garmin Connect token --- -# You must create this secret before applying the rest of the manifest. -# Replace 'your_base64_encoded_token_here' with your actual token encoded in Base64. -# To encode your token, run: echo -n 'your_token_from_login' | base64 -# apiVersion: v1 -# kind: Secret -# metadata: -# name: garth-mcp-secret -# namespace: default -# type: Opaque -# data: -# # This key MUST be GARTH_TOKEN to match the application's environment variable -# GARTH_TOKEN: your_base64_encoded_token_here ---- -# deployment.yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: garth-mcp-server - namespace: n8n - labels: - app: garth-mcp-server -spec: - replicas: 1 - selector: - matchLabels: - app: garth-mcp-server - template: - metadata: - labels: - app: garth-mcp-server - spec: - containers: - - name: garth-mcp-server - # Use a Python image version >= 3.13 as requested. - image: python:3.13-slim - resources: - requests: - memory: "64Mi" - cpu: "100m" - limits: - memory: "256Mi" - cpu: "500m" - # This command now installs dependencies and directly executes the mounted script. - command: ["/bin/sh", "-c"] - args: [ - "pip install --no-cache-dir --upgrade pip && \ - pip install --no-cache-dir uv mcp-proxy && \ - echo '--- Setup complete, starting server ---' && \ - mcp-proxy --host=0.0.0.0 --port=8080 --pass-environment uvx garth-mcp-server" - ] - ports: - - containerPort: 8080 - name: http - # Inject the Garmin token securely from the Kubernetes Secret. - envFrom: - - secretRef: - name: garth-token-secret - # # Health probes for Kubernetes to manage the pod's lifecycle. - # livenessProbe: - # tcpSocket: - # port: 8080 - # initialDelaySeconds: 15 - # periodSeconds: 20 - # readinessProbe: - # tcpSocket: - # port: 8080 - # initialDelaySeconds: 60 - # periodSeconds: 10 ---- -# --- 3. Service to expose the Deployment --- -# This creates a stable internal endpoint for the server. -apiVersion: v1 -kind: Service -metadata: - name: garth-mcp-service - namespace: n8n -spec: - selector: - app: garth-mcp-server - ports: - - name: http - protocol: TCP - # The port the service will be available on within the cluster - port: 80 - # The port on the container that the service will forward traffic to - targetPort: 8080 - # ClusterIP is the default, but we're explicit here. - # This service is only reachable from within the Kubernetes cluster. - type: ClusterIP \ No newline at end of file diff --git a/k8s/n8n/n8n.secret.yml b/k8s/n8n/n8n.secret.yml index 68d669f..315922f 100644 --- a/k8s/n8n/n8n.secret.yml +++ b/k8s/n8n/n8n.secret.yml @@ -1,7 +1,7 @@ #small deployment with nodeport for local testing or small deployments image: repository: n8nio/n8n - tag: 2.9.1 + tag: 2.13.4 pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. #tag: "stable"