如何解决Pod 无法挂载由臭氧 CSI 配置器创建的持久卷
我正在使用 kubernetes 部署 ozone(hdfs 的子程序),并且基本上遵循 here 和 here 的说明(只需几步)。
首先,我创建了几个带有本地目录的主机路径的 pv,然后通过将 nfs 声明更改为主机路径声明,对 ozone/kubernetes/example/ozone
中的 yaml 进行了轻微编辑:
volumeClaimTemplates:
- Metadata:
name: data
spec:
storageClassName: manual
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 5Gi
selector:
matchLabels:
type: local
并且我注释掉了 datanode-stateful.yaml 中的 nodeAffinity 设置,因为我的 kubernetes 只有主节点。
部署成功。
然后我按照csi协议中的说明应用了csi和pv-test,pv(s3v中的bucket)是自动建立的,pvc确实绑定了pv,但是test pod停在了containerCreating
。
附加 pv-test pod desc:
Name: ozone-csi-test-webserver-778c8c87b7-rngfk
Namespace: default
Priority: 0
Node: k8s-master/192.168.100.202
Start Time: Fri,18 Jun 2021 14:23:54 +0800
Labels: app=ozone-csi-test-webserver
pod-template-hash=778c8c87b7
Annotations: <none>
Status: Pending
IP:
Controlled By: replicaset/ozone-csi-test-webserver-778c8c87b7
Containers:
web:
Container ID:
Image: python:3.7.3-alpine3.8
Image ID:
Port: <none>
Host Port: <none>
Args:
python
-m
http.server
--directory
/www
State: Waiting
Reason: ContainerCreating
Ready: False
Restart Count: 0
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-gqknv (ro)
/www from webroot (rw)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
webroot:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: ozone-csi-test-webserver
ReadOnly: false
default-token-gqknv:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-gqknv
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedMount 7m7s (x58 over 122m) kubelet,k8s-master MountVolume.SetUp Failed for volume "pvc-1913bd70-09fd-4eba-a459-73fe3bd397b8" : rpc error: code = UnkNown desc =
Warning FailedMount 31s (x54 over 120m) kubelet,k8s-master Unable to mount volumes for pod "ozone-csi-test-webserver-778c8c87b7-rngfk_default(b1a59143-00b9-47f6-94fe-1845c29aee93)": timeout expired waiting for volumes to attach or mount for pod "default"/"ozone-csi-test-webserver-778c8c87b7-rngfk". list of unmounted volumes=[webroot]. list of unattached volumes=[webroot default-token-gqknv]
为整个过程附加事件:
7m51s normal SuccessfulCreate statefulset/s3g create Claim data-s3g-0 Pod s3g-0 in StatefulSet s3g success
7m51s Warning FailedScheduling pod/s3g-0 pod has unbound immediate PersistentVolumeClaims (repeated 2 times)
7m51s normal SuccessfulCreate statefulset/scm create Pod scm-0 in StatefulSet scm successful
7m51s normal SuccessfulCreate statefulset/om create Pod om-0 in StatefulSet om successful
7m51s Warning FailedScheduling pod/om-0 pod has unbound immediate PersistentVolumeClaims (repeated 2 times)
7m51s Warning FailedScheduling pod/datanode-0 pod has unbound immediate PersistentVolumeClaims (repeated 2 times)
7m51s normal SuccessfulCreate statefulset/datanode create Pod datanode-0 in StatefulSet datanode successful
7m51s normal SuccessfulCreate statefulset/datanode create Claim data-datanode-0 Pod datanode-0 in StatefulSet datanode success
7m51s normal SuccessfulCreate statefulset/scm create Claim data-scm-0 Pod scm-0 in StatefulSet scm success
7m51s normal SuccessfulCreate statefulset/s3g create Pod s3g-0 in StatefulSet s3g successful
7m51s normal SuccessfulCreate statefulset/om create Claim data-om-0 Pod om-0 in StatefulSet om success
7m51s Warning FailedScheduling pod/scm-0 pod has unbound immediate PersistentVolumeClaims (repeated 2 times)
7m50s normal Scheduled pod/s3g-0 Successfully assigned default/s3g-0 to hadoop104
7m50s normal Scheduled pod/datanode-0 Successfully assigned default/datanode-0 to hadoop103
7m50s normal Scheduled pod/scm-0 Successfully assigned default/scm-0 to hadoop104
7m50s normal Scheduled pod/om-0 Successfully assigned default/om-0 to hadoop103
7m49s normal Created pod/datanode-0 Created container datanode
7m49s normal Started pod/datanode-0 Started container datanode
7m49s normal Pulled pod/datanode-0 Container image "apache/ozone:1.1.0" already present on machine
7m48s normal SuccessfulCreate statefulset/datanode create Claim data-datanode-1 Pod datanode-1 in StatefulSet datanode success
7m48s Warning FailedScheduling pod/datanode-1 pod has unbound immediate PersistentVolumeClaims (repeated 2 times)
7m48s normal Pulled pod/scm-0 Container image "apache/ozone:1.1.0" already present on machine
7m48s normal Created pod/scm-0 Created container init
7m48s normal Started pod/scm-0 Started container init
7m48s normal Pulled pod/s3g-0 Container image "apache/ozone:1.1.0" already present on machine
7m48s normal Created pod/s3g-0 Created container s3g
7m48s normal Started pod/s3g-0 Started container s3g
7m48s normal SuccessfulCreate statefulset/datanode create Pod datanode-1 in StatefulSet datanode successful
7m46s normal Scheduled pod/datanode-1 Successfully assigned default/datanode-1 to hadoop104
7m45s normal Created pod/datanode-1 Created container datanode
7m45s normal Pulled pod/datanode-1 Container image "apache/ozone:1.1.0" already present on machine
7m44s normal Created pod/scm-0 Created container scm
7m44s normal Started pod/scm-0 Started container scm
7m44s normal Started pod/datanode-1 Started container datanode
7m44s normal Pulled pod/scm-0 Container image "apache/ozone:1.1.0" already present on machine
7m43s Warning FailedScheduling pod/datanode-2 pod has unbound immediate PersistentVolumeClaims (repeated 2 times)
7m43s normal SuccessfulCreate statefulset/datanode create Pod datanode-2 in StatefulSet datanode successful
7m43s normal SuccessfulCreate statefulset/datanode create Claim data-datanode-2 Pod datanode-2 in StatefulSet datanode success
7m42s normal Scheduled pod/datanode-2 Successfully assigned default/datanode-2 to hadoop103
7m38s normal Pulled pod/datanode-2 Container image "apache/ozone:1.1.0" already present on machine
7m38s normal Created pod/datanode-2 Created container datanode
7m38s normal Started pod/datanode-2 Started container datanode
7m23s normal Scalingreplicaset deployment/csi-provisioner Scaled up replica set csi-provisioner-5649bc9474 to 1
7m23s Warning FailedCreate daemonset/csi-node Error creating: pods "csi-node-" is forbidden: error looking up service account default/csi-ozone: serviceaccount "csi-ozone" not found
7m22s normal Scheduled pod/csi-node-nbfnw Successfully assigned default/csi-node-nbfnw to hadoop104
7m22s normal Scheduled pod/csi-provisioner-5649bc9474-n5jf2 Successfully assigned default/csi-provisioner-5649bc9474-n5jf2 to hadoop103
7m22s normal SuccessfulCreate replicaset/csi-provisioner-5649bc9474 Created pod: csi-provisioner-5649bc9474-n5jf2
7m22s normal Scheduled pod/csi-node-c97fz Successfully assigned default/csi-node-c97fz to hadoop103
7m22s normal SuccessfulCreate daemonset/csi-node Created pod: csi-node-c97fz
7m22s normal SuccessfulCreate daemonset/csi-node Created pod: csi-node-nbfnw
7m14s normal Pulling pod/csi-node-c97fz Pulling image "quay.io/k8scsi/csi-node-driver-registrar:v1.0.2"
7m14s normal Pulling pod/csi-provisioner-5649bc9474-n5jf2 Pulling image "quay.io/k8scsi/csi-provisioner:v1.0.1"
7m13s normal Pulling pod/csi-node-nbfnw Pulling image "quay.io/k8scsi/csi-node-driver-registrar:v1.0.2"
6m56s Warning Unhealthy pod/om-0 Liveness probe Failed: dial tcp 10.244.1.7:9862: connect: connection refused
6m56s normal Killing pod/om-0 Container om Failed liveness probe,will be restarted
6m55s normal Created pod/om-0 Created container om
6m55s normal Started pod/om-0 Started container om
6m55s normal Pulled pod/om-0 Container image "apache/ozone:1.1.0" already present on machine
6m48s normal Pulled pod/csi-provisioner-5649bc9474-n5jf2 Successfully pulled image "quay.io/k8scsi/csi-provisioner:v1.0.1"
6m48s normal Started pod/csi-provisioner-5649bc9474-n5jf2 Started container ozone-csi
6m48s normal Created pod/csi-provisioner-5649bc9474-n5jf2 Created container ozone-csi
6m48s normal Pulled pod/csi-provisioner-5649bc9474-n5jf2 Container image "apache/ozone:1.1.0" already present on machine
6m48s normal Started pod/csi-provisioner-5649bc9474-n5jf2 Started container csi-provisioner
6m48s normal Created pod/csi-provisioner-5649bc9474-n5jf2 Created container csi-provisioner
6m45s normal Pulled pod/csi-node-nbfnw Successfully pulled image "quay.io/k8scsi/csi-node-driver-registrar:v1.0.2"
6m44s normal Started pod/csi-node-nbfnw Started container driver-registrar
6m44s normal Started pod/csi-node-nbfnw Started container csi-node
6m44s normal Created pod/csi-node-nbfnw Created container csi-node
6m44s normal Created pod/csi-node-nbfnw Created container driver-registrar
6m44s normal Pulled pod/csi-node-nbfnw Container image "apache/ozone:1.1.0" already present on machine
6m25s normal Pulled pod/csi-node-c97fz Successfully pulled image "quay.io/k8scsi/csi-node-driver-registrar:v1.0.2"
6m25s normal Pulled pod/csi-node-c97fz Container image "apache/ozone:1.1.0" already present on machine
6m25s normal Started pod/csi-node-c97fz Started container csi-node
6m25s normal Created pod/csi-node-c97fz Created container csi-node
6m17s normal Created pod/csi-node-c97fz Created container driver-registrar
6m17s normal Pulled pod/csi-node-c97fz Container image "quay.io/k8scsi/csi-node-driver-registrar:v1.0.2" already present on machine
6m17s normal Started pod/csi-node-c97fz Started container driver-registrar
6m3s normal Provisioning persistentvolumeclaim/ozone-csi-test-webserver External provisioner is provisioning volume for claim "default/ozone-csi-test-webserver"
6m3s normal Scalingreplicaset deployment/ozone-csi-test-webserver Scaled up replica set ozone-csi-test-webserver-7cbdc5d65c to 1
6m3s normal SuccessfulCreate replicaset/ozone-csi-test-webserver-7cbdc5d65c Created pod: ozone-csi-test-webserver-7cbdc5d65c-dpzhc
6m3s normal ExternalProvisioning persistentvolumeclaim/ozone-csi-test-webserver waiting for a volume to be created,either by external provisioner "org.apache.hadoop.ozone" or manually created by system administrator
6m2s Warning FailedScheduling pod/ozone-csi-test-webserver-7cbdc5d65c-dpzhc pod has unbound immediate PersistentVolumeClaims (repeated 2 times)
6m1s normal ProvisioningSucceeded persistentvolumeclaim/ozone-csi-test-webserver Successfully provisioned volume pvc-cd01c58d-793f-41ce-9e12-057ade02e07c
5m59s normal Scheduled pod/ozone-csi-test-webserver-7cbdc5d65c-dpzhc Successfully assigned default/ozone-csi-test-webserver-7cbdc5d65c-dpzhc to hadoop104
97s Warning FailedMount pod/ozone-csi-test-webserver-7cbdc5d65c-dpzhc Unable to attach or mount volumes: unmounted volumes=[webroot],unattached volumes=[webroot default-token-l9lng]: timed out waiting for the condition
94s Warning FailedMount pod/ozone-csi-test-webserver-7cbdc5d65c-dpzhc MountVolume.SetUp Failed for volume "pvc-cd01c58d-793f-41ce-9e12-057ade02e07c" : kubernetes.io/csi: mounter.SetupAt Failed: rpc error: code = UnkNown desc =
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。