我正在尝试建立一个基本的k8s集群
在执行kubeadm init - pods =10.244.0.0/16后,代码荚被卡在ContainerCreating状态中。
NAME READY STATUS RESTARTS AGE
coredns-6955765f44-2cnhj 0/1 ContainerCreating 0 43h
coredns-6955765f44-dnphb 0/1 ContainerCreating 0 43h
etcd-perf1 1/1 Running 0 43h
kube-apiserver-perf1 1/1 Running 0 43h
kube-controller-manager-perf1 1/1 Running 0 43h
kube-flannel-ds-amd64-smpbk 1/1 Running 0 43h
kube-proxy-6zgvn 1/1 Running 0 43h
kube-scheduler-perf1 1/1 Running 0 43h
操作系统-映像: Ubuntu 16.04.6 LTS内核-版本:4.4.0-142-通用容器-运行时: docker://19.3.5
日志from -xeu kubelet命令中的错误
Jan 02 10:31:44 perf1 kubelet[11901]: 2020-01-02 10:31:44.112 [INFO][10207] k8s.go 228: Using Calico IPAM
Jan 02 10:31:44 perf1 kubelet[11901]: E0102 10:31:44.118281 11901 cni.go:385] Error deleting kube-system_coredns-6955765f44-2cnhj/12cd9435dc905c026bbdb4a1954fc36c82ede1d703b040a3052ab3370445abbf from
Jan 02 10:31:44 perf1 kubelet[11901]: E0102 10:31:44.118828 11901 remote_runtime.go:128] StopPodSandbox "12cd9435dc905c026bbdb4a1954fc36c82ede1d703b040a3052ab3370445abbf" from runtime service failed:
Jan 02 10:31:44 perf1 kubelet[11901]: E0102 10:31:44.118872 11901 kuberuntime_manager.go:898] Failed to stop sandbox {"docker" "12cd9435dc905c026bbdb4a1954fc36c82ede1d703b040a3052ab3370445abbf"}
Jan 02 10:31:44 perf1 kubelet[11901]: E0102 10:31:44.118917 11901 kuberuntime_manager.go:676] killPodWithSyncResult failed: failed to "KillPodSandbox" for "e44bc42f-0b8d-40ad-82a9-334a1b1c8e40" with
Jan 02 10:31:44 perf1 kubelet[11901]: E0102 10:31:44.118939 11901 pod_workers.go:191] Error syncing pod e44bc42f-0b8d-40ad-82a9-334a1b1c8e40 ("coredns-6955765f44-2cnhj_kube-system(e44bc42f-0b8d-40ad-
Jan 02 10:31:47 perf1 kubelet[11901]: W0102 10:31:47.081709 11901 cni.go:331] CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container "747c3cc9455a7d
Jan 02 10:31:47 perf1 kubelet[11901]: 2020-01-02 10:31:47.113 [INFO][10267] k8s.go 228: Using Calico IPAM
Jan 02 10:31:47 perf1 kubelet[11901]: E0102 10:31:47.118526 11901 cni.go:385] Error deleting kube-system_coredns-6955765f44-dnphb/747c3cc9455a7db202ab14576d15509d8ef6967c6349e9acbeff2207914d3d53 from
Jan 02 10:31:47 perf1 kubelet[11901]: E0102 10:31:47.119017 11901 remote_runtime.go:128] StopPodSandbox "747c3cc9455a7db202ab14576d15509d8ef6967c6349e9acbeff2207914d3d53" from runtime service failed:
Jan 02 10:31:47 perf1 kubelet[11901]: E0102 10:31:47.119052 11901 kuberuntime_manager.go:898] Failed to stop sandbox {"docker" "747c3cc9455a7db202ab14576d15509d8ef6967c6349e9acbeff2207914d3d53"}
Jan 02 10:31:47 perf1 kubelet[11901]: E0102 10:31:47.119098 11901 kuberuntime_manager.go:676] killPodWithSyncResult failed: failed to "KillPodSandbox" for "52ffb25e-06c7-4cc6-be70-540049a6be20" with
Jan 02 10:31:47 perf1 kubelet[11901]: E0102 10:31:47.119119 11901 pod_workers.go:191] Error syncing pod 52ffb25e-06c7-4cc6-be70-540049a6be20 ("coredns-6955765f44-dnphb_kube-system(52ffb25e-06c7-4cc6-
我也尝试过kubdeadm重置,但到目前为止没有运气。
发布于 2020-01-02 06:08:39
看来问题是因为我试着从棉布转到法兰绒cni。按照这里提到的步骤,我已经解决了这个问题。
此外,您可能必须清除/etc/cni/net.d
的内容。
发布于 2020-01-02 05:40:11
CoreDNS不会在已安装CNI网络之前启动。
要使法兰绒正确工作,必须将-pod=10.244.0.0/16传递给kubeadm init。通过运行sysctl net.Bridge.bridge-nf=1,将/proc/sys/net/bridge/bridge-nf-call-iptables
设置为1,以将桥接的IPv4流量传递给iptables‘s链。这是一些CNI插件的工作要求。确保防火墙规则允许所有参与覆盖网络的主机的UDP端口8285和8472通信量。看这里。请注意,法兰绒在Linux下工作在amd64、arm、arm64、ppc64le和s390x上。Windows (amd64)在v0.11.0中声称是受支持的,但是这种使用是没有文档的。
将法兰绒部署为CNI网络
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml
在部署法兰绒删除核心dns吊舱后,Kubernetes将重新创建吊舱。
发布于 2020-01-02 06:06:28
您已经部署了法兰绒作为CNI,但是kubelet的日志显示kubernetes使用的是棉布。
[INFO][10207] k8s.go 228: Using Calico IPAM
集装箱网络有问题。没有那个核心就不会成功。您可能需要重新安装正确的CNI。一旦CNI成功部署,coreDNS就会自动部署。
https://stackoverflow.com/questions/59558611
复制相似问题