apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ${SERVICE_NAME}
  namespace: josh-apps
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/auth-type: basic
    # prevent the controller from redirecting (308) to HTTPS
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    # name of the secret that contains the user/password definitions
    # found here: https://kubernetes.github.io/ingress-nginx/examples/auth/basic/
    # kubectl -n namespace_here create secret generic mims-basic-auth --from-file=auth
    nginx.ingress.kubernetes.io/auth-secret: mims-basic-auth
    # message to display with an appropriate context why the authentication is required
    nginx.ingress.kubernetes.io/auth-realm: "Authentication Required"

    # some gifs may take minutes to process
    nginx.ingress.kubernetes.io/proxy-body-size: "50m"
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "120"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "120"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "120"
spec:
  rules:
    - host: ${HOST_URL}
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: ${SERVICE_NAME}
                port:
                  number: 8443
  tls:
    - hosts:
        - ${HOST_URL}
      secretName: ssl-bongo
