Warning FailedScheduling default-scheduler Insufficient cpu

pod错误提示

# kubectl get pods -n ms

NAME                       READY   STATUS    RESTARTS   AGE

order-7f6794bbcd-nlgtx     0/1     Pending   0          78s

product-5cb556b9f4-z8d6s   0/1     Pending   0          4m3s

#

#kubectl describe pod order-7f6794bbcd-nlgtx -n ms
Name:           order-7f6794bbcd-nlgtx
Namespace:      ms
Priority:       0
Node:          
Labels:         app=order
                pod-template-hash=7f6794bbcd
                project=ms
Annotations:   
Status:         Pending
IP:            
IPs:           
Controlled By:  ReplicaSet/order-7f6794bbcd
Containers:
  order:
    Image:      100.100.100.11/microservice/order:2020-06-01-15-04-08
    Port:       8020/TCP
    Host Port:  0/TCP
    Limits:
      cpu:     1
      memory:  1Gi
    Requests:
      cpu:        500m
      memory:     256Mi
    Liveness:     tcp-socket :8020 delay=60s timeout=1s period=10s #success=1 #failure=3
    Readiness:    tcp-socket :8020 delay=60s timeout=1s period=10s #success=1 #failure=3
    Environment: 
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-86prk (ro)
Conditions:
  Type           Status
  PodScheduled   False
Volumes:
  default-token-86prk:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-86prk
    Optional:    false
QoS Class:       Burstable
Node-Selectors: 
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason            Age        From               Message
  ----     ------            ----       ----               -------
  Warning  FailedScheduling    default-scheduler  0/3 nodes are available: 3 Insufficient cpu.
  Warning  FailedScheduling    default-scheduler  0/3 nodes are available: 3 Insufficient cpu.
[root@node-16 k8s]#

原因 根据上面的提示,是当前的nodes CPU资源不足 所引起创建pods失败!
解决办法

1: 给nodes 增加cpu 资源

2:针对nodes 回收没用的pods 

 

增加nodes资源后

 

问题解决!


# kubectl top nodes
NAME      CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
node1   163m         4%     5116Mi          66%       
node2   91m          2%     5191Mi          67%       
node3   97m          2%     4575Mi          59%       

 

# kubectl get pods -n ms 
NAME                       READY   STATUS    RESTARTS   AGE
product-5cb556b9f4-pg78s   1/1     Running   0          20m
stock-9cb4758b5-6mwfm      1/1     Running   0          71m

   

你可能感兴趣的:(K8S)