garden icon indicating copy to clipboard operation
garden copied to clipboard

[FEATURE]: some way to override default namespace

Open jalper opened this issue 3 years ago • 3 comments

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 .dev to every garden command.

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 🙂

jalper avatar Feb 04 '22 00:02 jalper

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.

eysi09 avatar Feb 08 '22 11:02 eysi09

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!

stale[bot] avatar Jun 12 '22 14:06 stale[bot]

Still would like a way to do this.

jalper avatar Sep 02 '22 22:09 jalper

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!

stale[bot] avatar Jan 07 '23 22:01 stale[bot]

@jalper you can use varfiles to accomplish this. See the comment above about the project config. Closing this.

vvagaytsev avatar Jul 06 '23 11:07 vvagaytsev