简体   繁体   English

Google Cloud Kubernetes Persistent Volume Claim 部署中的错误 Yaml

[英]Google Cloud Kubernetes Persistent Volume Claim error in deployment Yaml

I have a persistent volume claim file, which previously was being read by buildkite in the deployment stage.我有一个持久卷声明文件,以前在部署阶段由 buildkite 读取。 Only recently it has been erroring in the build process with this error:直到最近,它在构建过程中一直出现此错误:

error: error validating "kube/common/01-redis-volume-claim.yml": error validating data: field
spec.dataSource for v1.PersistentVolumeClaimSpec is required; if you choose to ignore these
errors, turn validation off with --validate=false

I've seen this issue crop up twice recently, and the immediate fix is to add the missing field ( spec.dataSource ) and setting it to null .我最近两次看到此问题出现,立即解决方法是添加缺少的字段( spec.dataSource )并将其设置为null

My question is, if it was absent in the first instance, then will setting it to null be any different than what it was previously?我的问题是,如果它在第一个实例中不存在,那么将其设置为null与之前的设置有什么不同吗?

Based ondocumentation基于文档

spec.dataSource should have: spec.dataSource应该有:

name: existing-src-pvc-name名称:现有-src-pvc-名称

kind: PersistentVolumeClaim种类:PersistentVolumeClaim

In my opinion everything you should do is add name and kind to your yaml file and there should not be any error anymore.在我看来,您应该做的一切就是在您的 yaml 文件中添加名称种类,这样就不会再出现任何错误了。

My question is, if it was absent in the first instance, then will setting it to null be any different than what it was previously?我的问题是,如果它在第一个实例中不存在,那么将其设置为 null 与之前的设置有什么不同吗?

Answering to this question, as far as I am concerned it is happening because you are not creating a new pvc, but you are likely to cloning it.回答这个问题,就我而言,它正在发生,因为您没有创建新的 pvc,但您可能会克隆它。

Volume clone feature was added to support CSI Volume Plugins only.添加了卷克隆功能以仅支持 CSI 卷插件。 For details, see volume cloning .有关详细信息,请参阅卷克隆

The CSI Volume Cloning feature adds support for specifying existing PVCs in the dataSource field to indicate a user would like to clone a Volume. CSI 卷克隆功能增加了对在dataSource字段中指定现有 PVC 以指示用户想要克隆卷的支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM