https://prefect.io logo
#prefect-ui
Title
# prefect-ui
f

fabian wolfmann

12/26/2022, 9:36 AM
Hi everyone, im trying to deploy orion on kubernetes, im having a CORS issue with the front, i can access the /docs url but when i try to see the prefect ui got CORS issue on the console of my browser. Dont know if this is the correct channel to post this question
some context prefect 2.7.0 db ephemeral run command: prefect orion start --host 0.0.0.0 --port 8080 running on centos 7 base image, installing from scratch set PREFECT_ORION_API_PORT 8080 and PREFECT_ORION_API_HOST 0.0.0.0
error
Cant connect to Orion API at <http://0.0.0.0:8080/api>
d

davzucky

12/26/2022, 12:34 PM
If you deploy that in kubernetes the PREFECT_ORION_API_HOST should be the ingress url. Did you setup the ingress and service in front of your deployment?
f

fabian wolfmann

12/26/2022, 3:24 PM
yes, i have a route and a load balancer service in front of my deployment
but the HOST is defined dynamically
it depends the cluster is deployed and the name of the container
d

davzucky

12/27/2022, 4:31 AM
What do you mean the host is defined dynamically? This is what kubernetes service is for. To remove that problem.
f

fabian wolfmann

12/27/2022, 9:22 AM
exactly, the host name is defined by kubernetes, so when i build my image i dont have that specif name, thats why im using 0.0.0.0 as the API HOST
also when i run prefect kubernets template, it create a k8s template with the command: prefect orion start --host 0.0.0.0
d

davzucky

12/27/2022, 10:49 AM
Yes host 0.0.0.0 is to allow the IP to be exposed on kubernetes. however the name you should put for the env var should be the public DNS name
f

fabian wolfmann

12/27/2022, 12:17 PM
ok got it thanks
And there is a way to define the env var with https? i changed and its going to http only
d

davzucky

12/27/2022, 3:25 PM
You could https termination on the ingress. This is what we are doing at the moment. Otherwise you could do that on the prefect Orion start by setting up manually the uvicorn Does it make sense?