Linux

minikube - 啟動集群時出錯:kubeadm init 錯誤

  • October 6, 2018

我的環境:

$ cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core) 
$ uname -a
Linux X.X.X 3.10.0-862.11.6.el7.x86_64 #1 SMP Tue Aug 14 21:49:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ 

我按照安裝(Linux)然後嘗試啟動它並收到以下錯誤:

$ minikube start
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Downloading Minikube ISO
171.87 MB / 171.87 MB [============================================] 100.00% 0s
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
E0928 17:48:15.499373   15471 start.go:297] Error starting cluster:  kubeadm init error 
sudo /usr/bin/kubeadm init --config /var/lib/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests --ignore-preflight-errors=DirAvailable--data-minikube --ignore-preflight-errors=Port-10250 --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-etcd.yaml --ignore-preflight-errors=Swap --ignore-preflight-errors=CRI  &&
sudo /usr/bin/kubeadm alpha phase addon kube-dns
running command: : running command: 
sudo /usr/bin/kubeadm init --config /var/lib/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests --ignore-preflight-errors=DirAvailable--data-minikube --ignore-preflight-errors=Port-10250 --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-etcd.yaml --ignore-preflight-errors=Swap --ignore-preflight-errors=CRI  &&
sudo /usr/bin/kubeadm alpha phase addon kube-dns

.: Process exited with status 1
$ echo $?
1
$ 

我不知道出了什麼問題…

請指教。


更新:

$ systemctl status docker
● docker.service - Docker Application Container Engine
  Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
  Active: active (running) since Mon 2018-10-01 15:21:47 UTC; 30min ago
    Docs: https://docs.docker.com
Main PID: 2398 (dockerd)
   Tasks: 18
  CGroup: /system.slice/docker.service
          ├─2398 /usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=virtualbox --insecure-registry 10.96.0.0/12
          └─2404 docker-containerd --config /var/run/docker/containerd/containerd.toml

Oct 01 15:52:11 minikube dockerd[2398]: time="2018-10-01T15:52:11.104494559Z" level=error msg="Handler for POST /v1.31/images/create returned error: Get https://k8s.gcr.io/v2/: x509: certificate signed by unknown authority"
Oct 01 15:52:12 minikube dockerd[2398]: time="2018-10-01T15:52:12.089350373Z" level=warning msg="Error getting v2 registry: Get https://k8s.gcr.io/v2/: x509: certificate signed by unknown authority"
Oct 01 15:52:12 minikube dockerd[2398]: time="2018-10-01T15:52:12.089498980Z" level=info msg="Attempting next endpoint for pull after error: Get https://k8s.gcr.io/v2/: x509: certificate signed by unknown authority"
Oct 01 15:52:12 minikube dockerd[2398]: time="2018-10-01T15:52:12.089700729Z" level=error msg="Handler for POST /v1.31/images/create returned error: Get https://k8s.gcr.io/v2/: x509: certificate signed by unknown authority"
Oct 01 15:52:18 minikube dockerd[2398]: time="2018-10-01T15:52:18.115306207Z" level=warning msg="Error getting v2 registry: Get https://k8s.gcr.io/v2/: x509: certificate signed by unknown authority"
Oct 01 15:52:18 minikube dockerd[2398]: time="2018-10-01T15:52:18.115350638Z" level=info msg="Attempting next endpoint for pull after error: Get https://k8s.gcr.io/v2/: x509: certificate signed by unknown authority"
Oct 01 15:52:18 minikube dockerd[2398]: time="2018-10-01T15:52:18.115368128Z" level=error msg="Handler for POST /v1.31/images/create returned error: Get https://k8s.gcr.io/v2/: x509: certificate signed by unknown authority"
Oct 01 15:52:18 minikube dockerd[2398]: time="2018-10-01T15:52:18.119017016Z" level=warning msg="Error getting v2 registry: Get https://k8s.gcr.io/v2/: x509: certificate signed by unknown authority"
Oct 01 15:52:18 minikube dockerd[2398]: time="2018-10-01T15:52:18.119062497Z" level=info msg="Attempting next endpoint for pull after error: Get https://k8s.gcr.io/v2/: x509: certificate signed by unknown authority"
Oct 01 15:52:18 minikube dockerd[2398]: time="2018-10-01T15:52:18.119077766Z" level=error msg="Handler for POST /v1.31/images/create returned error: Get https://k8s.gcr.io/v2/: x509: certificate signed by unknown authority"
$ 

有沒有辦法以某種方式忽略?

看起來 Docker 無法從中提取 Kubernetes 映像k8s.gcr.io

我會將它添加到 minikube VM 內的 docker 服務中

--insecure-registry k8s.gcr.io

我很驚訝正確的 CA 證書和 docker 配置在 minikube VM 上不起作用。

引用自:https://serverfault.com/questions/933180