gpt4 book ai didi

kubernetes - glusterfs,heketi和kubernetes自动配置问题

转载 作者:行者123 更新时间:2023-12-02 12:09:22 25 4
gpt4 key购买 nike

我有一个gluster节点,我确实测试了heketi,它正在使用cli创建卷。
这是我的存储类:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: myglusterfs
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: kubernetes.io/glusterfs
allowVolumeExpansion: true
reclaimPolicy: Retain
parameters:
resturl: "http://x.x.x:8080"
restuser: "admin"
secretName: "heketi-secret"
secretNamespace: "default"
volumetype: "replicate:0"
volumenameprefix: "k8s-dev"
clusterid: "4d9a77f712zb12x57dd42477b993e9af"
当我创建样本PVC时,它将停留在待处理状态:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mypvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
# kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
mypvc Pending myglusterfs 5m11s
# kubectl describe pvc mypvc 
Name: mypvc
Namespace: default
StorageClass: myglusterfs
Status: Pending
Volume:
Labels: <none>
Annotations: volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/glusterfs
Finalizers: [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode: Filesystem
Mounted By: <none>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning ProvisioningFailed 14s (x10 over 6m9s) persistentvolume-controller Failed to provision volume with StorageClass "myglusterfs": failed to create volume: failed to create volume: see kube-controller-manager.log for details
当我看到 kube-controller-manager pod日志时,它看起来像这样:
1 event.go:291] "Event occurred" object="default/mypvc" kind="PersistentVolumeClaim" apiVersion="v1" type="Warning" reason="ProvisioningFailed" message="Failed to provision volume with StorageClass \"myglusterfs\": failed to create volume: failed to create volume: see kube-controller-manager.log for details"
问题是:我如何找出为什么pvc永远处于挂起模式?详细日志在哪里?

最佳答案

当gluster群集上只有一个节点时,卷类型必须为none。

volumetype: "none"

关于kubernetes - glusterfs,heketi和kubernetes自动配置问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64564028/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com