Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use the describe command for Kubernetes pod error troubleshooting

Shulou Source: shulou.com Published: 2022-06-02 04:19:30 10月03日 Update

This article focuses on "how to use the describe command for Kubernetes pod error troubleshooting", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use the describe command for Kubernetes pod error troubleshooting.

I have a pod named another, which was created with kubectl create and found that 29 minutes later, the state is still in the ContainerCreating stage.

Use the kubectl describe command to check:

It was found from the error message that this pod attach volume failed:

FailedAttachVolume 2m1s (x22 over 31m) attachdetach-controller AttachVolume.Attach failed for volume "pvc-c4d41f5c-e7ed-11e8-8726-fe6d42bf075f": googleapi: Error 400: RESOURCE_IN_USE_BY_ANOTHER_RESOURCE-The disk resource 'projects/sap-pi-coo-acdc-dev/zones/europe-west1-b/disks/shoot--k8s-train--shac-pvc-c4d41f5c-e7ed-11e8-8726 fe6d42bf075f' is already being used by' projects/sap-pi-coo-acdc-dev/zones/europe-west1- B/instances/shoot--k8s-train--shacw46-worker-prvfv-z1-7844dc6744Murghd5m'

Warning FailedMount 31s (x14 over 29m) kubelet, shoot--k8s-train--shacw46-worker-prvfv-z1-7844dc6744-hhrmd Unable to mount volumes for pod "another_part-0110 (13f15fa4-e819-11e8-8726-fe6d42bf075f)": timeout expired waiting for volumes to attach or mount for pod "part-0110" / "another". List of unmounted volumes= [content-storage]. List of unattached volumes= [content-storage default-token-6z5sk]

Looking at the yaml file of this pod, you can see that there is a claim of persistent volume:

Using the command kubectl get pv, it is found that all current persistent volume are occupied (BOUND status):

There are many solutions, and for testing purposes, I simply delete another pod that also declares nginx-pvc as PersistentVolumeClaim, and the pod state called another quickly becomes Running:

The event of this successful mount volume can also be clearly observed from the log generated by the describe command:

At this point, I believe that you have a deeper understanding of "how to use the describe command for Kubernetes pod error troubleshooting". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Commands errors status content learning practical deeper clear success events interests just practical practical quick easy to operate files schemes methods logs Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Redmi Apple MySQL MariaDB