k8s 初次启动mysql、elasticsearch等持久化数据库时pod处于Pending状态

  1. describe 查看pod详情
    waiting for a volume to be created, either by external provisioner "cluster.local/storage-class-local-path-provisioner" or manually created by system administrator
  2. 查看pv、pvc存在一个Pending状态的pvc
  3. describe 查看pvc详情 未能创建pv
    failed to provision volume with StorageClass "local-pv-storage": failed to create volume pvc-dceffac8-63fc-4cae-807e-d0a186151c5e: create process timeout after 120 seconds
  4. 删除Pending pvc、pod等待重新启动
  5. 验证状态
    Failed to bind volumes: timed out waiting for the condition
  6. 在对应node上找到pvc挂载卷目录 备份数据 重试4步骤操作
    External provisioner is provisioning volume for claim "coding/data-elasticsearch-master-0"

特殊情况:
elasticsearch-data集群与elasticsearch-master处于依赖关系
data已启动master还处于Pending并且node没有创建pvc
删除elasticsearch sts重新部署

问题原因解析
node节点在集群中但不能运行pod

# 存储  k8s  docker  pvc 

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×