一、问题背景

  1. 当前Cluster K8s Version: v1.17.4
  2. 需要升级到K8s Version:v1.19.3
  3. 在升级过程中,有个Pod卡在ContainerCreating状态
api-9flnb                             0/1     ContainerCreating   0          4d19h
api-bb8th                             1/1     Running             0          4d20h
api-zwtpp                             1/1     Running             0          4d20h

二、问题分析

  1. Describe该Pod状态,提示hostPath type check failed: /var/run/docker.sock is not a file
    Events:
      Type     Reason       Age                       From     Message
      ----     ------       ----                      ----     -------
      Warning  FailedMount  11m (x3543 over 4d18h)    kubelet  (combined from similar events): Unable to attach or mount volumes: unmounted volumes=[docker-socket], unattached volumes=[xxxx-service-account-token-rjqz7 nginx-certs host-timezone docker-socket helm-home etc-pki kubernetes-root-ca-file root-ca-file bcmt-home etcd-client-certs]: timed out waiting for the condition
      Warning  FailedMount  2m39s (x2889 over 4d19h)  kubelet  MountVolume.SetUp failed for volume "docker-socket" : hostPath type check failed: /var/run/docker.sock is not a file
  2. Volumes:
      etcd-client-certs:
        Type:        Secret (a volume populated by a Secret)
        SecretName:  etcd-client-certs
        Optional:    false
      nginx-certs:
        Type:          HostPath (bare host directory volume)
        Path:          /opt/bcmt/config/bcmt-api/certs
        HostPathType:  Directory
      docker-socket:
        Type:          HostPath (bare host directory volume)
        Path:          /var/run/docker.sock
        HostPathType:  File

相关文章: