PersistentVolumeClaim is not bound问题分析&解决

概述

事情的起因是基于k8s集群搞东搞西搞项目时,使用脚本一键部署平台时突然僵住了,直接返回超时信息,通过各种手段对 shell 脚本进行debug,最终定位到是在使用yaml文件创建pod时一直卡在下面这步:PersistentVolumeClaim is not bond。
在这里插入图片描述

当然,这只是其中一条not boud的debug信息,整个部署中的和存储存储相关的组件,mysql、redis、mogodb和minio全都处于这种状态,查询相关pod,全都处于pending状态,等于压根没起来,查看pod的详细信息,得到如下Message:

在这里插入图片描述

对于k8s新手的我来说,无异于致命打击,pv和pvc是个啥都不知道。没关系!扶我起来!我还能学!

问题分析

每个人出现这个问题的原因不尽相同,最终的解决方案不具有普适性,但是了解整个过程有助于类似问题的思考,因此记录下整个思考过程。这个问题中有几个比较关键的词语,个人觉得有必要说明一下。每个概念名词都分为官方解释和个人理解。

PersistentVolume

官方解释:持久卷(PersistentVolume,PV)是集群中的一块存储,可以由管理员事先供应,或者使用存储类(Storage Class)来动态供应。 持久卷是集群资源,就像节点也是集群资源一样。

个人理解:其实说白了,卷就是用来存储k8s容器数据的一个抽象概念,但是一般容器绑定的都是临时卷,

ource Type VolumeSnapshot by Name new-snapshot-demo: snapshot new-snapshot-demo not bound I0714 08:37:27.829848 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"snapshot-demo-restore", UID:"8dd75b4b-9a16-4940-b078-7088a672a649", APIVersion:"v1", ResourceVersion:"2855605", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "evs-sc": error getting handle for DataSource Type VolumeSnapshot by Name new-snapshot-demo: snapshot new-snapshot-demo not bound I0714 08:38:13.719937 1 controller.go:1279] provision "default/snapshot-demo-restore" class "evs-sc": started I0714 08:38:13.720202 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"snapshot-demo-restore", UID:"8dd75b4b-9a16-4940-b078-7088a672a649", APIVersion:"v1", ResourceVersion:"2868531", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "default/snapshot-demo-restore" W0714 08:38:13.723506 1 controller.go:933] Retrying syncing claim "8dd75b4b-9a16-4940-b078-7088a672a649", failure 31 E0714 08:38:13.723534 1 controller.go:956] error syncing claim "8dd75b4b-9a16-4940-b078-7088a672a649": failed to provision volume with StorageClass "evs-sc": error getting handle for DataSource Type VolumeSnapshot by Name new-snapshot-demo: snapshot new-snapshot-demo not bound I0714 08:38:13.723562 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"snapshot-demo-restore", UID:"8dd75b4b-9a16-4940-b078-7088a672a649", APIVersion:"v1", ResourceVersion:"2868531", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "evs-sc": error getting handle for DataSource Type VolumeSnapshot by Name new-snapshot-demo: snapshot new-snapshot-demo not bound
07-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值