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