我创建了两个部署(与kubenetes运营商一起进行部署,并且还有其他活动,例如服务创建,秘密创建等,尽管那里我觉得它们与该错误无关)期望豆荚出现,但豆荚出现。 当我检查事件时,发现两个吊舱都存在以下错误(我正在列出一个)
60m Warning FailedCreate replicaset/sast-edge-5577bdcf6c Error creating: pods "sas-edge-5577bdcf6c-94ps9" is forbidden: failed quota: app-xxxx-stable-biw9247u7z: must specify limits.memory
当我描述广告连播时,我看到已经指定了限制
image: registry.xxx.xxxx.com/xxkl/xxx-xxxx:1.4
imagePullPolicy: IfNotPresent
name: nsc-core
ports:
- containerPort: 3000
protocol: TCP
resources:
limits:
memory: 500Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
我还检查了NS的配额
Name: app-xxxx-stable-biw9247u7z
Namespace: app-xxxx-stable-biw9247u7z
Resource Used Hard
-------- ---- ----
limits.memory 4072Mi 8Gi
我不确定为什么kubernetes不是指定的资源限制。需要帮助。
答案 0 :(得分:1)
Forbidden Failed quota
和limits
时,也会出现 requests
错误,并且其中也包括初始化容器。在所有容器中添加limits
和requests
应该可以解决该错误。
答案 1 :(得分:0)
在“规范”部分添加类似的内容
containers:
- name: nsc-core
image: registry.xxx.xxxx.com/xxkl/xxx-xxxx:1.4
resources:
limits:
cpu: "2"
memory: 2000Mi
requests:
cpu: "1"
memory: 1500Mi