gpt4 book ai didi

kubernetes - 错误 “no persistent volumes available for this claim and no storage class is set”

转载 作者:行者123 更新时间:2023-12-02 11:52:11 30 4
gpt4 key购买 nike

是否需要在节点中手动创建目录,还是由pv自动创建?

这是我的pv和pvc文件,我看到此错误

no persistent volumes available for this claim and no storage class is set



如何解决呢?
kind: PersistentVolume
apiVersion: v1
metadata:
name: zk1-pv
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 10Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mr/zk"

cat zk1-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: zk1-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Mi


kubectl describe pvc zk1-pvc
Name: zk1-pvc
Namespace: instavote
StorageClass:
Status: Pending
Volume:
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"name":"zk1-pvc","namespace":"instavote"},"spec":{"accessMo...
Finalizers: [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal FailedBinding 12s (x14 over 3m7s) *persistentvolume-controller no persistent volumes available for this claim and no storage class is set*
Mounted By: zk1-745b7cbf46-lg7v9

最佳答案

您忘记在storageClassName: manual中指定PersistentVolumeClaim

关于kubernetes - 错误 “no persistent volumes available for this claim and no storage class is set”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55780083/

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