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<

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:&quot;PersistentVolumeClaim&quot;, Namespace:&quot;default&quot;, Name:&quot;snapshot-demo-restore&quot;, UID:&quot;8dd75b4b-9a16-4940-b078-7088a672a649&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;2855605&quot;, FieldPath:&quot;&quot;}): type: &#39;Warning&#39; reason: &#39;ProvisioningFailed&#39; failed to provision volume with StorageClass &quot;evs-sc&quot;: 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 &quot;default/snapshot-demo-restore&quot; class &quot;evs-sc&quot;: started I0714 08:38:13.720202 1 event.go:282] Event(v1.ObjectReference{Kind:&quot;PersistentVolumeClaim&quot;, Namespace:&quot;default&quot;, Name:&quot;snapshot-demo-restore&quot;, UID:&quot;8dd75b4b-9a16-4940-b078-7088a672a649&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;2868531&quot;, FieldPath:&quot;&quot;}): type: &#39;Normal&#39; reason: &#39;Provisioning&#39; External provisioner is provisioning volume for claim &quot;default/snapshot-demo-restore&quot; W0714 08:38:13.723506 1 controller.go:933] Retrying syncing claim &quot;8dd75b4b-9a16-4940-b078-7088a672a649&quot;, failure 31 E0714 08:38:13.723534 1 controller.go:956] error syncing claim &quot;8dd75b4b-9a16-4940-b078-7088a672a649&quot;: failed to provision volume with StorageClass &quot;evs-sc&quot;: 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:&quot;PersistentVolumeClaim&quot;, Namespace:&quot;default&quot;, Name:&quot;snapshot-demo-restore&quot;, UID:&quot;8dd75b4b-9a16-4940-b078-7088a672a649&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;2868531&quot;, FieldPath:&quot;&quot;}): type: &#39;Warning&#39; reason: &#39;ProvisioningFailed&#39; failed to provision volume with StorageClass &quot;evs-sc&quot;: 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、付费专栏及课程。

余额充值