且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当Pod创建后超过Pod的限制时,Pod如何限制kubernetes上强制执行的资源?

更新时间:2023-01-09 08:27:51

DavidO的答案是正确的,所以我只想向与我面临相同问题的其他人解释解决此问题的解决方案.

DavidO answer is correct, so I just want to explain a solution which solve this problem to others people whose facing same the problem with me.

您可以通过添加以下资源字段来限制运行Pod

you can limit running pod by adding the resources fields like this

"resources": {
          "limits": {
            "cpu": "100m",
            "memory": "50Mi"
           }
}

在yaml或json文件中的容器属性数组内,然后我用

inside the array of container attributes in yaml or json file ,then I just create the rc and pods with file by

$ kubectl create -f filename.yaml

仅此而已 信用:DavidO

that's all credit: DavidO