Updated on 2024-01-04 GMT+08:00

How Do I Use Events to Fix Abnormal Workloads?

If a workload is abnormal, you can first check the pod events to locate the fault and then rectify the fault by referring to Table 1.

Table 1 Troubleshooting methods

Event Information

Pod Status

Solution

PodsScheduling failed

Pending

For details, see What Should I Do If Pod Scheduling Fails?.

PodsFailed to pull image

Failed to re-pull image

FailedPullImage

ImagePullBackOff

For details, see What Should I Do If a Pod Fails to Pull the Image?.

PodsCreation failed

Failed to restart container

CreateContainerError

CrashLoopBackOff

For details, see What Should I Do If Container Startup Fails?.

The pod status is Evicted, and the pod keeps being evicted.

Evicted

For details, see What Should I Do If a Pod Fails to Be Evicted?.

The storage volume fails to be mounted to the pod.

Pending

For details, see What Should I Do If a Storage Volume Cannot Be Mounted or the Mounting Times Out?.

The pod stays Creating.

Creating

For details, see What Should I Do If a Workload Remains in the Creating State?.

The pod stays Terminating.

Terminating

For details, see What Should I Do If Pods in the Terminating State Cannot Be Deleted?.

The pod status is Stopped.

Stopped

For details, see What Should I Do If a Workload Is Stopped Caused by Pod Deletion?.

Viewing Pod Events

Run the kubectl describe pod {pod-name} command to view pod events, or log in to the CCE console and view pod events on the workload details page.

$ kubectl describe pod prepare-58bd7bdf9-fthrp
...
Events:
  Type     Reason            Age   From               Message
  ----     ------            ----  ----               -------
  Warning  FailedScheduling  49s   default-scheduler  0/2 nodes are available: 2 Insufficient cpu.
  Warning  FailedScheduling  49s   default-scheduler  0/2 nodes are available: 2 Insufficient cpu.