# NOTE: This seems to work, but A records had to be added manually to 
# DNS zone.
# https://kubernetes.github.io/ingress-nginx/examples/auth/client-certs/
# https://kubernetes.github.io/ingress-nginx/examples/auth/oauth-external-auth/
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: airflow-ingress
  namespace: default
  # annotations:
  #   kubernetes.io/ingress.class: nginx
  #   nginx.ingress.kubernetes.io/ssl-redirect: "false"
  #   nginx.ingress.kubernetes.io/use-regex: "true"
  #   nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  ingressClassName: nginx # use only with k8s version >= 1.18.0
  # This secret must exist beforehand
  # The TLS secret must contain keys named tls.crt and tls.key 
  # that contain the certificate and private key to use for TLS.
  # The cert must also contain the subj-name host...
  # https://github.com/kubernetes/ingress-nginx/blob/master/docs/examples/PREREQUISITES.md#tls-certificates
  # tls:
  #   - hosts:
  #     - airflow.0cf33844e91741c88f93.eastus.aksapp.io
  #     secretName: airflow-tls-secret
  #   - hosts:
  #     - celery.0cf33844e91741c88f93.eastus.aksapp.io
  #     secretName: celery-tls-secret
  rules:
    - host: airflow.rikguz.com
      http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: airflow-web-service
              port: 
                number: 8080
    - host: celery.rikguz.com
      http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: airflow-web-service
              port:
                number: 5555
  defaultBackend:
      service:
        name: airflow-web-service
        port: 
          number: 8080    