Skaffold: Add namespace configuration option for kubectl/kustomize

Created on 5 Nov 2019  Â·  6Comments  Â·  Source: GoogleContainerTools/skaffold

Expected behavior

Target deployment namespace should be specifiable in skaffold.yaml, e.g. deploy:kubectl:namespace.

Actual behavior

The helm deployer supports deploying to a certain namespace as specified in skaffold.yaml, but for kubectl/kustomize deployers, that can only be achieved with the environment variable SKAFFOLD_NAMESPACE or -n/--namespace CLI option.

Information

  • Skaffold version: v0.41.0

This is helpful if the namespace depends on the environment, e.g. dev/prod using a different namespace, but the values are still fixed and should therefore not require any special env var or CLI parameter to run a deployment correctly.

Probably somewhat relevant for #915 (similar use case).

aredeploy kinfeature-request prioritp3

Most helpful comment

Sorry, a CLI argument is not a solution as I described in the summary. skaffold.yaml is supposed to be the central source of truth, while CLI args and environment variables serve as _overrides_. Therefore, one needs to be able to specify the default target namespace in that config file, while -n/--namespace/SKAFFOLD_NAMESPACE allow overriding that setting.

Can you please reopen, considering this use case? I'm even eager to implement that – shouldn't be too hard.

All 6 comments

@AndiDog there is a --namespace flag for --deploy

Sorry, a CLI argument is not a solution as I described in the summary. skaffold.yaml is supposed to be the central source of truth, while CLI args and environment variables serve as _overrides_. Therefore, one needs to be able to specify the default target namespace in that config file, while -n/--namespace/SKAFFOLD_NAMESPACE allow overriding that setting.

Can you please reopen, considering this use case? I'm even eager to implement that – shouldn't be too hard.

I'm open for adding this, and thank you @AndiDog for volunteering to implement it :)

As an update: I've looked into this, but still have to find some more time to see how it can be done – right now, most code uses the run context namespace, and that would need to be overridden/changed by configuration. Any hints welcome.

@AndiDog - Is this still being worked on? Let us know if there is anything in particular we can help with.

I made a start on it, but didn't get it finished yet. Too busy, and was also waiting on another PR. Hopefully I can progress here soon.

Was this page helpful?
0 / 5 - 0 ratings