minikube-启动集群时出错:kubeadm init 错误

minikube-启动集群时出错:kubeadm init 错误

我的环境:

$ 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"
$ 

有没有办法可以忽略?

答案1

看起来 Docker 无法从k8s.gcr.io

我会将其添加到 minikube VM 内的 docker 服务中

--insecure-registry k8s.gcr.io

我很惊讶正确的 CA 证书和 docker 配置在 minikube VM 上不起作用。

相关内容