我已经创建了如下的资源配额。
apiVersion: v1
kind: ResourceQuota
metadata:
name: compute-resources
spec:
hard:
requests.cpu: "900m"
然后在我的部署中,如下所示指定资源请求。
spec:
containers:
- image: nginx@sha256:189cce606b29fb2a33ebc2fcecfa8e33b0b99740da4737133cdbcee92f3aba0a
imagePullPolicy: Always
name: hello
ports:
- containerPort: 80
protocol: TCP
resources:
requests:
cpu: "500m"
即使在此之后,吊舱创建也会失败,并显示消息-
Error creating deployer pod: pods "hello-1-deploy" is forbidden: failed quota: compute-resources: must specify requests.cpu
我在这里做错了什么?仅供参考,我在配额和吊舱中使用了相同的名称空间/项目。