Kubernetes集群部署中安装Pods网络插件一直显示Pending状态解决

2022-06-22 15:33:40 浏览数 (1)

报错信息:

代码语言:javascript复制
[root@test2 ~]# kubectl get pods -n kube-system
NAME                            READY   STATUS    RESTARTS   AGE
coredns-78d4cf999f-ffgpb        0/1     Pending   0          121m
coredns-78d4cf999f-z5hxw        0/1     Pending   0          121m
etcd-test2                      1/1     Running   1          121m
kube-apiserver-test2            1/1     Running   1          121m
kube-controller-manager-test2   1/1     Running   1          121m
kube-proxy-m4j8z                1/1     Running   0          56m
kube-proxy-w44gf                1/1     Running   1          121m
kube-scheduler-test2            1/1     Running   1          121m

[root@test2 ~]# kubectl get nodes
NAME    STATUS     ROLES    AGE    VERSION
test2   NotReady   master   123m   v1.13.3

解决方法1:

1.使用国内云服务商提供的镜像源然后通过修改tag的方式

代码语言:javascript复制
docker pull quay-mirror.qiniu.com/coreos/flannel:v0.11.0-amd64

docker tag quay-mirror.qiniu.com/coreos/flannel:v0.11.0-amd64 quay.io/coreos/flannel:v0.10.0-amd64

docker rmi quay-mirror.qiniu.com/coreos/flannell:v0.11.0-amd64

完成后可以重启一下docker和kubelet,正常情况就都会running了。

解决方法2:

1.默认下载镜像地址在国外无法访问,先从准备好所需镜像

在开始部署kubernetes master之前先执行脚本下载好所需的镜像

代码语言:javascript复制
K8S_VERSION=v1.13.1         //修改成对应的版本
ETCD_VERSION=3.2.18
DASHBOARD_VERSION=v1.8.3
FLANNEL_VERSION=v0.10.0-amd64
DNS_VERSION=1.1.3
PAUSE_VERSION=3.1
# 基本组件
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver-amd64:$K8S_VERSION
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager-amd64:$K8S_VERSION
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler-amd64:$K8S_VERSION
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy-amd64:$K8S_VERSION
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd-amd64:$ETCD_VERSION
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:$PAUSE_VERSION
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:$DNS_VERSION
# 网络组件
docker pull quay.io/coreos/flannel:$FLANNEL_VERSION
# 修改tag
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver-amd64:$K8S_VERSION k8s.gcr.io/kube-apiserver-amd64:$K8S_VERSION
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager-amd64:$K8S_VERSION k8s.gcr.io/kube-controller-manager-amd64:$K8S_VERSION
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler-amd64:$K8S_VERSION k8s.gcr.io/kube-scheduler-amd64:$K8S_VERSION
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy-amd64:$K8S_VERSION k8s.gcr.io/kube-proxy-amd64:$K8S_VERSION
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/etcd-amd64:$ETCD_VERSION k8s.gcr.io/etcd-amd64:$ETCD_VERSION
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/pause:$PAUSE_VERSION k8s.gcr.io/pause:$PAUSE_VERSION
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:$DNS_VERSION k8s.gcr.io/coredns:$DNS_VERSION

0 人点赞