[英]Kubernetes - All PVCs Bound, yet "pod has unbound immediate PersistentVolumeClaims"
Unfortunately I am unable to paste configs or kubectl
output, but please bear with me.不幸的是,我无法粘贴配置或
kubectl
output,但请多多包涵。
Using helm to deploy a series of containers to K8s 1.14.6, all containers are deploying successfully except for those that have initContainer
sections defined within them.使用 helm 将一系列容器部署到
initContainer
1.14.6,所有容器都部署成功,除了那些在其中定义了 initContainer 部分的容器。
In these failing deployments, their templates define container
and initContainer
stanzas that reference the same persistent-volume
(and associated persistent-volume-claim
, both defined elsewhere).在这些失败的部署中,它们的模板定义了
container
和initContainer
节,它们引用了相同的persistent-volume
(以及相关persistent-volume-claim
,两者都在别处定义)。
The purpose of the initContainer
is to copy persisted files from a mounted drive location into the appropriate place before the main container
is established. initContainer
的目的是在建立主container
之前将持久文件从已安装的驱动器位置复制到适当的位置。
Other containers (without initContainer
stanzas) mount properly and run as expected.其他容器(没有
initContainer
节)正确安装并按预期运行。
These pods which have initContainer
stanzas, however, report "failed to initialize" or "CrashLoopBackOff" as they continually try to start up.但是,这些具有
initContainer
节的 pod 在不断尝试启动时会报告“初始化失败”或“CrashLoopBackOff”。 The kubectl describe pod
of these pods gives only a Warning in the events section that "pod has unbound immediate PersistentVolumeClaims."这些 pod 的
kubectl describe pod
仅在事件部分给出“pod has unbound immediate PersistentVolumeClaims”的警告。 The initContainer
section of the pod description says it has failed because "Error" with no further elaboration. pod 描述的
initContainer
部分表示它已失败,因为“错误”没有进一步说明。
When looking at the associated pv
and pvc
entries from kubectl
, however, none are left pending, and all report "Bound" with no Events to speak of in the description.但是,当查看来自
kubectl
的相关pv
和pvc
条目时,没有一个条目处于待处理状态,并且所有条目都报告“已绑定”且描述中没有可提及的事件。
I have been able to find plenty of articles suggesting fixes when your pvc
list shows Pending claims, yet none so far that address this particular set of circumstance when all pvc
s are bound.当您的
pvc
列表显示 Pending 声明时,我已经能够找到大量建议修复的文章,但到目前为止,还没有一篇文章能够解决所有pvc
都绑定时的这种特定情况。
When a PVC is "Bound", this means that you do have a PersistentVolume object in your cluster, whose claimRef refers to that PVC (and usually: that your storage provisioner is done creating the corresponding volume in your storage backend).当 PVC 被“绑定”时,这意味着您的集群中确实有一个 PersistentVolume object,其 claimRef 指的是该 PVC(通常:您的存储配置器已在您的存储后端创建相应的卷)。
When a volume is "not bound", in one of your Pod, this means the node where your Pod was scheduled is unable to attach your persistent volume.当一个卷“未绑定”时,在您的一个 Pod 中,这意味着您的 Pod 所在的节点无法附加您的持久卷。 You should then check logs for your csi volumes attacher pod, when using CSI, or directly in nodes logs when using some in-tree driver.
然后,您应该在使用 CSI 时检查您的 csi 卷连接器 pod 的日志,或者在使用某些树内驱动程序时直接在节点日志中检查日志。
While the crashLoopBackOff think is something else.而 crashLoopBackOff 认为是另一回事。 You should check for logs of your initContainer:
kubectl logs -c <init-container-name> -p
.您应该检查您的 initContainer 的日志:
kubectl logs -c <init-container-name> -p
。 From your explanation, I would suppose there's some permission issues when copying files over.根据您的解释,我认为复制文件时存在一些权限问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.