如何诊断卡住的 Kubernetes 推出/部署?

Chr*_*ski 9 kubernetes

部署似乎卡住了。我该如何进一步诊断?

kubectl rollout status deployment/wordpress
Waiting for rollout to finish: 2 out of 3 new replicas have been updated...
Run Code Online (Sandbox Code Playgroud)

它已经坚持了很长时间。它不会终止两个较旧的 pod:

kubectl get pods                   
NAME                         READY     STATUS    RESTARTS   AGE
nfs-server-r6g6w             1/1       Running   0          2h
redis-679c597dd-67rgw        1/1       Running   0          2h
wordpress-64c944d9bd-dvnwh   4/4       Running   3          3h
wordpress-64c944d9bd-vmrdd   4/4       Running   3          3h
wordpress-f59c459fd-qkfrt    0/4       Pending   0          22m
wordpress-f59c459fd-w8c65    0/4       Pending   0          22m
Run Code Online (Sandbox Code Playgroud)

和事件:

kubectl get events --all-namespaces
NAMESPACE   LAST SEEN   FIRST SEEN   COUNT     NAME                                          KIND         SUBOBJECT   TYPE      REASON              SOURCE                    MESSAGE
default     25m         2h           333       wordpress-686ccd47b4-4pbfk.153408cdba627f50   Pod                      Warning   FailedScheduling    default-scheduler         No nodes are available that match all of the predicates: Insufficient cpu (1), Insufficient memory (2), MatchInterPodAffinity (1).
default     25m         2h           337       wordpress-686ccd47b4-vv9dk.153408cc8661c49d   Pod                      Warning   FailedScheduling    default-scheduler         No nodes are available that match all of the predicates: Insufficient cpu (1), Insufficient memory (2), MatchInterPodAffinity (1).
default     22m         22m          1         wordpress-686ccd47b4.15340e5036ef7d1c         ReplicaSet               Normal    SuccessfulDelete    replicaset-controller     Deleted pod: wordpress-686ccd47b4-4pbfk
default     22m         22m          1         wordpress-686ccd47b4.15340e5036f2fec1         ReplicaSet               Normal    SuccessfulDelete    replicaset-controller     Deleted pod: wordpress-686ccd47b4-vv9dk
default     2m          22m          72        wordpress-f59c459fd-qkfrt.15340e503bd4988c    Pod                      Warning   FailedScheduling    default-scheduler         No nodes are available that match all of the predicates: Insufficient cpu (1), Insufficient memory (2), MatchInterPodAffinity (1).
default     2m          22m          72        wordpress-f59c459fd-w8c65.15340e50399a8a5a    Pod                      Warning   FailedScheduling    default-scheduler         No nodes are available that match all of the predicates: Insufficient cpu (1), Insufficient memory (2), MatchInterPodAffinity (1).
default     22m         22m          1         wordpress-f59c459fd.15340e5039d6c622          ReplicaSet               Normal    SuccessfulCreate    replicaset-controller     Created pod: wordpress-f59c459fd-w8c65
default     22m         22m          1         wordpress-f59c459fd.15340e503bf844db          ReplicaSet               Normal    SuccessfulCreate    replicaset-controller     Created pod: wordpress-f59c459fd-qkfrt
default     3m          23h          177       wordpress.1533c22c7bf657bd                    Ingress                  Normal    Service             loadbalancer-controller   no user specified default backend, using system default
default     22m         22m          1         wordpress.15340e50356eaa6a                    Deployment               Normal    ScalingReplicaSet   deployment-controller     Scaled down replica set wordpress-686ccd47b4 to 0
default     22m         22m          1         wordpress.15340e5037c04da6                    Deployment               Normal    ScalingReplicaSet   deployment-controller     Scaled up replica set wordpress-f59c459fd to 2
Run Code Online (Sandbox Code Playgroud)

iom*_*omv 5

您可以使用describe kubectl describe po wordpress-f59c459fd-qkfrt,但从消息来看,无法在任何节点中调度pod。

提供更多容量,例如尝试添加节点,以允许调度 Pod。