排查 Statefulset Pod 卡在 ContainerCreating 或 Init 状态的问题
适用于
- 适用于 VMware 的 ONTAP Tools (OTV) 10.1
- iSCSI HA 部署
问题
- 当节点停机超过半小时后,当节点重新启动时,在维护控制台中,应用程序状态将如下所示:
- 当我们使用以下 kubectl 命令列出 pod 时,我们可以观察到 statefulset pod 处于 ContainerCreating 或 Init 状态超过 10 分钟。
- 要列出 pod,可以使用以下给定命令,其输出如下所示:
kubectl -n ntv-system get po -w| grep -e ContainerCreating -e Init -e Pending -e CrashLoopBackOff
ntv-mongodb-1 0/2 Init:0/1 0 10m17s
ntv-vault-1 0/1 ContainerCreating 0 10m25s
- 当我们使用以下命令描述这些卡住的 pod 时,我们会注意到以下警告:
示例: kubectl describe po ntv-vault-1 -n ntv-system
MountVolume.SetUp failed for volume "pvc-43451cff-8774-47f8-a49e-557b0dc4d4d2" : rpc error: code = Internal desc = unable to mount device; exit status 32 .
- kubelet 正在尝试将 PV 挂载到 pod 上, Kubelet 日志显示如下:
示例:tail -f /opt/netapp/rancher/rke2/agent/logs/kubelet.log
MountVolume.WaitForAttach entering for volume "pvc-43451cff-8774-47f8-a49e-557b0dc4d4d2"
MountVolume.WaitForAttach succeeded for volume "pvc-43451cff-8774-47f8-a49e-557b0dc4d4d2"
Error: MountVolume.SetUp failed for volume "pvc-43451cff-8774-47f8-a49e-557b0dc4d4d2" (UniqueName: "kubernetes.io/csi/csi.trident.netapp.io^pvc-43451cff-8774-47f8-a49e-557b0dc4d4d2") pod "ntv-mongodb-1" (UID: "b1ae36be-a713-46d9-9dbe-94184be7832f") : rpc error: code = Internal desc = unable to mount device; exit status 32