apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: vanna-clubpetro
  labels:
    app: vanna-clubpetro
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    # SSE/WebSocket precisam de timeout grande pra streaming não ser cortado
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-buffering: "off"
    nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
spec:
  ingressClassName: nginx
  rules:
    - host: lab.clubpetro.com
      http:
        paths:
          - path: /api/vanna(/|$)(.*)
            pathType: Prefix
            backend:
              service:
                name: vanna-clubpetro
                port:
                  number: 80
  tls:
    - hosts:
        - lab.clubpetro.com
      secretName: lab-tls
