繁体   English   中英

kubernetes-超出资源限制

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM