7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

minikube startがエラーになる場合の対応方法

Last updated at Posted at 2019-01-07

Minikubeが起動しなくなることがあり、原因がよくわからず困っていたところ、(全てのケースには当てはまらないかもしれないが)対応方法があったのでメモ。

macOS Mojave 10.14.2
VirtualBox 6.0.0 r127566
Minikube 0.32.0

事象

以下のようなエラーで起動しない。

$ minikube start
Starting local Kubernetes v1.12.4 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Stopping extra container runtimes...
Starting cluster components...
E0107 22:10:31.468038   37835 start.go:343] Error starting cluster:  timed out waiting to elevate kube-system RBAC privileges: Temporary Error: creating clusterrolebinding: Post https://192.168.99.105:8443/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings?timeout=1m0s: dial tcp 192.168.99.105:8443: i/o timeout
Temporary Error: creating clusterrolebinding: Post https://192.168.99.105:8443/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings?timeout=1m0s: dial tcp 192.168.99.105:8443: i/o timeout
Temporary Error: creating clusterrolebinding: Post https://192.168.99.105:8443/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings?timeout=1m0s: dial tcp 192.168.99.105:8443: i/o timeout
Temporary Error: creating clusterrolebinding: Post https://192.168.99.105:8443/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings?timeout=1m0s: dial tcp 192.168.99.105:8443: i/o timeout
Temporary Error: creating clusterrolebinding: Post https://192.168.99.105:8443/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings?timeout=1m0s: dial tcp 192.168.99.105:8443: i/o timeout
Temporary Error: creating clusterrolebinding: Post https://192.168.99.105:8443/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings?timeout=1m0s: dial tcp 192.168.99.105:8443: i/o timeout
Temporary Error: creating clusterrolebinding: Post https://192.168.99.105:8443/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings?timeout=1m0s: dial tcp 192.168.99.105:8443: i/o timeout
creating clusterrolebinding: Post https://192.168.99.105:8443/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings?timeout=1m0s: dial tcp 192.168.99.105:8443: connect: connection refused
$

対応

rm -rf ~/.minikubeする。

minikube stop
minikube delete
rm -rf ~/.minikube

上記に加えて、VirtualBoxのメニューからファイル > ホストネットワークマネージャーを開き、192.168.99.1/24のネットワークインターフェース(下の例ではvboxnet2)を削除。

image.png

ネットワークインタフェース削除後にMinikubeを起動すると正常に起動した。削除したネットワークインターフェースはMinikube起動時に再作成される。

$ minikube start
Starting local Kubernetes v1.12.4 cluster...
Starting VM...
Downloading Minikube ISO
 178.88 MB / 178.88 MB [============================================] 100.00% 0s
Getting VM IP address...
Moving files into cluster...
Downloading kubeadm v1.12.4
Downloading kubelet v1.12.4
Finished Downloading kubeadm v1.12.4
Finished Downloading kubelet v1.12.4
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Stopping extra container runtimes...
Starting cluster components...
Verifying kubelet health ...
Verifying apiserver health ...Kubectl is now configured to use the cluster.
Loading cached images from config file.


Everything looks great. Please enjoy minikube!
$

追記

原因は192.168.99へのルーティング情報がなくなってしまっているためのよう。

$ netstat -rn | grep 192.168.99
$

VPNを切断し(重要)、192.168.99.1/24のインターフェース(以下ではvboxnet0)をdownしてupするだけでもよさそう。

sudo ifconfig vboxnet0 down
sudo ifconfig vboxnet0 up

ルーティングテーブルが復活している。

$ netstat -rn | grep 192.168.99
192.168.99         link#20            UC              2        0 vboxnet      !
192.168.99.115     8:0:27:c8:80:44    UHLWI           0       32 vboxnet   1087
$

参考リンク

7
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?