[英]kubernetes - resource limits exceeded
我有一個運行Kubernetes v1.6.7的集群。
虛擬機是:
Distributor ID: Debian Description: Debian GNU/Linux 8.7 (jessie) Release: 8.7 Codename: jessie
內核: 3.16.0-4-amd64
我們在部署中設置了CPU限制,但是Pod會根據需要在此限制之上使用CPU。 我有什么想念的嗎? 像kubelet中的參數一樣啟用此限制? 我還沒有發現有關此問題的任何信息。
例如,如果我創建以下部署:
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: stress namespace: default labels: k8s-app: stress spec: replicas: 1 selector: matchLabels: k8s-app: stress template: metadata: labels: k8s-app: stress spec: containers: - name: stress image: progrium/stress imagePullPolicy: Always args: ["--cpu", "1"] resources: limits: cpu: "500m" memory: "1Gi" requests: cpu: "100m" memory: "512Mi"
在節點上,這使CPU使用率為100%,而應該為50%。
謝謝你的幫助。
從對問題的評論中,您可以嘗試在具有CPU限制的情況下運行docker容器,您將得到: WARNING: Your kernel does not support CPU cfs period or the cgroup is not mounted. Period discarded. WARNING: Your kernel does not support CPU cfs quota or the cgroup is not mounted. Quota discarded.
WARNING: Your kernel does not support CPU cfs period or the cgroup is not mounted. Period discarded. WARNING: Your kernel does not support CPU cfs quota or the cgroup is not mounted. Quota discarded.
這意味着您的系統的內核構建不支持CFS。 這是一個有關此問題 ,關於3.16.0-4-amd64版本。
您需要重建或更新內核。
以下是從反向端口更新它的方法:
添加帶有backport的鏡像: $ sudo vi /etc/apt/sources.list.d/sources.list deb http://http.debian.net/debian jessie-backports main deb-src http://http.debian.net/debian jessie-backports main
更新apt: sudo apt-get update
從backport存儲庫安裝內核: sudo apt-get install -t jessie-backports linux-image-amd64
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.