首页 新闻 会员 周边 捐助

0/2 nodes are available: 2 pod has unbound immediate PersistentVolumeClaims

0
悬赏园豆:5 [已解决问题] 解决于 2024-04-05 11:26
#  先来看一下pod,发现没有运行
kubectl get pod | grep search
test-search-es-default-0                         0/1     Running   0          16m


# 查看一下错误描述:
Events:
  Type     Reason            Age                From               Message
  ----     ------            ----               ----               -------
  Warning  FailedScheduling  30s (x2 over 30s)  default-scheduler  0/2 nodes are available: 2 pod has unbound immediate PersistentVolumeClaims.
  Normal   Scheduled         27s                default-scheduler  Successfully assigned default/test-search-es-default-0 to 192.168.0.21


# 查看SC:nfs-client (default) 
kubectl get sc
NAME                   PROVISIONER                                     RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
managed-nfs-storage    nfs-subdir-external-provisioner                 Delete          Immediate           false                  224d
nfs-client (default)   cluster.local/nfs-subdir-external-provisioner   Delete          Immediate           true                   239d

# 查看pvc,发现其状态是Bound
kubectl get pvc | grep ela
elasticsearch-data-test-search-es-default-0   Bound    pvc-31dca991-52a2-46d8-8673-bd5aa7f7b959   1Gi        RWO            nfs-client     13m


# 再看pv
kubectl get pv | grep ela
pvc-31dca991-52a2-46d8-8673-bd5aa7f7b959   1Gi        RWO            Delete           Bound    default/elasticsearch-data-test-search-es-default-0   nfs-client              14m


结论:
看起来一切都是正常的,但是为什么会出现绑定错误呢?

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: test-search
spec:
  version: 8.4.2
  nodeSets:
  - name: default
    count: 1
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
        storageClassName: nfs-client
denli的主页 denli | 初学一级 | 园豆:19
提问于:2022-09-28 19:58
< >
分享
最佳答案
0

你使用的 nfs server 方式不支持 Dynamic Volume Provisioning,详见 https://stackoverflow.com/a/52669115/5989202

收获园豆:5
dudu | 高人七级 |园豆:29333 | 2022-09-28 20:04
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册