小编Kon*_*nov的帖子

本地 PersistentVolumeClaim 说“没有匹配的卷插件”

我最近开始探索 Kubernetes,并决定尝试将 kafka 部署到 k8s。但是,我在创建持久卷时遇到问题。我创建了一个存储类和一个持久卷,但持久卷声明仍处于挂起状态,表示“没有卷插件匹配”。这是我使用的 yaml 文件,其中虚线表示新文件。有人知道为什么会发生这种情况吗?

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: Immediate
reclaimPolicy: Retain

------------------------

apiVersion: v1
kind: PersistentVolume
metadata:
  name: kafka-pv
spec:
  capacity:
    storage: 10Gi
  volumeMode: Filesystem
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  local:
    path: /mnt/disks/ssd1
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - docker-desktop


---------------------------

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: zookeeper-pvc
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 5Gi
  storageClassName: local-storage
Run Code Online (Sandbox Code Playgroud)

kubernetes persistent-volumes persistent-volume-claims

3
推荐指数
1
解决办法
2万
查看次数