尽管我的分配较高,但Google容器限制了CPU分配资源

时间:2015-11-12 20:19:13

标签: kubernetes google-kubernetes-engine

"spec": {
  "containers": [
    {
      "name": "test",
      "image": "gcr.io/helloworldnodejs-1119/mytetest",
      "resources": {
        "requests": {
          "cpu": "500m",
          "memory": "128Mi"
        }
      },
      "env": [
        {
          "name": "GET_HOSTS_FROM",
          "value": "dns"
        }
      ],
      "ports": [
        {
          "name": "middleware-server",
          "containerPort": 8000,
          "hostPort": 8000
        }
      ]
    }
  ]
}


RajRajen:mytetest rajrajen$ kubectl describe pod lbmiddleware-6e1hi 
Name: lbmiddleware-6e1hi 
Namespace: default Image(s): gcr.io/helloworldnodejs-1119/mytetest 
Node: / Labels: app=mymiddleware,tier=mymiddleware 
**Status: Pending** 
Reason:
Message:
IP:
Replication Controllers: mymiddleware (1/1 replicas created) Containers: lb4btest: Image: gcr.io/helloworldnodejs-1119/mytetest

**Limits:
  cpu:        100m**

***State:      Waiting***
Ready:      False
Restart Count:  0
Events: 
FirstSeen LastSeen Count From SubobjectPath Reason Message 
Thu, 12 Nov 2015 11:05:01 -0800 Thu, 12 Nov 2015 11:05:16 -0800 5 {scheduler } ***failedScheduling Failed for reason PodFitsResources and possibly others***

看起来我的Docker大小是130MB,甚至在POD中配置500MB(GKE - 容器创建)之后。然而执行设置了限制:cpu:100m ..

https://cloud.google.com/container-engine/docs/tutorials/guestbook   而不是.YAML文件,我使用middleware-controller.json来创建GKE - Google容器引擎。

RajRajen:lb4btest rajrajen$ kubectl create -f middleware-controller.json
replicationcontrollers/lbmiddleware

之前使用的命令: gcloud container clusters create lb4b-test-cluster --num-nodes 1 --machine-type g1-small

这是Docker推送Google Cloud注册表的最终结果

latest: digest: sha256:3c73d0c25e65c39164258c384b34d2cab72303375c8d3f6a2e70930000b9e171 **size: 132946**

1 个答案:

答案 0 :(得分:1)

您创建了一个具有相对较小机器类型的1节点群集。默认情况下,Google容器引擎会运行群集加载项(日志记录和监视),这些加载项会占用群集中的某些资源(如果愿意,可以禁用这些资源)。看起来您的群集中没有足够的剩余空间来启动需要这么多资源的窗格。尝试在创建群集或配置较大(或更多)节点时禁用群集添加。