我一直在尝试使用以下文档来部署Cassandra https://kubernetes.io/docs/tutorials/stateful-application/cassandra/
Cassandra的部署工作正常,但是当我尝试创建statefull集时,出现以下错误:
卡桑德拉0 吊舱具有未绑定的即时PersistentVolumeClaims(已重复2次)
谁能帮助我我在哪里做错了?
答案 0 :(得分:0)
您是否创建了正确的storage class并将其命名为fast
?
尝试这个:
...
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
答案 1 :(得分:0)
有状态集需要存储状态的持久卷,您提供的文档中有一个显示状态的部分:
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关联