Get the App
SLTechnology News&Howtos  ›  Servers  › 

K8S creates the Pod state state and is always in the Pending state

Shulou Source: shulou.com Published: 2022-06-03 06:21:52 11月15日 Update

Openshift creates Pod state state is always in Pending state

# oc get podsNAME READY STATUS RESTARTS AGEhello-openshift-1-deploy 0/1 Pending 0 49s

# oc describe pod hello-openshift-1-deploy... SecretName: deployer-token-tcb2q Optional: falseQoS Class: BestEffortNode-Selectors: node-role.kubernetes.io/compute=trueTolerations: Events: Type Reason Age From Message-Warning FailedScheduling 3s (x8 over 1m) default-scheduler 0 default-scheduler 3 nodes are available: 3 node (s) didn't match node selector.

View the Node node label

# oc describe node node1.example.comName: node1.example.comRoles: infraLabels: beta.kubernetes.io/arch=amd64 beta.kubernetes.io/os=linux kubernetes.io/hostname=node1.example.com node-role.kubernetes.io/infra=true.

The query found no required tags.

Tag the Node node as needed

# oc label node node1.example.com node-role.kubernetes.io/compute=true# oc label node node2.example.com node-role.kubernetes.io/compute=true

Check the Pod status again

# oc get podsNAME READY STATUS RESTARTS AGEhello-openshift-1-deploy 0/1 ContainerCreating 0 18m

Check again after the meeting

# oc get podsNAME READY STATUS RESTARTS AGEhello-openshift-1-5hqc2 1 5hqc2 1 Running 0 22m

The problem is solved perfectly!

Tags: Status label again node in problem query Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Linux macOS MySQL Huawei