PrefectHQ / server

The Prefect API and backend
Other
232 stars 94 forks source link

No connection to Apollo/GraphQL #325

Closed JustinGuese closed 2 years ago

JustinGuese commented 2 years ago

Description

I used the helm template to deploy prefect server to our Kubernetes cluster. Ingress does not happen via LoadBalancer, but ClusterIP & Ingress routing to our domain (SSL set up). I can open the GraphQL domain without any problems (in my browser), but the prefect UI is not able to use it.

Expected Behavior

It should connnect

Reproduction

See helm template below

Environment

K8s v1.21.3 Current helm templat prefect-ETL-deployment.zip e

JustinGuese commented 2 years ago

I guess this happens because the ingress routes it to domain.com/graphql over port 80 instead of 4200?

bribroder commented 2 years ago

This issue was helpful to me in debugging a related issue with no connection between Apollo and GraphQL: since Ingresses only support ports 80 and 443, in order to connect on port 4200 I had to configure my Apollo service as a LoadBalancer and disable the ingress. Then, the ports were correct, but the AWS classic load balancer's protocol was set to TCP. Since my UI service was configured with an HTTPS ingress, I had to not only change the LoadBalancer's backend protcol to HTTP but add a certificate so the UI could connect in a browser, which forbids making HTTP connections on an HTTPS site. I created a certificate for my domain and added some annotations to the service, which got everything working:

apollo:
  service:
    type: LoadBalancer
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
    service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-west-2:1234567890:certificate/asdf-1234-hjkl-5678-qwer-9012
  ingress:
    enabled: false