Skip to content

kubectl deployer defaultNamespace is determined based on current context. #9784

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

Open
yoonsio opened this issue Apr 8, 2025 · 1 comment
Open

Comments

@yoonsio
Copy link

yoonsio commented Apr 8, 2025

The kubectl deployer's defaultNamespace is determined by the current context's namespace. This behavior only allows applying raw YAML Kubernetes resources with multiple namespaces if the current context’s namespace is set to default.

This is unexpected behavior, as the current context's namespace should not affect deploying Kubernetes resources across multiple namespaces. The namespace of the resources should be independent of the current context’s namespace.

Relevant code: https://github.com/GoogleContainerTools/skaffold/blame/b212650a1f0f179aca19b7829332904fe1cb284c/pkg/skaffold/deploy/kubectl/kubectl.go#L93

@demisx
Copy link
Contributor

demisx commented May 24, 2025

Not sure if it is related, but the latest v2.16.0 does not respect --kube-context switch at all and always try to deploy to the current context. For example, my current context is docker-desktop, but I want to deploy to orbstack with:

skaffold dev -p firehose-listener -f skaffold.yaml -v debug --kube-context=orbstack

However, all resources are still deployed to docker-desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants