首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CrunchyData Postgres算子Pod总是处于挂起状态

CrunchyData Postgres算子Pod总是处于挂起状态
EN

Stack Overflow用户
提问于 2022-07-08 10:43:24
回答 1查看 112关注 0票数 2

我正在尝试使用CrunchyData Postgres操作符来设置Postgres集群。我面临的问题是豆荚backrest-shared-repo总是处于Pending状态。

代码语言:javascript
复制
NAME                      STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
postgres-ha-1             Pending                                                     12m
postgres-ha-1-pgbr-repo   Pending                                                     12m

调试时,我发现PersistentVolumeClaim也处于挂起状态。PVC的事件如下:

代码语言:javascript
复制
no persistent volumes available for this claim and no storage class is set

PVC.yaml

代码语言:javascript
复制
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: "2022-07-08T10:28:48Z"
  finalizers:
  - kubernetes.io/pvc-protection
  labels:
    pg-cluster: postgres-ha-1
    vendor: crunchydata
  name: postgres-ha-1-pgbr-repo
  namespace: pgo
  resourceVersion: "1786569"
  uid: 6f80d516-320c-490e-ad6a-83400ea998a4
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 3G
  volumeMode: Filesystem
status:
  phase: Pending

下面是postgres-operator.yml中的存储配置

代码语言:javascript
复制
backrest_storage: "hostpathstorage"
backup_storage: "hostpathstorage"
primary_storage: "hostpathstorage"
replica_storage: "hostpathstorage"
pgadmin_storage: "hostpathstorage"
wal_storage: ""
storage1_name: "default"
storage1_access_mode: "ReadWriteOnce"
storage1_size: "1G"
storage1_type: "dynamic"
storage2_name: "hostpathstorage"
storage2_access_mode: "ReadWriteMany"
storage2_size: "3G"
storage2_type: "create"
storage3_name: "nfsstorage"
storage3_access_mode: "ReadWriteMany"
storage3_size: "1G"
storage3_type: "create"
storage3_supplemental_groups: "65534"
storage4_name: "nfsstoragered"
storage4_access_mode: "ReadWriteMany"
storage4_size: "1G"
storage4_match_labels: "crunchyzone=red"
storage4_type: "create"
storage4_supplemental_groups: "65534"
storage5_name: "storageos"
storage5_access_mode: "ReadWriteOnce"
storage5_size: "5Gi"
storage5_type: "dynamic"
storage5_class: "fast"
storage6_name: "primarysite"
storage6_access_mode: "ReadWriteOnce"
storage6_size: "4G"
storage6_type: "dynamic"
storage6_class: "primarysite"
storage7_name: "alternatesite"
storage7_access_mode: "ReadWriteOnce"
storage7_size: "4G"
storage7_type: "dynamic"
storage7_class: "alternatesite"
storage8_name: "gce"
storage8_access_mode: "ReadWriteOnce"
storage8_size: "300M"
storage8_type: "dynamic"
storage8_class: "standard"
storage9_name: "rook"
storage9_access_mode: "ReadWriteOnce"
storage9_size: "1Gi"
storage9_type: "dynamic"
storage9_class: "rook-ceph-block"

有人能帮我解决这个问题吗?

EN

回答 1

Stack Overflow用户

发布于 2022-07-09 11:34:16

您需要在集群中创建一个PersistentVolume,然后才能将它与PersistentVolumeClaim一起使用。这个错误仅仅意味着您没有任何可以与您的PVC匹配的PVs。

这是关于如何创建指南的官方PersistentVolumes。只需确保您在PersistentVolume上设置的规范与PersistentVolumeClaim匹配,否则它将不会被绑定。

您可以使用hostPath类型PV,它将简单地在工作节点上创建一个目录并使用它来存储数据。这将证明功能的正确性。稍后,您可能会转向更集中的解决方案,即拥有集中式卷存储( docs 这里中的详细信息)。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72910251

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档