https://garden.io logo
#🌱|help-and-getting-started
Set namespace for container type of module
# 🌱|help-and-getting-started
b

best-flower-46100

12/20/2022, 10:29 AM
Hey, I'd like to have a single instance of a service (functioning as a reverse proxy) in a separated namespace. I know I can make that happen using k8s module type but then I'd have to give up on in-cluster building. Is there a way to enforce a namespace using container module type?
q

quaint-dress-831

12/21/2022, 8:57 AM
Hi @best-flower-46100 you can reference the container module from other modules like the k8s and helm modules. Does that help? https://docs.garden.io/guides/container-modules#referencing-from-other-modules
b

best-flower-46100

12/21/2022, 9:59 AM
can the dependency be disabled but still build when necessary for the k8s module?
q

quaint-dress-831

12/21/2022, 11:02 AM
All results are cached so there would be no need to disable the module if I'm understanding your use-case correctly
That's the big benefit of Garden. Because everything is mapped to a directed acyclic graph, any dependent thing (Task, Test, image build, etc.) is only re-run when changed
b

best-flower-46100

12/21/2022, 11:31 AM
yeah, sure 😄 i just wanted to disable the container module so that it doesn't deploy because it would double the functionality of the k8s module and more importantly deploy to undesirable namespaces. In short, I want to use the container module just to give me the image dynamically but deploy the image through k8s module only
q

quaint-dress-831

12/21/2022, 11:32 AM
Check out this bit of our docs where we discuss exactly your use-case but using the helm module 😊 https://docs.garden.io/guides/using-helm-charts#linking-container-modules-and-helm-modules
To recap: remove the service definition from your container module, link it to either a k8s or helm module and that should do the trick
Let me know if it works!
b

best-flower-46100

12/23/2022, 6:20 PM
It worked out great! Would be even better if the artifact registry service account secret was copied over from the default namespace to the one this runs in but I figured it out manually, the rest is beautiful, thanks a lot and happy holidays
q

quaint-dress-831

12/23/2022, 8:31 PM
I'm so glad! Happy holidays ❄️. Please do submit any feature requests you'd like to see in open source Garden on our GitHub 🐇