kubernetes/minikube

Changing MINIKUBE_HOME after VM creation does not work without cluster recreation

Open

#14,466 opened on Jun 29, 2022

View on GitHub
 (7 comments) (0 reactions) (0 assignees)Go (5,222 forks)batch import
help wantedkind/improvementpriority/backlog

Repository metrics

Stars
 (31,799 stars)
PR merge metrics
 (Avg merge 12d 19h) (43 merged PRs in 30d)

Description

What Happened?

Due to "enterprise reasons" we had to move ~/.minikube to ~/something_else/.minikube.

An ideal migration without cluster recreation would be:

  • minikube stop
  • mv ~/.minikube ~/something_else/.minikube
  • export MINIKUBE_HOME="${HOME}/something_else/.minikube"
  • minikube start

But what happens is changing MINIKUBE_HOME="${HOME}/something_else/.minikube" has no effect when cluster vm has already been created (log below).

This can be temporarily fixed with symlink ln -s ~/something_else/.minikube ~/.minikube.

The catch is that we a have an extensive locally scripted setup shared between dozen of developers. "It would be nice" if MINIKUBE_HOME was not set in stone in such a way that the cluster would not have to be recreated if MINIKUBE_HOME was changed and the files were moved externally from Minikube.

This would minimize the pain of "how to migrate to a newer local setup" in such a scenario where a locally scripted minikube setup is essential to a group of people.

❯ minikube version
minikube version: v1.25.2
commit: 362d5fdc0a3dbee389b3d3f1034e8023e72bd3a7

Attach the log file

* Restarting existing docker container for "design-time" ...
! StartHost failed, but will try again: provision: Error getting config for native Go SSH: open /Users/pre/.minikube/machines/design-time/id_rsa: no such file or directory
* Updating the running docker "design-time" container ...
* Failed to start docker container. Running "minikube delete -p design-time" may fix it: provision: Error getting config for native Go SSH: open /Users/pre/.minikube/machines/design-time/id_rsa: no such file or directory

X Exiting due to GUEST_SSH_CERT_NOT_FOUND: Failed to start host: provision: Error getting config for native Go SSH: open /Users/pre/.minikube/machines/design-time/id_rsa: no such file or directory
* Suggestion: minikube is missing files relating to your guest environment. This can be fixed by running 'minikube delete'
* Related issue: https://github.com/kubernetes/minikube/issues/9130

Operating System

macOS (Default)

Driver

Docker

Contributor guide