Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support targeting custom namespaces with ko #295

Closed
greghaynes opened this issue Oct 29, 2018 · 3 comments
Closed

Support targeting custom namespaces with ko #295

greghaynes opened this issue Oct 29, 2018 · 3 comments
Labels
good first issue Good for newcomers ko

Comments

@greghaynes
Copy link

As a developer on a project I may want to define the resources for that project in a namespace of my choosing. This may be because I have a restricted account which forces me to use a specific namespace. Currently, a project can only provide static namespace definitions and as such a user has no easy way to chose where namespace-scoped resources are defined.

@mattmoor mattmoor added good first issue Good for newcomers ko labels Oct 29, 2018
@mattmoor
Copy link
Collaborator

I believe what you want is the ability to pass-thru -nfoo to kubectl in ko apply?

@greghaynes
Copy link
Author

Ah good point - this seems a lot like #288 then.

@jonjohnsonjr
Copy link
Collaborator

FWIW my fix will only work if you haven't already specified a namespace in the target yaml. Apparently kubectl doesn't support overriding a namespace in that way, e.g.:

$ ko apply -f service.yaml -n foo
error: the namespace from the provided object "default" does not match the namespace "foo". You must pass '--namespace=default' to perform this operation.

So you'd either have to leave namespace blank or use something like kustomize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers ko
Projects
None yet
Development

No branches or pull requests

3 participants