Kubeadm init停止在图像拖拉 [英] Kubeadm init stops at image pulling
问题描述
使用kubeadm
初始化母版时遇到一些麻烦.
I'm having some troubles with initializing the master using kubeadm
..
我正在尝试关注 https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/.我安装了docker
,kubelet
,kubeadm
和kubectl
.
I'm trying to follow https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ . I installed docker
, kubelet
, kubeadm
and kubectl
.
现在我执行了kubeadm init
,但是它停在了[init] This might take a minute or longer if the control plane images have to be pulled.
Now I executed kubeadm init
, but it stops at [init] This might take a minute or longer if the control plane images have to be pulled.
我调查了journalctl
,结果发现:Unable to update cni config: No networks found in /etc/cni/net.d
和Failed to list *v1.Pod: Get https://10.159.43.30:6443/api/v1/pods?fieldSelector=spec.nodeName%3Deskubernv01&limit=500&resourceVersion=0: dial tcp 10.159.43.30:6443: getsockopt: connection refused
.
I looked into journalctl
and there I found out that: Unable to update cni config: No networks found in /etc/cni/net.d
and Failed to list *v1.Pod: Get https://10.159.43.30:6443/api/v1/pods?fieldSelector=spec.nodeName%3Deskubernv01&limit=500&resourceVersion=0: dial tcp 10.159.43.30:6443: getsockopt: connection refused
.
我尝试使用kubectl apply -f https://git.io/weave-kube
设置编织网,但无法连接:The connection to the server localhost:8080 was refused - did you specify the right host or port?
.
I tried to set up weave-net with kubectl apply -f https://git.io/weave-kube
but it cannot connect: The connection to the server localhost:8080 was refused - did you specify the right host or port?
.
我无法复制admin.conf
文件,该文件应该允许我从/etc/kubernates
连接,因为kubeadm init
失败,因此这些文件都不正确.
I cannot copy admin.conf
file which should allow me to connect from /etc/kubernates
, because kubeadm init
failed so these are not proper files.
我觉得我在这里处于循环中,我在误解一些东西.
I feel like I'm in a loop here and I'm mising something.
我现在没有选择了.有什么想法吗?
I'm out of options right now. Any ideas?
推荐答案
我找到了出路.
如果有人遇到这样的问题,请检查docker日志.
If anyone has a problem like this - check docker logs.
在我的情况下,这是未为docker服务设置的代理. 要设置它,我使用了:
In my case it was proxy which was unset for docker service. To set it I used:
- 为docker服务创建一个systemd插入目录:
$ sudo mkdir -p /etc/systemd/system/docker.service.d
- 创建一个名为/etc/systemd/system/docker.service.d/http-proxy.conf的文件,该文件添加HTTP_PROXY环境变量:
[Service] Environment="HTTP_PROXY=http://proxy.example.com:80/"
- Create a systemd drop-in directory for the docker service:
$ sudo mkdir -p /etc/systemd/system/docker.service.d
- Create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:
[Service] Environment="HTTP_PROXY=http://proxy.example.com:80/"
来源: https://docs.docker.com/config/守护程序/systemd/#httphttps-proxy
这篇关于Kubeadm init停止在图像拖拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!