Hello, I am new to Kubernetes and trying to test i...
# deployment-kubernetes
f
Hello, I am new to Kubernetes and trying to test it out. I am not certain how exactly to phrase this ... Are there any examples or documentation on how to use/configure my yaml files via Kubernetes? (I am assuming I shouldnt be building the yamls into my docker image)
c
Hey Felipe! I recently went through this exact process — I found this guide from Dagster very useful: Deploying on Kubernetes. As for the yaml files, I copied Dagster’s values.yaml in my repo and replaced it with my own values. At this point, if your Kubernetes cluster is set up, it’ll just be a matter of running the
helm
commands outlined in the Dagster guide.
f
Hey Charles thanks for the quick reply. I have the example working and even slightly modified the example using my own docker image. Now, I am moving to a more realistic POC. I am referring to yaml such as those in PresetDefinition (sorry I wasnt more clear). How do I override and provide those values? Is that only through the Dagit UI?
r
Hey Felipe, if you want to override those preset definition values, you would need to build user code deployment with the modified `PresetDefinition`’s.
Currently, the definitions are located here, and we create an image (
dagster/user-code-example
from the helm chart) from this directory. https://github.com/dagster-io/dagster/blob/master/examples/deploy_k8s/example_project/example_repo/repo.py
f
ok does this mean that I would build a seperate docker image (with a specific preset yaml copied to that image) for each variation I want? Or is it possible to build a more "generic" single docker image and use helm/values.yaml to pass the variations by creating separate UserDeployments?
r
Or is it possible to build a more “generic” single docker image and use helm/values.yaml to pass the variations
Currently this is not possible - all the user code should be specified within the image beforehand. We don’t inject any python code into the image from the helm chart
what’s your use case for having one preset per docker image?
f
ok good to know so I dont try to go down that path 😅
I am just trying to wrap my head around how this works. I suppose my underlying question is ... how do I test a pipeline against different environments when using kubernetes?
hmmm maybe something like this: Say my preset yaml points to database cluster 1 and I know another dev is making massive schema changes to it. So now I need to point to database cluster 3.
r
In your use case, you would probably need to abstract out the database cluster (
database_cluster_1
, …
database_cluster_n
) as a
resource
in your pipeline. Then, you could have different modes that reference the cluster you would want to use.
f
Ok I believe my answer is: include all needed yaml in my docker image. And all my environments needed through resources+modes+presets. Then fire off my pipeline specifying a given mode.
1
Awesome ... thanks for hearing me out @rex