-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Don't use a default kube-context #4140
Comments
Thank you @shadiramadan. I understand your concern, however, skaffold behaves like kubectl or helm or basically any other tool in that domain. I don't think we want the users to have to always specify a kube-context |
There is also a related bug: if you have a namespace defined in your current context of kube-config, skaffold sync will fail for assets deployed not in this exact namespace. See #1668 (comment) These practically mean that (at least for me) skaffold needs to be wrapped around a script like this: #1668 (comment) Wrapping skaffold provides also a safety net for not accidentally running it against production. |
Would setting to deploy only in a valid context work? You can achieve this via profiles activation - https://skaffold.dev/docs/environment/profiles/#activation. We just set up all deployments inside the profiles section, which gets activated only when in a proper context ( |
Thanks for opening this! I also agree with @dgageot on this one. Never point your default to production, otherwise you will invariably mutate production accidentally. This goes not only for skaffold, but for any tool that interacts with a cluster. Someone will invariably shoot themselves in the foot with the defaults some day, but forcing a specific context would make skaffold more confusing for folks who don't know the context name of their local dev environment. |
No problem @tstromberg, @dgageot. I made this ticket out of me having a quick panic when I was about to run a skaffold command and thought to myself- how does it know which context to use? I ended up explicitly setting the I'm trialing skaffold as I want to drop docker-compose and have our team develop on k8s directly. I'm probably a ways away from trusting skaffold for deployments but developing on it is the first step :). |
From the documentation:
IMO this is very dangerous and is an accident waiting to happen.
All it would take is forgetting you switched to a production context to cause some very annoying problems for someone.
I think it should always be explicitly set by default.
The text was updated successfully, but these errors were encountered: