Skip to content

Run n8n on EKS ​

Kubernetes is the other way to run n8n on AWS. Amazon EKS is the managed Kubernetes service, and n8n publishes an official Helm chart (a package of Kubernetes objects) for it. You choose EKS when your team already runs Kubernetes, or when you want to share a cluster with other workloads.

This guide explains what runtime.platform: eks builds, how the pieces connect, and what the smoke tests showed. You need an AWS account with the CDK bootstrapped, and the terms of concepts. Start from the samples eks-new-cluster or eks-existing-cluster.

What gets built ​

runtime.platform: eks replaces the ECS service stack with the <name>-n8n stack of cdk/eks.py. The network and data stacks stay as they are. The stack contains a cluster (or the lookup of one), the add-ons, the secrets plumbing, and one Helm release of the official n8n chart, pinned by runtime.eks.chart.version.

Chart, not generated manifests ​

The values come from the same plan as ECS (cdk/helm_values.py): roles and sizes, environment, secrets, task runners, replicas. The chart renders the Kubernetes objects, so it follows n8n's own defaults. Settings the chart derives from a value (database host, Redis host, execution mode, public URLs) are given as values and not as variables, so the two never disagree. The chart is released weekly: the version is pinned, and the tests render the values against it with helm template when helm is available.

Cluster ​

kind: create builds an EKS Auto Mode cluster, or a cluster with a managed node group (Graviton picks the arm64 image). compute: fargate is rejected (T20): the add-ons do not run well on Fargate pods. admin_role_arns get access entries. kind: existing looks the cluster up by name, adds an access entry for the role that runs kubectl and helm, and installs only what keda and external_secrets ask for. The AWS Load Balancer Controller is installed only on a cluster we create (T21); Auto Mode has it built in. The kubectl provider needs a public or VPC-reachable endpoint, and its layer (kubectl 1.35) supports clusters from 1.34 to 1.36.

Identity and secrets ​

The n8n service account gets an EKS Pod Identity association with the S3 grants. External Secrets reads Secrets Manager through its own Pod Identity role, and writes one Kubernetes secret, n8n-secrets, which holds the encryption key, the database credentials, the runners token, the license key and the Redis password. With external_secrets: existing, the operator is yours: its identity must read those secrets. One variable is set twice on purpose: with an external database, the chart sets DB_POSTGRESDB_USER as a plain value, and the secret value follows it and wins.

Workers ​

With keda: install or existing, KEDA scales workers on the BullMQ waiting list in Redis. This is the signal of the ECS path through another door: ECS publishes n8n's queue gauges to CloudWatch with a sidecar, while on EKS KEDA reads the list itself. observability.prometheus: cloudwatch is ignored on EKS (C2).

Ingress ​

The AWS Load Balancer Controller creates one internet-facing or internal ALB for all the Ingresses of the release, which share a group. The editor paths carry the login wall (auth-* annotations for alb-cognito or alb-oidc). The public paths of PUBLIC_PATHS are Ingresses without it, ordered before the editor, and /metrics answers 404. The ALB carries the web ACL of ingress.waf through the wafv2-acl-arn annotation.

Finding the ALB ​

The controller creates the ALB after the Helm release, and helm --wait does not wait for it, so CDK never holds the ALB. The stack names it <name>-n8n (the load-balancer-name annotation, and loadBalancerName in IngressClassParams on Auto Mode), then a custom resource polls DescribeLoadBalancers every 20 seconds, for at most 20 minutes, until the ALB is active. Its ARN, DNS name and hosted zone feed the rest: the Route 53 alias of ingress.domain (to the ALB, or to CloudFront when it is in front), the LoadBalancerDns output and the load balancer section of the dashboard.

CloudFront ​

With ingress.kind: cloudfront and origin: alb, the shape is the one of ECS: the ALB is internal, in the private subnets, listens on HTTP 80 only, and admits only CloudFront's origin-facing prefix list (security-group-prefix-lists). CloudFront reaches it through a VPC origin built from the looked-up ARN. The distribution, the cloudfront-cognito wall at the edge, the CloudFront web ACL and their dashboard sections are the same code as on ECS (cdk/front.py). The distribution depends on the lookup, which depends on the release, so on deletion CloudFront and the VPC origin go before the release removes the ALB.

Smoke test with CloudFront in front ​

On Nov-29, the deployment n8n-eks2 ran in eu-west-3 on Auto Mode, with the cloudfront-cognito wall and the managed CloudFront web ACL. The deployment took 40 minutes and destroy 50, of which 3 for the distribution and 7 for the VPC origin, both deleted before the Helm release as designed. The lookup found the ALB by name; Auto Mode honoured the name, the internal scheme and the prefix list together: one internal ALB, HTTP 80 only, whose security group admits only pl-75b1541c (CloudFront origin-facing) and which does not answer from outside. Through CloudFront, the editor redirected to the Cognito hosted page, a user signed in and reached the editor, /healthz and a webhook answered without the wall, and the webhook ran on the worker. /metrics answered 403 from the HideMetrics rule of the WAF. After destroy and cleanup nothing was left in eu-west-3 or us-east-1 (cluster, ALB, distribution, VPC origin, web ACL, edge function, user pool, roles), apart from the retained secret, the ACM validation record and the log group of the CloudFront prefix-list lookup, which the lookup's last run recreates at deletion. cleanup now deletes all three: the log group by its stack-name prefix, the record when the tool created the certificate, and the secret with --purge.

Ignored on EKS ​

finops.schedule: office-hours is not applied (C2). topology.workers.spot is an ECS capacity setting that the profiles turn on, so it is ignored without a finding.

Smoke test in queue mode ​

On Nov-29, the deployment n8n-eks1 ran in eu-west-3 in queue mode on Auto Mode, with chart 1.21.0. The deployment took 18 minutes for the n8n stack, and destroy 37 minutes for the three. The editor answered over HTTPS on one ALB, HTTP redirected to HTTPS and /metrics answered 404. A webhook workflow with a Code node ran on the worker, the code in the runner sidecar. KEDA read {n8n}:jobs:wait on ElastiCache Serverless over TLS. A burst of 120 webhook calls to a 30-second Wait put about 110 jobs in the list, and workers went from 1 to 3 in 20 seconds, then back to 1 once the list stayed empty for the 5 minutes of scale_in_minutes. Container Insights published the pod and node metrics of the dashboard. After destroy and cleanup, no cluster, ALB, target group, security group, network interface, volume or role was left. What remained is what the tool retains on purpose (encryption-key secret, ACM validation record) and the four /aws/containerinsights/<name>/ log groups. cleanup now deletes the log groups and the validation record, and cleanup --purge the secret. The test found four defects, fixed since:

  • the kubectl handler takes an OCI repository as the full chart reference, so it must not be split into repository and name (403 from ghcr.io);
  • chart 1.21 reads N8N_HOST, N8N_PORT and N8N_PROTOCOL from its core secret, so the synchronized secret adds them (CreateContainerConfigError otherwise);
  • the namespace must be deleted before KEDA and External Secrets, or it waits forever on their finalizers (ROLLBACK_FAILED);
  • Auto Mode ignores the group.name annotation: the group goes in IngressClassParams, or each Ingress gets an ALB of its own.

Teardown ​

destroy removes the Helm release first, and waits: the controller deletes the ALB, its security groups and its network interfaces before the cluster and the VPC go. The ALB controller, KEDA and External Secrets depend on nothing that outlives the release, so they go after it.