第一章 初始化master节点时 kubeadm init 命令执行不成功,报错如下,请指教。
来源:1-5 下载Kubeadm,node组件和命令行工具
11820160
2019-08-16
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 ... 祝学习愉快!
012019-08-18 -
11820160
提问者
2019-08-16
我已经按照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:~#
00
相似问题