apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: flytesystem
  namespace: flyte
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/tags: service_instance=production
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'

    # Instruct ALB Controller to not create multiple load balancers (and hence maintain a single endpoint for both GRPC and Http)
    alb.ingress.kubernetes.io/group.name: flytesystem

    # Replace certificate Arn with one deployed to your EKS cluster. Follow instructions in README.md
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:111111111111:certificate/e92fefd8-6197-4249-a524-431d611c9af6
  labels:
    app: flyteadmin
spec:
  rules:
    - http:
        paths:
          - path: /*
            pathType: ImplementationSpecific
            backend:
              service:
                name: ssl-redirect
                port:
                  name: use-annotation
          - path: /console
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteconsole
                port:
                  number: 80
          - path: /console/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteconsole
                port:
                  number: 80
          - path: /api/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /healthcheck
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /v1/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          # Port 87 in FlyteAdmin maps to the redoc container.
          - path: /openapi/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 87
          - path: /.well-known/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /login
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /login/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /logout
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /logout/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /callback
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /callback/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /me
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /config
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /config/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /oauth2
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
          - path: /oauth2/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: flyteadmin
                port:
                  number: 80
