garden
garden copied to clipboard
[FEATURE]: some way to override default namespace
Feature Request
Background / Motivation
Currently in our garden setup, developers' namespaces are defined in the project config using their local username. Sometimes a dev wants to spin up a second environment in a different namespace, or maybe they want to override a clunky local username with something simpler, and to do that they would need to append --env
What should the user be able to do? + Suggested Implementation(s)
Some sort of .env file for garden, or even just some garden environment variables that can be used to override this and potentially other things, would be great.
How important is this feature for you/your team?
🌹 It’s a nice to have, but nice things are nice 🙂
Hi @jalper
We don't expose the namespace as an environment variable at the moment (you can see what we expose here: https://github.com/garden-io/garden/blob/master/core/src/constants.ts#L52).
But would this workaround do the trick:
kind: Project
name: demo-project
environments:
- name: dev
defaultNamespace: "${local.env.NAMESPACE || var.defaultNamespace}"
providers:
- name: kubernetes
# ...
variables:
defaultNamespace: my-project-${local.username}
That being said, we've meant to add support for user level settings for a quite a while now but we've never properly prioritised it. Would be very useful though.
This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!
Still would like a way to do this.
This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!
@jalper you can use varfiles to accomplish this. See the comment above about the project config. Closing this.