我有一个项目需要通过helm在kubernetes集群上部署redis,但是有一个挂起的异常。pod描述如下
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 11s (x2 over 100s) default-scheduler error while running "VolumeBinding" filter plugin for pod "redis-slave-0": pod has unbound immediate PersistentVolumeClaims
然后我尝试通过添加storageclass.yaml和pv.yaml来解决这个问题,如下所示
## storageclass.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage-redis
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
## pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: local-pv-redis
spec:
capacity:
storage: 8Gi
# volumeMode field requires BlockVolume Alpha feature gate to be enabled.
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
storageClassName: local-storage-redis
persistentVolumeReclaimPolicy: Retain
local:
path: /home/ubuntu/redis
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- cloud-1
``` `cloud-1` 是主机名, `/home/ubuntu/redis` 是主机路径
最后我应用这两个文件,并键入 `helm install redis --set global.storageClass=local-storage-redis bitnami/redis -n edgeai-system` 启动redis。
但是pod仍然挂起异常,并且错误没有改变。
kubeadm版本:gitversion:“v1.17.3”;
客户端版本:gitversion:“v1.17.3”;服务器版本:gitversion:“v1.17.3”;
Helm 版本:v3.4.1;
我不知道我遗漏了什么,如果你能告诉我怎么解决的话,我会很感激的?
暂无答案!
目前还没有任何答案,快来回答吧!