请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

第一章 初始化master节点时 kubeadm init 命令执行不成功,报错如下,请指教。

wei@wei:~$ sudo -s
[sudo] wei 的密码:
root@wei:~# kubeadm init --apiserver-advertise-address=192.168.43.203 --pod-network-cidr=192.168.43.0/12
W0816 12:55:06.748704 28534 version.go:98] could not fetch a Kubernetes version from the internet: unable to get URL “https://dl.k8s.io/release/stable-1.txt”: Get https://dl.k8s.io/release/stable-1.txt: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
W0816 12:55:06.748890 28534 version.go:99] falling back to the local client version: v1.15.2
[init] Using Kubernetes version: v1.15.2
[preflight] Running pre-flight checks
[WARNING IsDockerSystemdCheck]: detected “cgroupfs” as the Docker cgroup driver. The recommended driver is “systemd”. Please follow the guide at https://kubernetes.io/docs/setup/cri/
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull’
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.15.2: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-controller-manager:v1.15.2: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-scheduler:v1.15.2: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-proxy:v1.15.2: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/pause:3.1: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/etcd:3.3.10: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/coredns:1.3.1: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...

正在回答

2回答

亲,从日志看,你的kubeadm似乎是高版本的。使用高版本kubeadm安装低版本k8s需要显式指定版本号:kubeadm init --kubernetes-version=v1.10.2 ... 祝学习愉快!

0 回复 有任何疑惑可以回复我~
  • 提问者 11820160 #1
    非常感谢!
    回复 有任何疑惑可以回复我~ 2019-08-18 10:33:05
提问者 11820160 2019-08-16 14:07:11

我已经按照k8s-in-action\chapter1\download-images.txt 中的命令拉取了docker images 并且 重新打了标签,执行kubeadm int 命令还是不行.


root@wei:~# docker images |grep k8s
k8s.gcr.io/kube-controller-manager-amd64   v1.10.2             f3fcd0775c4e        15 months ago       148MB
k8s.gcr.io/kube-proxy-amd64                v1.10.2             77019aa0531a        15 months ago       97.1MB
k8s.gcr.io/kube-apiserver-amd64            v1.10.2             e774f647e259        15 months ago       225MB
k8s.gcr.io/kube-scheduler-amd64            v1.10.2             0dcb3dea0db1        15 months ago       50.4MB
k8s.gcr.io/etcd-amd64                      3.1.12              52920ad46f5b        17 months ago       193MB
anjia0532/k8s-dns-dnsmasq-nanny-amd64      1.14.8              c2ce1ffb51ed        19 months ago       41MB
k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64     1.14.8              c2ce1ffb51ed        19 months ago       41MB
anjia0532/k8s-dns-sidecar-amd64            1.14.8              6f7f2dc7fab5        19 months ago       42.2MB
k8s.gcr.io/k8s-dns-sidecar-amd64           1.14.8              6f7f2dc7fab5        19 months ago       42.2MB
k8s.gcr.io/k8s-dns-kube-dns-amd64          1.14.8              80cc5ea4b547        19 months ago       50.5MB
anjia0532/k8s-dns-kube-dns-amd64           1.14.8              80cc5ea4b547        19 months ago       50.5MB
k8s.gcr.io/pause-amd64                     3.1                 da86e6ba6ca1        20 months ago       742kB
root@wei:~#


0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号