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

how to update the registry-mirror of a minikube instance? #6848

Closed
fffffreedom opened this issue Mar 1, 2020 · 6 comments
Closed

how to update the registry-mirror of a minikube instance? #6848

fffffreedom opened this issue Mar 1, 2020 · 6 comments
Labels
area/registry registry related issues kind/support Categorizes issue or PR as a support question.

Comments

@fffffreedom
Copy link

how to update the registry-mirror of a minikube instance?i find it unable to update it, thks

@starbassma
Copy link

starbassma commented Mar 2, 2020

Hello @fffffreedom ,
If you want to create a new instance with yourmirror you can use :

minikube start --registry-mirror="http://yourmirror"

if your VM instance is already created, you can't update registry-mirror through minikube cli, but you can modify it manually inside your VM (though not recommended) :

  1. Connect to the VM using root : minikube ssh su - root (password: root)

  2. Edit this file /usr/lib/systemd/system/docker.service using vi or editor to change the starting command :
    ExecStart=/usr/bin/dockerd -H tcp://0.0.0. ...... --registry-mirror http://newregistry

  3. save the changes, and then minikube stop and minikube start

Regards,

@tstromberg
Copy link
Contributor

It's worth noting that "minikube start" can be re-run safely against a VM that has been already created. It should update the configurations properly.

@tstromberg tstromberg added area/registry registry related issues kind/support Categorizes issue or PR as a support question. labels Mar 4, 2020
@starbassma
Copy link

@tstromberg "minikube start" doesn't update the registry-mirror of an existing vm.

@starbassma
Copy link

maybe we should enhance the documentation with the "non-updatable parameters"

@fffffreedom
Copy link
Author

@tstromberg @starbassma starbassma is right, "minikube start" doesn't update the registry-mirror of an existing vm. hoping this will work later, thks

@nobodyiam
Copy link

  1. Connect to the VM using root : minikube ssh su - root (password: root)
  2. Edit this file /usr/lib/systemd/system/docker.service using vi or editor to change the starting command :
    ExecStart=/usr/bin/dockerd -H tcp://0.0.0. ...... --registry-mirror http://newregistry
  3. save the changes, and then minikube stop and minikube start

This doesn't work for me, as the file /usr/lib/systemd/system/docker.service is restored after restart.

What did work me was to modify the config.json files under ~/.minikube and update the RegistryMirror field, e.g.

~/.minikube/machines/minikube/config.json

           "Labels": null,
           "LogLevel": "",
           "StorageDriver": "",
           "SelinuxEnabled": false,
           "TlsVerify": false,
           "RegistryMirror": [
              "http://newregistry"
            ],
           "InstallURL": ""

Hope it helps.

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

No branches or pull requests

4 participants