🚪 Cap 12: Ingress Controllers & Edge Gateways: Traefik, Kong API Gateway e Envoy Proxy
🗺️ O Ecossistema de Edge Gateways em Nuvem e Kubernetes
flowchart TD
subgraph INGRESS ["Porta de Entrada da Nuvem (Ingress / API Gateway)"]
direction TB
TR["Traefik (Auto-Discovery & Let's Encrypt Dinâmico) 🚀"]
KG["Kong Gateway (Plugins: OAuth2, Rate Limiting, OIDC) 🦍"]
EV["Envoy Proxy (High Performance C++ / Service Mesh Data Plane) ⚡"]
end
INTERNET["Internet Pública (HTTPS / gRPC / HTTP3)"] ==> INGRESS
INGRESS ==> K8S["Cluster Kubernetes (Pods & Services)"]
style INGRESS fill:#ede7f6,stroke:#512da8,stroke-width:2px
style TR fill:#00897b,stroke:#004d40,stroke-width:1.5px,color:#ffffff
style KG fill:#e1f5fe,stroke:#03a9f4,stroke-width:1.5px
style EV fill:#fff3e0,stroke:#ff9800,stroke-width:1.5px
style INTERNET fill:#e8f5e9,stroke:#4caf50,stroke-width:1.5px
style K8S fill:#f3e5f5,stroke:#9c27b0,stroke-width:1.5px
📖 Fundamentos e Aplicação
Na era de contêineres e arquiteturas nativas da nuvem (Cloud-Native), as configurações estáticas de servidores web deram lugar a Ingress Controllers e Gateways Dinâmicos capazes de autodescoberta de serviços em tempo real.
1. O Trio Moderno de Gateways:
- Traefik Proxy (em Go): Especialista em microsserviços e contêineres Docker/Kubernetes. Detecta novos contêineres subindo através de labels (
traefik.http.routers.app.rule=...) e emite certificados Let’s Encrypt automaticamente em memória sem reiniciar o daemon. - Kong Gateway (OpenResty / Lua / Go): O API Gateway corporativo mais popular do mercado. Baseado em um ecossistema massivo de plugins para autenticação JWT/OAuth2, limitação de taxa (Rate Limiting com Redis), monetização de APIs e transformação de payload.
- Envoy Proxy (em C++): Projetado pela Lyft e mantido pela CNCF. É a espinha dorsal de Service Meshes de alto desempenho (como Istio e Linkerd), com suporte nativo a gRPC, HTTP/3 e configuração dinâmica via xDS APIs.
2. Padrões de Ingress no Kubernetes:
O recurso nativo Ingress (e a moderna Gateway API) abstrai as regras de roteamento HTTP, delegando a execução técnica ao controlador instalado (Traefik, NGINX Ingress, Kong ou Envoy).