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

Minikube (re)start on docker driver breaks docker-env #6824

Closed
balopat opened this issue Feb 27, 2020 · 6 comments · Fixed by #6885
Closed

Minikube (re)start on docker driver breaks docker-env #6824

balopat opened this issue Feb 27, 2020 · 6 comments · Fixed by #6885
Assignees
Labels
co/docker-driver Issues related to kubernetes in container kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@balopat
Copy link
Contributor

balopat commented Feb 27, 2020

 minikube start -p docker3 --container-runtime docker --vm-driver=docker 

Restarting caused some issue with the IP (minikube docker-env command) that was working before - this is a skaffold log output:

'docker load' command failed with error: error during connect: Post https://127.0.0.1:32772/v1.40/images/load?quiet=1: EOF
minikube version                                                                                                                     6.7s  Thu Feb 27 10:59:00 2020
minikube version: v1.7.3
commit: 436667c819c324e35d7e839f8116b968a2d0a3ff

Originally posted by @balopat in #6820 (comment)

@balopat balopat added the co/docker-driver Issues related to kubernetes in container label Feb 27, 2020
@josedonizetti josedonizetti self-assigned this Mar 2, 2020
@medyagh medyagh added this to the v1.8.0 March 5 milestone Mar 2, 2020
@medyagh medyagh added kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Mar 2, 2020
@josedonizetti
Copy link
Member

josedonizetti commented Mar 4, 2020

The bugs happens because kic is using random ports when exposing internal ports to localhost. When a container is restarted it might get the same port or not (likely to not).

https://github.com/kubernetes/minikube/blob/master/pkg/drivers/kic/oci/oci.go#L407

To fix this we need to control which port is exposed by passing it to the run command. But this can have side effects, imagine we start kic with the port 32011, and then the container is stopped, and some other service is started on the user computer that is not related to minikube and this service is using the port 32011, if the user now tries to restart the container we have a conflict, which to be avoid will required another port, creating the same bug again.

One can also run docker-env again every time the container is restarted.

@medyagh thoughts?

@medyagh
Copy link
Member

medyagh commented Mar 4, 2020

Regarding that issue I was thinking. Minikube status should have a new line that tells you if you are using the docker env inside minikube or not . And if it needs updating it should also tell you.

@medyagh
Copy link
Member

medyagh commented Mar 4, 2020

Another almost related is we could add something to the bash prompt (if user selects to)
That tells you your terminal is using docker inside minikube

@medyagh
Copy link
Member

medyagh commented Mar 4, 2020

Additionally on restart, we should detect user is using docker env and re-new docker env for them or warn them to do so

@medyagh medyagh assigned medyagh and unassigned josedonizetti Mar 4, 2020
@medyagh
Copy link
Member

medyagh commented Mar 4, 2020

I will work on this.

@medyagh
Copy link
Member

medyagh commented Mar 4, 2020

I also noticed on a terminal with docker-env
we warn this incorrectly

⚠️  'docker' driver reported an issue: exit status 1
💡  Suggestion: Docker is not running or is responding too slow. Try: restarting docker desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-driver Issues related to kubernetes in container kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants