k8s中flannel:镜像下载不了
重新部署一套K8S集群时,由于K8S需要扁平化的网络,所以当执行下面的
root@master ~]# kubectl apply -f kube-flannel.yml
会开始下载镜像,然后去启动,结果等了几分钟,一直没有好
[root@k8s-master ~]# kubectl get pod -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-58cc8c89f4-9gn5g 0/1 Pending 0 27m
coredns-58cc8c89f4-xxzx7 0/1 Pending 0 27m
etcd-k8s-master 1/1 Running 1 26m
kube-apiserver-k8s-master 1/1 Running 1 26m
kube-controller-manager-k8s-master 1/1 Running 1 26m
kube-flannel-ds-amd64-2dqlf 0/1 Init:ImagePullBackOff 0 11m
kube-proxy-rn98b 1/1 Running 1 27m
kube-scheduler-k8s-master 1/1 Running 1 26m
[root@k8s-master ~]# kubectl get pod -n kube-system
去查询pod
[root@k8s-master ~]# kubectl describe pod kube-flannel-ds-amd64-2dqlf -n kube-system
Name: kube-flannel-ds-amd64-2dqlf
Namespace: kube-system
Priority: 0
Node: k8s-master/192.168.180.130
Start Time: Thu, 19 Dec 2019 22:36:13 +0800
Labels: app=flannel
controller-revision-hash=67f65bfbc7
pod-template-generation=1
tier=node
Annotations: <none>
Status: Pending
IP: 192.168.180.130
IPs:
IP: 192.168.180.130
Controlled By: DaemonSet/kube-flannel-ds-amd64
Init Containers:
install-cni:
Container ID:
Image: quay.io/coreos/flannel:v0.11.0-amd64
Image ID:
Port: <none>
Host Port: <none>
Command:
cp
Args:
-f
/etc/kube-flannel/cni-conf.json
/etc/cni/net.d/10-flannel.conflist
State: Waiting
Reason: ImagePullBackOff
Ready: False
Restart Count: 0
Environment: <none>
Mounts:
/etc/cni/net.d from cni (rw)
/etc/kube-flannel/ from flannel-cfg (rw)
/var/run/secrets/kubernetes.io/serviceaccount from flannel-token-r52cd (ro)
Containers:
kube-flannel:
Container ID:
Image: quay.io/coreos/flannel:v0.11.0-amd64
Image ID:
Port: <none>
Host Port: <none>
Command:
/opt/bin/flanneld
Args:
--ip-masq
--kube-subnet-mgr
State: Waiting
Reason: PodInitializing
Ready: False
Restart Count: 0
Limits:
cpu: 100m
memory: 50Mi
Requests:
cpu: 100m
memory: 50Mi
Environment:
POD_NAME: kube-flannel-ds-amd64-2dqlf (v1:metadata.name)
POD_NAMESPACE: kube-system (v1:metadata.namespace)
Mounts:
/etc/kube-flannel/ from flannel-cfg (rw)
/run/flannel from run (rw)
/var/run/secrets/kubernetes.io/serviceaccount from flannel-token-r52cd (ro)
Conditions:
Type Status
Initialized False
Ready False
ContainersReady False
PodScheduled True
Volumes:
run:
Type: HostPath (bare host directory volume)
Path: /run/flannel
HostPathType:
cni:
Type: HostPath (bare host directory volume)
Path: /etc/cni/net.d
HostPathType:
flannel-cfg:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: kube-flannel-cfg
Optional: false
flannel-token-r52cd:
Type: Secret (a volume populated by a Secret)
SecretName: flannel-token-r52cd
Optional: false
QoS Class: Burstable
Node-Selectors: <none>
Tolerations: :NoSchedule
node.kubernetes.io/disk-pressure:NoSchedule
node.kubernetes.io/memory-pressure:NoSchedule
node.kubernetes.io/network-unavailable:NoSchedule
node.kubernetes.io/not-ready:NoExecute
node.kubernetes.io/pid-pressure:NoSchedule
node.kubernetes.io/unreachable:NoExecute
node.kubernetes.io/unschedulable:NoSchedule
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled <unknown> default-scheduler Successfully assigned kube-system/kube-flannel-ds-amd64-2dqlf to k8s-master
Warning Failed 5m29s kubelet, k8s-master Failed to pull image "quay.io/coreos/flannel:v0.11.0-amd64": rpc error: code = Unknown desc = context canceled
Warning Failed 4m21s (x2 over 5m2s) kubelet, k8s-master Failed to pull image "quay.io/coreos/flannel:v0.11.0-amd64": rpc error: code = Unknown desc = Error response from daemon: Get https://quay.io/v2/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
Normal Pulling 3m31s (x4 over 7m5s) kubelet, k8s-master Pulling image "quay.io/coreos/flannel:v0.11.0-amd64"
Warning Failed 3m18s (x4 over 5m29s) kubelet, k8s-master Error: ErrImagePull
Warning Failed 3m18s kubelet, k8s-master Failed to pull image "quay.io/coreos/flannel:v0.11.0-amd64": rpc error: code = Unknown desc = Error response from daemon: Get https://quay.io/v2/coreos/flannel/manifests/v0.11.0-amd64: Get https://quay.io/v2/auth?scope=repository%3Acoreos%2Fflannel%3Apull&service=quay.io: net/http: TLS handshake timeout
Normal BackOff 3m5s (x6 over 5m29s) kubelet, k8s-master Back-off pulling image "quay.io/coreos/flannel:v0.11.0-amd64"
Warning Failed 2m2s (x11 over 5m29s) kubelet, k8s-master Error: ImagePullBackOff
发现时镜像拉取失败的原因,有可能时网络原因导致的,之前都没有遇到过
kube-flannel-ds-amd64-2dqlf 0/1 Init:ImagePullBackOff 0 11m
这个状态,应该时yaml中,有一个InitC,初始化的容器,便去查看一番
所以只能把别的集群中的镜像导出一份,在导入
[root@k8s-master mnt]# docker load -i flannel.tar
7bff100f35cb: Loading layer [==================================================>] 4.672MB/4.672MB
5d3f68f6da8f: Loading layer [==================================================>] 9.526MB/9.526MB
9b48060f404d: Loading layer [==================================================>] 5.912MB/5.912MB
3f3a4ce2b719: Loading layer [==================================================>] 35.25MB/35.25MB
9ce0bb155166: Loading layer [==================================================>] 5.12kB/5.12kB
Loaded image: quay.io/coreos/flannel:v0.11.0-amd64
[root@k8s-master mnt]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
registry.aliyuncs.com/google_containers/kube-apiserver v1.16.0 b305571ca60a 3 months ago 217MB
registry.aliyuncs.com/google_containers/kube-proxy v1.16.0 c21b0c7400f9 3 months ago 86.1MB
registry.aliyuncs.com/google_containers/kube-controller-manager v1.16.0 06a629a7e51c 3 months ago 163MB
registry.aliyuncs.com/google_containers/kube-scheduler v1.16.0 301ddc62b80b 3 months ago 87.3MB
registry.aliyuncs.com/google_containers/etcd 3.3.15-0 b2756210eeab 3 months ago 247MB
registry.aliyuncs.com/google_containers/coredns 1.6.2 bf261d157914 4 months ago 44.1MB
quay.io/coreos/flannel v0.11.0-amd64 ff281650a721 10 months ago 52.6MB
registry.aliyuncs.com/google_containers/pause 3.1 da86e6ba6ca1 24 months ago 742kB
[root@k8s-master mnt]# cd
[root@k8s-master ~]# kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-master Ready master 54m v1.16.1
k8s-node01 NotReady <none> 15m v1.16.1
k8s-node02 Ready <none> 17m v1.16.1
[root@k8s-master ~]# kubectl get pod -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-58cc8c89f4-9gn5g 1/1 Running 0 54m
coredns-58cc8c89f4-xxzx7 1/1 Running 0 54m
etcd-k8s-master 1/1 Running 1 53m
kube-apiserver-k8s-master 1/1 Running 1 53m
kube-controller-manager-k8s-master 1/1 Running 2 53m
kube-flannel-ds-amd64-4bc88 1/1 Running 0 17m
kube-flannel-ds-amd64-lzwd6 1/1 Running 0 19m
kube-flannel-ds-amd64-vw4vn 1/1 Running 0 15m
kube-proxy-bs8sd 1/1 Running 1 15m
kube-proxy-nfvtt 1/1 Running 0 17m
kube-proxy-rn98b 1/1 Running 1 54m
kube-scheduler-k8s-master 1/1 Running 1 53m
[root@k8s-master ~]# kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-master Ready master 54m v1.16.1
k8s-node01 Ready <none> 15m v1.16.1
k8s-node02 Ready <none> 17m v1.16.1
稍等一会,就可以了。由于百度云连接经常失效,有需要镜像的,可以和我联系
k8s中flannel:镜像下载不了的更多相关文章
- 使用kubeadm安装kubernetes/部署前准备/flannel网络插件/镜像下载/
本文内容参考<kuberneters进阶实战>/马哥的新书/推荐 部署前的准备 主机名称解析 分布式系统环境中的多主机通信通常基于主机名称进行,这在IP地址存在变化的可能性时为主机提供了固 ...
- [转帖]k8s.gcr.io镜像无法下载的问题
k8s.gcr.io镜像无法下载的问题 https://blog.51cto.com/liuzhengwei521/2301497 看了下 赵安家老师应该是青岛人 在济南顺能网络科技有限公司上班 铭盛 ...
- k8s.gcr.io、gcr.io仓库的镜像下载
镜像下载.域名解析.时间同步请点击 阿里巴巴开源镜像站 获取这类镜像的方法一般有2种: 1.通过拉取国内镜像仓库的内容(操作简单直接拉取即可,缺点是镜像的版本更新可能较慢,可能无法获取最新的镜像) 2 ...
- 新版的K8S中的flannel.yaml文件中要注意的细节
部署flannel作为k8s中的网络插件,yaml文件都大小同异. 但在要注意以下细节. 以前,只需要前面master判断. 现在也需要有not-ready状态了. tolerations: - ke ...
- 转 docker创建私有仓库和k8s中使用私有镜像
docker私有仓库建立 环境说明我们选取192.168.5.2做私有仓库地址yum install docker -y1.启动docker仓库端口服务 docker run -d -p 5000:5 ...
- 【解决】k8s 1.15.2 镜像下载方案
k8s 国内镜像下载方案 众所周知,国内是不太容易下载k8s.gcr.io站点的镜像的 一.第一种方案:Azure中国镜像站 http://mirror.azure.cn/help/gcr-proxy ...
- 如何在K8S中优雅的使用私有镜像库 (Docker版)
前言 在企业落地 K8S 的过程中,私有镜像库 (专用镜像库) 必不可少,特别是在 Docker Hub 开始对免费用户限流之后, 越发的体现了搭建私有镜像库的重要性. 私有镜像库不但可以加速镜像的拉 ...
- eclipse javaEE版下载过程中选择镜像(Select Another Mirror)无反应解决办法,附带eclipse javaEE版下载教程。
1.eclipse javaEE版下载过程中选择镜像(Select Another Mirror)无反应 (复制该网址下载即可 https://mirrors.neusoft.edu.cn/eclip ...
- 入门 - k8s滚动更新部署中的镜像版本 (七)
目标 使用 kubectl 执行 Rolling Update(滚动更新) 更新应用程序 用户期望应用程序始终可用,为此开发者/运维者在更新应用程序时要分多次完成.在 Kubernetes 中,这是通 ...
随机推荐
- Postgresql 监控sql之 pg_stat_statements模块
postgresql.confpg_stat_statements.max = 1000000pg_stat_statements.track = allpg_stat_statements.trac ...
- Luogu P3520 [POI2011]SMI-Garbage
题目 把要变边权的边拿出来找欧拉回路就行了.正确性显然,因为一条边经过两次相当于对欧拉回路度数的奇偶性没有影响. 然后把一个个小环输出即可,具体的我也不知道怎么输,题目没讲清楚,我按着题解的来的. # ...
- 数据库索引 B+树
问题1.数据库为什么要设计索引?索引类似书本目录,用于提升数据库查找速度.问题2.哈希(hash)比树(tree)更快,索引结构为什么要设计成树型?加快查找速度的数据结构,常见的有两类:(1)哈希,例 ...
- Robot Framework(一)安装笔记
参考网址:https://www.cnblogs.com/yinrw/p/5837828.html因为自己安装了py,网上教程都是统一安装py2.7开始的. 所以这里总结下安装笔记:cmd命令界面进行 ...
- java中的异常和处理详细理解
异常是程序中的一些错误,但并不是所有的错误都是异常,并且错误有时候是可以避免的. 比如说,你的代码少了一个分号,那么运行出来结果是提示是错误 java.lang.Error:如果你用System.ou ...
- java 关于数字取小数点后两位出现整数0没有的问题
最近再项目中对取到的一系列带很长小数的数字,展现时要求去小数点后两位显示就可以了 开始我是以下写法: double a = 0.1234455; DecimalFormat decimalForm ...
- 07 Python中zip(),map(),filter(),reduce()用法
一. zip() zip() 函数用于将可迭代的对象作为参数,将对象中对应的元素打包成一个个元组,然后返回由这些元组组成的列表. 如果各个迭代器的元素个数不一致,则返回列表长度与最短的对象相同,利用 ...
- React前端有钱途吗?《React+Redux前端开发实战》学起来
再不学React就真的跟不上大前端的形式了,目前几乎所有前端的招聘条件都是精通React者优先,看看拉勾网的React薪资,都是15K-20K,这个暑假,必须动起来了. 如果你熟悉JavaScript ...
- 给定一个字符串,根据字符出现频率排序--Java实现
题目描述: 给定一个字符串,请将字符串里的字符按照出现的频率降序排列. 示例 1: 输入:"tree" 输出:"eert" 解释:'e'出现两次,'r'和't' ...
- Linux分布式消息队列RocketMQ部署与监控--双Master
环境准备:CentOS_6.5_x64 IP: 192.168.0.249 dbTest249 Master1 IP: 192.168.0.251 webTest251 Master2 下载 ali ...