我正在使用 openbs local pv hostpath-provisioner 在 docker swarm(底层操作系统:MacOs BigSur)上运行本地 k8s 集群。在为 jenkins pod(安装了 hlem v3)应用 pvc 后,pvc 被绑定,但卷永远不会在本地文件系统上创建。我的配置有问题吗?更多信息请查看我的配置,在此先感谢。
詹金斯-values.yaml:
serviceAccount:
create: false
name: jenkins
annotations: {}
persistence:
enabled: true
existingClaim: jenkins-pvc
詹金斯-pvc.yaml:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jenkins-pvc
namespace: devops
spec:
storageClassName: openebs-local
accessModes:
- ReadWriteOnce
resources:
requests:
storage: $JENKINS_PV_SIZE
openebs-sc.yaml:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-local
annotations:
openebs.io/cas-type: local
cas.openebs.io/config: |
- name: StorageType
value: hostpath
- name: BasePath
value: /k8s/openebs/storage/
provisioner: openebs.io/local
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
openbs-provisioner 日志:
2021-11-26T14:34:51.999Z INFO app/provisioner_hostpath.go:173 {"eventcode": "local.pv.provision.success", "msg": "Successfully provisioned Local PV", "rname": "pvc-de5fe1b3-42e8-4bac-a4e6-e361ab5f6d42", "storagetype": "hostpath"}
I1126 14:34:51.999910 1 controller.go:1384] provision "devops/jenkins-pvc" class "openebs-local": volume "pvc-de5fe1b3-42e8-4bac-a4e6-e361ab5f6d42" provisioned
I1126 14:34:51.999946 1 controller.go:1397] provision "devops/jenkins-pvc" class "openebs-local": succeeded
I1126 14:34:51.999971 1 volume_store.go:212] Trying to save persistentvolume "pvc-de5fe1b3-42e8-4bac-a4e6-e361ab5f6d42"
I1126 14:34:52.017235 1 volume_store.go:219] persistentvolume "pvc-de5fe1b3-42e8-4bac-a4e6-e361ab5f6d42" saved
I1126 14:34:52.017811 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"devops", Name:"jenkins-pvc", UID:"de5fe1b3-42e8-4bac-a4e6-e361ab5f6d42", APIVersion:"v1", ResourceVersion:"196387", FieldPath:""}): type: 'Normal' reason: 'ProvisioningSucceeded' Successfully provisioned volume pvc-de5fe1b3-42e8-4bac-a4e6-e361ab5f6d42
pv 已成功配置,但未在我的本地文件系统上创建,这有点奇怪。
编辑: 我猜它与底层操作系统(Macos BigSur)有关,因为不同的文件系统没有/run/udev。