Files
workshop/aula-06
ArgoCD Setup 0267d93cf6 fix(aula-06): aumentar recursos do webhook para evitar CrashLoopBackOff
O n8n webhook precisa de mais memória para iniciar corretamente.
Com 256Mi, a liveness probe mata o container antes dele subir.

- Aumentar memory limit de 256Mi para 512Mi
- Aumentar cpu limit de 250m para 500m
- Aumentar requests proporcionalmente
2026-01-23 14:39:43 -03:00
..

Aula 06 - n8n via Helm (Ambiente LOCAL)

Deploy do n8n workflow automation em cluster Kubernetes local usando Helm.

Arquitetura

┌───────────────────────────────────────────────────────────┐
│                    Cluster Local                          │
│  (OrbStack/k3s/Docker Desktop / minikube / kind / k3d)    │
│                                                           │
│  ┌─────────────────────────────────────────────────────┐  │
│  │                 NGINX Ingress                       │  │
│  │              http://n8n.localhost                   │  │
│  └────────────────────────┬────────────────────────────┘  │
│                           │                               │
│  ┌────────────────────────┼────────────────────────────┐  │
│  │               Namespace: n8n                        │  │
│  │                         │                           │  │
│  │    ┌────────────────────┼────────────────────┐      │  │
│  │    │                    ▼                    │      │  │
│  │    │              ┌──────────┐               │      │  │
│  │    │              │   Main   │               │      │  │
│  │    │              │  (n8n)   │               │      │  │
│  │    │              └────┬─────┘               │      │  │
│  │    │                   │                     │      │  │
│  │    │     ┌─────────────┼─────────────┐       │      │  │
│  │    │     ▼             ▼             ▼       │      │  │
│  │    │ ┌───────┐   ┌──────────┐   ┌────────┐   │      │  │
│  │    │ │Workers│   │ Webhooks │   │  MCP   │   │      │  │
│  │    │ │ (2-5) │   │  (1-3)   │   │Webhook │   │      │  │
│  │    │ └───────┘   └──────────┘   └────────┘   │      │  │
│  │    │                                         │      │  │
│  │    │              Queue Mode                 │      │  │
│  │    └─────────────────────────────────────────┘      │  │
│  │                         │                           │  │
│  │         ┌───────────────┼───────────────┐           │  │
│  │         ▼                               ▼           │  │
│  │    ┌──────────┐                   ┌──────────┐      │  │
│  │    │PostgreSQL│                   │  Redis   │      │  │
│  │    │  (1Gi)   │                   │  (1Gi)   │      │  │
│  │    └──────────┘                   └──────────┘      │  │
│  └─────────────────────────────────────────────────────┘  │
└───────────────────────────────────────────────────────────┘

Pré-requisitos

  • Cluster Kubernetes local:
    • Docker Desktop com Kubernetes habilitado
    • minikube (minikube start)
    • kind (kind create cluster)
    • k3d (k3d cluster create)
  • kubectl configurado
  • Helm 3.x instalado

Instalação

cd aula-06
chmod +x setup.sh
./setup.sh

O script instala automaticamente:

  1. NGINX Ingress Controller
  2. n8n com todos os componentes

Acesso

URL: http://n8n.localhost

Se n8n.localhost não resolver, adicione ao /etc/hosts:

127.0.0.1 n8n.localhost

Componentes

Componente Réplicas Recursos
Main (n8n) 1 256Mi-1Gi RAM
Workers 2-5 (HPA) 256Mi-512Mi RAM
Webhooks 1-3 (HPA) 128Mi-256Mi RAM
PostgreSQL 1 1Gi volume
Redis 1 1Gi volume

Comandos Úteis

# Ver pods
kubectl get pods -n n8n

# Ver logs do n8n
kubectl logs -f -n n8n deployment/n8n

# Ver autoscaling
kubectl get hpa -n n8n

# Desinstalar
helm uninstall n8n -n n8n
kubectl delete ns n8n

Para Cluster Hetzner Cloud

Se você quer fazer deploy em um cluster Hetzner Cloud com volumes persistentes e LoadBalancer, veja a aula-09.