Skip to content

FR/crazy idea: delete context when minikube is stopped #9410

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

Closed
tstromberg opened this issue Oct 7, 2020 · 10 comments · Fixed by #9414
Closed

FR/crazy idea: delete context when minikube is stopped #9410

tstromberg opened this issue Oct 7, 2020 · 10 comments · Fixed by #9414
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@tstromberg
Copy link
Contributor

The context isn't useful if minikube is stopped, and can mislead folks into talking to a stopped cluster. What if, instead of unselecting it as a default, we just deleted it.

@priyawadhwa priyawadhwa added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 7, 2020
@prezha
Copy link
Contributor

prezha commented Oct 7, 2020

not so crazy ;) .kube/config gets filled back in with the cluster data on subsequent minikube start - when it can actually be used again

@prezha
Copy link
Contributor

prezha commented Oct 7, 2020

/assign

@tstromberg
Copy link
Contributor Author

Thank you @prezha !

@medyagh
Copy link
Member

medyagh commented Oct 7, 2020

@tstromberg this could break the IDE users. per this request, #9001

@prezha please make sure, this does NOT delete the context if the user has specified
"minikube stop --keep-context-active=true"

@prezha
Copy link
Contributor

prezha commented Oct 7, 2020

@medyagh yes, the same logic still applies: if keep-context-active is set to true, it will not touch the context

@jorgemoralespou
Copy link

This is not nice. Now, as the context is deleted and recreated, a user needs to select a specific namespace he's working on every time he starts/stops the cluster.

@prezha
Copy link
Contributor

prezha commented Oct 15, 2020

@jorgemoralespou you can use --keep-context-active=true option to keep the context on minikube stop?

@jorgemoralespou
Copy link

I was expecting that answer. Why would I want to keep the context active if the instance is stopped. When stopped what does make sense is unset, and only delete the context when minikube instance is deleted, hence, previous behavior.

@prezha
Copy link
Contributor

prezha commented Oct 15, 2020

i don't think the issue is with deleting/recreating the context when minikube stops/starts, what we potentially could do is additionally saving/restoring also the default namespace using the minikube's cluster/kubernetes config

@jorgemoralespou
Copy link

Yes, you could save/restore the namespace. But IMHO the fact that a namespace is deleted is more confusing than the fact that minikube is stopped and you have a context you can't connect to until you start minikube.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants