-
Hi, I'd like to run Tethys on Kubernetes. In order to do this, I need to pass the LoadBalancer IP to the Django ALLOWED_HOSTS variable. It looks like this could be done in I was told other people are already running Tethys on k8s, so I'm wondering how they're currently achieving this. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 7 replies
-
@swainn do you have any advice here? I don't understand the details of running Tethys on Kubernetes well enough to understand why this is needed. If we need to add something to |
Beta Was this translation helpful? Give feedback.
-
Hi, yes, we are using k8s for our deployments at Aquaveo. I've asked @romer8 to comment. |
Beta Was this translation helpful? Give feedback.
-
Hi @gronka, If the IP of the LoadBalancer needs to be added to the ALLOWED_HOSTS variable in the portal config this can also be done by creating a salt state file that sets the ALLOWED_HOSTS in the portal config through a env variable (using the tethys settings --set command). The run.sh will run all the salt state files that are in the top.sls file (you might need to create a new custom top.sls file that includes this new salt state file that sets the ALLOWED_HOSTS). Finally, you can build the docker image from the Dockerfile and use it in the k8 pod that will have tethys running. The k8 pod definition should let you specify the image and the env variables. I have a couple of questions:
Documentation about salt files: https://docs.tethysplatform.org/en/stable/installation/production/docker/salt_state.html |
Beta Was this translation helpful? Give feedback.
-
In my UBI Tethys Docker repo I add a variable Also, this approach would still require you to generate a new docker image. I think you are trying to test k8s with the original docker image, right? |
Beta Was this translation helpful? Give feedback.
-
@gronka if that is the case, that you want to use the original Tethys image without creating one. I think creating a job.yaml that runs the tethys settings command to set up the |
Beta Was this translation helpful? Give feedback.
-
The solution to the ALLOWED_HOSTS question is here: #1018 (comment) Next, I think I should convert the HEALTHCHECK in the Dockerfile to a Kubernetes liveness probe. @romer8 Have you done this? It would save me some time if you have. If not, I can share what I come up with. |
Beta Was this translation helpful? Give feedback.
-
For posterity, I've been running tethys with the following config. The image used here is 1 year old - my testing has worked with an image I've built myself from the main branch. I haven't tested this exact config - just gathering something to post. Thanks for everyone's help. There is an issue where supervisord fails to start nginx, so I'll have to SSH into the tethys pod to manually start tethys. I hope this is due to not using a domain name.
|
Beta Was this translation helpful? Give feedback.
For posterity, I've been running tethys with the following config. The image used here is 1 year old - my testing has worked with an image I've built myself from the main branch.
I haven't tested this exact config - just gathering something to post.
Thanks for everyone's help.
There is an issue where supervisord fails to start nginx, so I'll have to SSH into the tethys pod to manually start tethys. I hope this is due to not using a domain name.