apiVersion: networking.k8s.io/v1 
kind: Ingress
metadata:
  name: openfaas
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
  ingressClassName: nginx
  tls:
  - hosts:
    - OPENFAAS_API_URL
    secretName: api-tls
  rules:
  - host: OPENFAAS_API_URL
    http:
      paths:
      - path: /system/functions
        pathType: Exact
        backend:
          service:
            name: gateway
            port:
              number: 8080
      # ~mdc specifically allow public-facing functions (/function/.* wildcard for all)
      - path: /function/notify
        pathType: Exact
        backend:
          service:
            name: gateway
            port:
              number: 8080
      - path: /function/simulate
        pathType: Exact
        backend:
          service:
            name: gateway
            port:
              number: 8080
