Openshift 创建 Pod 状态状态一直处在 Pending 状态
# oc get pods
NAME READY STATUS RESTARTS AGE
hello-openshift-1-deploy 0/1 Pending 0 49s
# oc describe pod hello-openshift-1-deploy
……
SecretName: deployer-token-tcb2q
Optional: false
QoS Class: BestEffort
Node-Selectors: node-role.kubernetes.io/compute=true
Tolerations: <none>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 3s (x8 over 1m) default-scheduler 0/3 nodes are available: 3 node(s) didn't match node selector.
查看 Node 节点标签
# oc describe node node1.example.com
Name: node1.example.com
Roles: infra
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/os=linux
kubernetes.io/hostname=node1.example.com
node-role.kubernetes.io/infra=true
……
查询发现没有需要的标签
给 Node 节点打所需的标签
# oc label node node1.example.com node-role.kubernetes.io/compute=true
# oc label node node2.example.com node-role.kubernetes.io/compute=true
再次查看 Pod 状态
# oc get pods
NAME READY STATUS RESTARTS AGE
hello-openshift-1-deploy 0/1 ContainerCreating 0 18m
过会后再次查看
# oc get pods
NAME READY STATUS RESTARTS AGE
hello-openshift-1-5hqc2 1/1 Running 0 22m
问题完美解决!!!