在kubernetes群集上部署cassandra

6qftjkof  于 2021-06-14  发布在  Cassandra
关注(0)|答案(2)|浏览(281)

我一直在尝试使用以下文档部署cassandrahttps://kubernetes.io/docs/tutorials/stateful-application/cassandra/
cassandra的部署工作正常,但当我尝试创建statefull集时,会出现以下错误:
cassandra 0 pod已解除立即persistentvolumeclaims的绑定(重复2次)
谁能帮我一下我哪里做错了?

yc0p9oo0

yc0p9oo01#

您是否创建了正确的存储类并将其命名 fast ?
试试这个(应该可以在azure上使用):

...
  volumeClaimTemplates:
  - metadata:
      name: cassandra-data
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: fast
      resources:
        requests:
          storage: 1Gi

---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: fast
parameters:
  fsType: xfs
  kind: Managed
  storageaccounttype: Premium_LRS
provisioner: kubernetes.io/azure-disk
reclaimPolicy: Delete
volumeBindingMode: Immediate
h7appiyu

h7appiyu2#

有状态集需要一个持久卷来存储状态,您提供的文档有一个部分显示它:

volumeClaimTemplates:
  - metadata:
      name: cassandra-data
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: fast
      resources:
        requests:
          storage: 1Gi
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: fast
provisioner: k8s.io/minikube-hostpath
parameters:
  type: pd-ssd

这些是根据需要在azure中创建pv和/或存储类的文档
https://docs.microsoft.com/en-us/azure/aks/azure-files-dynamic-pv
然后可以将对象与statefulset相关联

相关问题