---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: goldilocks-dashboard
  namespace: goldilocks
  annotations:
    #traefik.ingress.kubernetes.io/router.entrypoints: "websecure"
    nginx.ingress.kubernetes.io/auth-url: "http://authelia.security.svc.cluster.local/api/verify"
    nginx.ingress.kubernetes.io/auth-signin: "https://login.${SECRET_DOMAIN}"
  labels:
    app.kubernetes.io/instance: goldilocks-dashboard
    app.kubernetes.io/name: goldilocks-dashboard
spec:
  ingressClassName: "nginx"
  rules:
    - host: "goldilocks.${SECRET_DOMAIN}"
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: goldilocks-dashboard
                port:
                  name: http
  tls:
    - secretName: "${SECRET_DOMAIN//./-}-tls"
    - hosts:
        - "goldilocks.${SECRET_DOMAIN}"
