gpt4 book ai didi

kubernetes - io.k8s.api.core.v1.PersistentVolumeClaim 中的未知字段 "storage"

转载 作者:行者123 更新时间:2023-12-01 22:19:12 26 4
gpt4 key购买 nike

我的 pvc.yaml

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: database-disk
labels:
stage: production
name: database
app: mysql
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi

microk8s中运行kubectl apply -f pvc.yaml出现以下错误:

error validating data:ValidationData(PersistentVolumeClaim): unknown field "storage" in io.k8s.api.core.v1.PersistenVolumeClaim if choose to ignore these errors turn validation off with --validate=false

编辑:当我在虚拟机上复制文本时,存储缩进错误:(,现在工作正常

最佳答案

您忘记指定volumeMode。添加 volumeMode 选项,它应该可以工作。

像这样:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: database-disk
labels:
stage: production
name: database
app: mysql
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 20Gi

关于kubernetes - io.k8s.api.core.v1.PersistentVolumeClaim 中的未知字段 "storage",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52217988/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com