为什么Kuberenetes kubeadm init命令无法从存储库k8s.gcr.io中提取图像

时间:2018-07-18 05:48:12

标签: kubernetes kubeadm

我有2个运行本地设置的kubernetes主节点和从节点的vms。到现在为止一切正常,但是当我尝试使用kubeadm init命令启动主服务器时,突然出现了错误。

shayeeb@ubuntu:~$ sudo kubeadm init
[init] using Kubernetes version: v1.11.1
[preflight] running pre-flight checks
I0718 11:04:57.038464   20370 kernel_validator.go:81] Validating kernel version
I0718 11:04:57.038896   20370 kernel_validator.go:96] Validating kernel config
[preflight/images] Pulling images required for setting up a Kubernetes cluster
[preflight/images] This might take a minute or two, depending on the speed of your internet connection
[preflight/images] You can also perform this action in beforehand using 'kubeadm config images pull'
[preflight] Some fatal errors occurred:
[ERROR ImagePull]: failed to pull image [k8s.gcr.io/kube-apiserver-amd64:v1.11.1]: exit status 1
[ERROR ImagePull]: failed to pull image [k8s.gcr.io/kube-controller-manager-amd64:v1.11.1]: exit status 1
[ERROR ImagePull]: failed to pull image [k8s.gcr.io/kube-scheduler-amd64:v1.11.1]: exit status 1
[ERROR ImagePull]: failed to pull image [k8s.gcr.io/kube-proxy-amd64:v1.11.1]: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`

4 个答案:

答案 0 :(得分:3)

您也可以运行以下命令,而不用编写yaml,

kubeadm init --kubernetes-version=1.11.0 --apiserver-advertise-address=<public_ip> --apiserver-cert-extra-sans=<private_ip>

如果您使用的是法兰绒网络,请按以下命令运行

kubeadm init --kubernetes-version=1.11.0 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=<public_ip> --apiserver-cert-extra-sans=<internal_ip> 

答案 1 :(得分:2)

最新版本(v1.11.1)未发布。您可以尝试指定类似的版本

kubeadm config images pull --kubernetes-version=v1.11.0

答案 2 :(得分:2)

图片似乎已被删除:

https://console.cloud.google.com/gcr/images/google-containers/GLOBAL/kube-apiserver-arm64?gcrImageListsize=50&gcrImageListquery=%255B%257B_22k_22_3A_22_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22v1.11_5C_22_22%257D%255D

要解决此问题,请提取最新的可用图像并忽略飞行前错误

kubeadm config images pull --kubernetes-version=v1.11.0
kubeadm init [args] --ignore-preflight-errors=all

答案 3 :(得分:1)

请尝试以下方法:

例如,您可以创建config.yaml文件

cat config.yaml
    apiVersion: kubeadm.k8s.io/v1alpha1
    kind: MasterConfiguration
    api:
      advertiseAddress: 10.44.70.201
    networking:
      podSubnet: 192.168.0.0/16
    kubernetesVersion: 1.11.0

并运行kubeadm init --config = kubeadm-config.yaml