---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: webhook-receiver
  namespace: flux-system
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: "websecure"
    cert-manager.io/cluster-issuer: "letsencrypt-${POD_CERT_ENV}"
    external-dns/is-public: "true"
    external-dns.alpha.kubernetes.io/target: "ipv4.${SECRET_DOMAIN}"
spec:
  ingressClassName: "traefik"
  rules:
    - host: "flux-webhook.${SECRET_DOMAIN}"
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: webhook-receiver
                port:
                  number: 80
  tls:
    - hosts:
        - "flux-webhook.${SECRET_DOMAIN}"
      secretName: flux-webhook-tls
