Prefect on Kubernetes with nginx Ingress /prefect
To answer my own question of how to run Prefect with nginx on Kubernetes (behind a /prefect ingress)
here’s the recipe:
Copy code
git clone git@github.com:PrefectHQ/prefect.git
cd prefect
git checkout 2.10.6
# edit Dockerfile to set `PREFECT_UI_SERVE_BASE=/prefect`
docker build --arg PYTHON_VERSION=3.10 -t prefect:base2.10.6-python3.10 -f Dockerfile .
Then you need to inherit from this image for building the Prefect agent:
Copy code
FROM prefect:base2.10.6-python3.10
RUN pip install -r requirements.txt
...
@justabill I think the Prefect dev team should probably introduce Docker arguments such that it is easier
to achieve that without hacking the base image.
I can elaborate more here or in DM.
j
justabill
05/08/2023, 10:13 PM
Thanks for sharing the recipe. We've been thinking through the custom Docker image story recently. I'll make sure that the right team sees this.
o
Ofir
05/08/2023, 10:21 PM
Sure no problem, thanks for forwarding this and I’m glad to help.
Ofir
05/08/2023, 10:23 PM
@justabill for reference, other products allow you to configure the prefix or base url through env vars.
If you look at Metabase, for example, they provide MB_SITE_URL that end users of the product can configure.
Ofir
05/08/2023, 10:24 PM
This allows me as a vendor to easily customize the deployment of my 3rd party services through environment variables instead of having to rebase my changes on top of Prefect upstream and keep up with the latest versions.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.