Target deployment namespace should be specifiable in skaffold.yaml, e.g. deploy:kubectl:namespace.
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.
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).
@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.
Most helpful comment
Sorry, a CLI argument is not a solution as I described in the summary.
skaffold.yamlis 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_NAMESPACEallow overriding that setting.Can you please reopen, considering this use case? I'm even eager to implement that – shouldn't be too hard.