广告连播具有未绑定的PersistentVolumeClaims [英] pod has unbound PersistentVolumeClaims

查看:90
本文介绍了广告连播具有未绑定的PersistentVolumeClaims的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,当我进行部署时,我的吊舱出现了错误:

When I push my deployments, for some reason, I'm getting the error on my pods:

pod具有未绑定的PersistentVolumeClaims

pod has unbound PersistentVolumeClaims

以下是我的YAML:

这是在本地运行,而不是在任何云解决方案上.

This is running locally, not on any cloud solution.

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.16.0 ()
  creationTimestamp: null
  labels:
    io.kompose.service: ckan
  name: ckan
spec:
  replicas: 1
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        io.kompose.service: ckan
    spec:
      containers:
        image: slckan/docker_ckan
        name: ckan
        ports:
        - containerPort: 5000
        resources: {}
        volumeMounts:
            - name: ckan-home
              mountPath: /usr/lib/ckan/
              subPath: ckan
      volumes:
      - name: ckan-home
        persistentVolumeClaim:
          claimName: ckan-pv-home-claim
      restartPolicy: Always
status: {}


kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: ckan-pv-home-claim
  labels:
    io.kompose.service: ckan
spec:
  storageClassName: ckan-home-sc
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi
  volumeMode: Filesystem
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: ckan-home-sc
provisioner: kubernetes.io/no-provisioner
mountOptions:
  - dir_mode=0755
  - file_mode=0755
  - uid=1000
  - gid=1000

推荐答案

您必须定义 PersistentVolume ,以提供供 PersistentVolumeClaim 占用的磁盘空间.

You have to define a PersistentVolume providing disc space to be consumed by the PersistentVolumeClaim.

使用storageClass时,Kubernetes将启用动态卷配置" ,该功能不适用于本地文件系统.

When using storageClass Kubernetes is going to enable "Dynamic Volume Provisioning" which is not working with the local file system.

  • 提供 PersistentVolume 来满足声明的约束(大小> = 100Mi)
  • PersistentVolumeClaim
  • 中删除storageClass
  • 从集群中删除 StorageClass
  • Provide a PersistentVolume fulfilling the constraints of the claim (a size >= 100Mi)
  • Remove the storageClass-line from the PersistentVolumeClaim
  • Remove the StorageClass from your cluster

在创建部署状态描述时,通常知道应用程序需要哪种存储(量,速度,...).
为了使部署具有通用性,您希望避免对存储的严格依赖. Kubernetes的卷抽象可让您以标准化的方式提供和使用存储.

At creation of the deployment state-description it is usually known which kind (amount, speed, ...) of storage that application will need.
To make a deployment versatile you'd like to avoid a hard dependency on storage. Kubernetes volume-abstraction allows you to provide and consume storage in a standardized way.

PersistentVolumeClaim 用于在部署应用程序的同时提供存储限制.

The PersistentVolumeClaim is used to provide a storage-constraint alongside the deployment of an application.

PersistentVolume (持久卷)提供了群集范围内的卷实例,这些实例可以被使用("bound").一个PersistentVolume将绑定到一个声明.但是由于该声明的多个实例可能在多个节点上运行,因此该卷可能是

The PersistentVolume offers cluster-wide volume-instances ready to be consumed ("bound"). One PersistentVolume will be bound to one claim. But since multiple instances of that claim may be run on multiple nodes, that volume may be accessed by multiple nodes.

不具有StorageClass的 PersistentVolume 被认为是静态.

A PersistentVolume without StorageClass is considered to be static.

="a href =" https://kubernetes.io/docs/concepts/storage/dynamic-provisioning"rel =" noreferrer> 动态卷配置" 和<带有 StorageClass 的strong> 允许群集按需配置PersistentVolume. 为了使这项工作有效,给定的存储提供者必须支持设置 -这样,当出现不满意的 PersistentVolumeClaim 出现时,群集就可以请求提供新的" PersistentVolume .

"Dynamic Volume Provisioning" alongside with a StorageClass allows the cluster to provision PersistentVolumes on demand. In order to make that work, the given storage provider must support provisioning - this allows the cluster to request the provisioning of a "new" PersistentVolume when an unsatisfied PersistentVolumeClaim pops up.

这篇关于广告连播具有未绑定的PersistentVolumeClaims的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆