Skip to main content

Scaling the Great Workflow System: n8n on Kubernetes

n8n is an extendable workflow automation tool that empowers teams to connect APIs, services, and data pipelines with ease. While it's a breeze to get started locally, deploying n8n on Kubernetes unlocks a new level of scalability, resilience, and automation — especially when using Helm to manage the lifecycle.

In this guide, we walk through deploying n8n to a Kubernetes cluster using a custom Helm-based setup, backed by official OCI charts and automation scripts that make the experience fast and production-ready.

Project Structure

n8n/
├── Chart.yaml              # Helm chart metadata
├── values.yaml             # Configuration for n8n (DB, persistence, scaling)
├── templates/              # Kubernetes resource templates (Deployment, Service, PVC, Ingress)
│   ├── _helpers.tpl
│   ├── deployment.yaml
│   ├── ingress.yaml
│   ├── pvc.yaml
│   └── service.yaml
├── scripts/                # Shell scripts for operational tasks
│   ├── deploy.sh
│   ├── uninstall.sh
│   └── cleanup.sh
└── README.md               # Documentation and usage guide

Code Location

Github Link

Pre-requisites

  • A working Kubernetes cluster (minikube, k3s, EKS, GKE, etc.)
  • Helm 3.8+
  • kubectl, pointing to the desired cluster
  • Optional: An external PostgreSQL or MySQL database


Deploying n8n

Run the deployment script:

./scripts/deploy.sh

This will:

  • Create the namespace n8n-system if it doesn’t exist
  • Deploy n8n from the official OCI Helm registry: oci://8gears.container-registry.com/library/n8n

Verify Deployment

Check the pods:

kubectl get pods -n n8n-system

Sample output:

NAME                       READY   STATUS    RESTARTS   AGE
n8n-6c6fd9d6d4-8q9d8       1/1     Running   0          2m

Access n8n

If ingress is not configured, use port-forwarding:

kubectl port-forward svc/n8n-stack-n8n-stack 5678:80 -n n8n-system &

Then open http://localhost:5678 in your browser.

Configuration

Edit values.yaml to update key settings:

config:
  database:
    type: postgresdb
    postgresdb:
      host: postgres.n8n-system.svc.cluster.local
      database: n8n
      user: n8n_user

secret:
  database:
    postgresdb:
      password: "your_postgres_password"

persistence:
  enabled: true
  size: 5Gi
  • config holds non-sensitive values
  • secret contains secure credentials (used as Kubernetes Secrets)
  • persistence enables durable volume storage

Scaling with Queue Mode

Enable queue mode and add Redis to scale horizontally:

scaling:
  enabled: true
  worker:
    count: 2
  redis:
    host: "redis-host"
    password: "redis-password"

In queue mode:

  • The main pod handles the UI and triggers
  • Worker pods run workflows in parallel
  • Redis acts as the shared queue backend

Operational Commands

Uninstall n8n

./scripts/uninstall.sh

Cleanup Persistent Data

./scripts/cleanup.sh

Scale Down / Up

kubectl scale deployment n8n-stack-n8n-stack -n n8n-system --replicas=0
kubectl scale deployment n8n-stack-n8n-stack -n n8n-system --replicas=1

Included AI Workflow

This repo includes an AI-powered n8n workflow:

  • Workflow file: ai-workflow.json
  • Metadata: ai-metadata.yml

To use:

  1. Import the .json into n8n via the UI
  2. Connect your API keys (e.g., OpenAI)
  3. Execute and customize as needed

References

Conclusion

With this Helm-based setup, n8n can be deployed in a secure, scalable, and GitOps-friendly way. Whether you’re building simple integrations or advanced AI workflows, this approach gives you full control over automation infrastructure on Kubernetes.

Popular posts from this blog

Syslog Standards: A simple Comparison between RFC3164 & RFC5424

Syslog Standards: A simple Comparison between RFC3164 (old format) & RFC5424 (new format) Though syslog standards have been for quite long time, lot of people still doesn't understand the formats in detail. The original standard document is quite lengthy to read and purpose of this article is to explain with examples Some of things you might need to understand The RFC standards can be used in any syslog daemon (syslog-ng, rsyslog etc.) Always try to capture the data in these standards. Especially when you have log aggregation like Splunk or Elastic, these templates are built-in which makes your life simple. Syslog can work with both UDP & TCP  Link to the documents the original BSD format ( RFC3164 ) the “new” format ( RFC5424 ) RFC3164 (the old format) RFC3164 originated from combining multiple implementations (Year 2001) ...

Create your own Passport Photo using GIMP

This tutorial is for semi-techies who knows a bit of GIMP (image editing).   This tutorial is for UK style passport photo ( 45mm x 35 mm ) which is widely used in UK, Australia, New Zealand, India etc.  This is a quick and easy process and one can create Passport photos at home If you are non-technical, use this link   .  If you want to create United States (USA) Passport photo or Overseas Citizen of India (OCI) photo, please follow this link How to Make your own Passport Photo - Prerequisite GIMP - One of the best image editing tools and its completely Free USB stick or any memory device to store and take to nearby shop A quality Digital camera Local Shops where you can print. Normally it costs (£0.15 or 25 US cents) to print 8 photos Steps (Video Tutorial attached blow of this page) Ask one of your colleague to take a photo  of you with a light background. Further details of how to take a photo  yourself       ...

VS Code & Portable GIT shell integration in Windows

Visual Studio Code & GIT Portable shell Integration Summary Many of your corporate laptop cannot install programs and it is quite good to have them as portable executables. Here we find a way to have Portable VS Code and Portable GIT and integrate the GIT shell into VS Code Pre-Reqs VS Code (Install version or Portable ) GIT portable Steps Create a directory in your Windows device (eg:  C:\installables\ ) Unpack GIT portable into the above directory (eg it becomes: C:\installables\PortableGit ) Now unpack Visual Studio (VS) Code and run it. The default shell would be windows based Update User or Workspace settings of VS Code (ShortCut is:  Control+Shift+p ) Search for 'Open Workspace Settings (JSON)' and press Enter Update the settings with following setting { "workbench.colorTheme": "Default Dark+", "git.ignoreMissingGitWarning": true, "git.enabled": true, "terminal.integrated.profiles.windo...