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:
26
aula-04/ingress.yaml-
Normal file
26
aula-04/ingress.yaml-
Normal 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
|
||||
Reference in New Issue
Block a user