aula-04: NGINX Ingress com Keep Request (Lua)

Quando todos os pods estão indisponíveis, o Ingress mantém
a requisição por até 99s aguardando o backend voltar,
alcançando zero falhas visíveis ao usuário.
This commit is contained in:
Allyson de Paula
2025-12-25 13:38:46 -03:00
parent a479bf3696
commit 9e834de48d
6 changed files with 245 additions and 0 deletions

26
aula-04/ingress.yaml- Normal file
View File

@@ -0,0 +1,26 @@
# Middleware Retry - tenta outros pods quando um falha
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: retry-middleware
spec:
retry:
attempts: 5 # 5 tentativas
initialInterval: 500ms # 500ms entre ciclos
---
# IngressRoute
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: node-bugado
spec:
entryPoints:
- web
routes:
- match: PathPrefix(`/`)
kind: Rule
middlewares:
- name: retry-middleware
services:
- name: node-bugado
port: 3000