You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When trying to use the template for a project that would run in Kubernetes, there were many things that didn't work.
The Dockerfile for production does not provide a CMD which is expected for the container to run, either provide this or provide documentation for creating the helm chart to provide the command to run. Ideally we could do both, where if a command is not provided it runs the fastapi app and otherwise runs taskiq workers etc.
To make the template generic we have used the variable PROJ_NAME wherever possible, this has worked while we have used docker compose to run production workloads where it can find the environment variable but not much when it's running in a Kubernetes managed environment. This is particularly an issue with the Dockerfile itself where it references PROJ_NAME in the uvicorn command
Should we use gunicorn at all? Follow this discussion on FastAPI discussion.
The Dockerfile has a section where we run as the project User this results in:
INFO: Started server process [1]
INFO: Waiting for application startup.
INFO: Application startup complete.
ERROR: [Errno 13] error while attempting to bind on address ('0.0.0.0', 80): permission denied
INFO: Waiting for application shutdown.
INFO: Application shutdown complete.
Describe the solution you'd like
Either provide a programmatic solution to the above or extended documentation that allows developers to quickly use this template in production in Kubernetes.
Describe alternatives you've considered
NA
Additional context
All relevant to the Kubernetes deployment
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
When trying to use the template for a project that would run in Kubernetes, there were many things that didn't work.
Dockerfile
for production does not provide aCMD
which is expected for the container to run, either provide this or provide documentation for creating thehelm
chart to provide thecommand
to run. Ideally we could do both, where if acommand
is not provided it runs thefastapi
app and otherwise runstaskiq
workers etc.PROJ_NAME
wherever possible, this has worked while we have useddocker compose
to run production workloads where it can find the environment variable but not much when it's running in a Kubernetes managed environment. This is particularly an issue with theDockerfile
itself where it referencesPROJ_NAME
in theuvicorn
commandgunicorn
at all? Follow this discussion on FastAPI discussion.The
Dockerfile
has a section where we run as the projectUser
this results in:See bind() to 0.0.0.0:80 failed(13: Permission denied where they suggest to run the command as root
Describe the solution you'd like
Either provide a programmatic solution to the above or extended documentation that allows developers to quickly use this template in production in Kubernetes.
Describe alternatives you've considered
NA
Additional context
All relevant to the Kubernetes deployment
The text was updated successfully, but these errors were encountered: