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:           <none>
Labels:         app=order
                pod-template-hash=7f6794bbcd
                project=ms
Annotations:    <none>
Status:         Pending
IP:            
IPs:            <none>
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:  <none>
    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:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason            Age        From               Message
  ----     ------            ----       ----               -------
  Warning  FailedScheduling  <unknown>  default-scheduler  0/3 nodes are available: 3 Insufficient cpu.
  Warning  FailedScheduling  <unknown>  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

  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值