没有可用于此声明的持久卷

没有可用于此声明的持久卷

本文介绍了没有可用于此声明的持久卷,也未设置任何存储类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的pvc.yaml

my pvc.yaml

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

当我运行kubectl apply -f pvc.yaml时,出现以下错误Normal FailedBinding 12h (x83 over 13h) persistentvolume-controller no persistent volumes available for this claim and no storage class is set

when i ran kubectl apply -f pvc.yaml i got the following errorNormal FailedBinding 12h (x83 over 13h) persistentvolume-controller no persistent volumes available for this claim and no storage class is set

相同的pvc在"GKE"(谷歌Kubernetes引擎)上运行良好,但在我的本地群集中使用 microk8s

same pvc worked fine on "GKE" (Google Kubernetes Engine) but failing in my local cluster using microk8s

推荐答案

您是否在集群中创建了任何PV?

Did you create any PV in your cluster?

本地群集上的PV和存储类应由群集管理员手动完成.

PV and Storage classes on local clusters should be done manually by cluster admin.

查看 Kubernetes文档详细信息:

  1. 群集管理员创建由物理存储支持的PersistentVolume.管理员未关联该卷 与任何Pod.

  1. A cluster administrator creates a PersistentVolume that is backed by physical storage. The administrator does not associate the volume with any Pod.

集群用户创建一个PersistentVolumeClaim,它会自动绑定到合适的PersistentVolume.

A cluster user creates a PersistentVolumeClaim, which gets automatically bound to a suitable PersistentVolume.

用户创建一个使用PersistentVolumeClaim作为存储的Pod.

The user creates a Pod that uses the PersistentVolumeClaim as storage.

这篇关于没有可用于此声明的持久卷,也未设置任何存储类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 07:06