我正在尝试在我的Pod的定义中使用资源限制和请求,但这就像调度程序不想应用我的规范一样:
kind: Pod
apiVersion: v1
metadata:
name: pod-lab5
namespace: limit-namespace
labels:
app: stress
spec:
containers:
- name: resources-limit
image: dkuffner/docker-stress
command: ["stress"]
args: ["--vm", "1", "--vm-bytes", "50M", "--vm-hang", "1"]
resources:
requests:
memory: "60Mi"
cpu: "70m"
limits:
memory: "65Mi"
cpu: "75m"
requests:
ephemeral-storage: "2Gi"
limits:
ephemeral-storage: "4Gi"
apiVersion: v1
kind: LimitRange
metadata:
name: mylimits
namespace: limit-namespace
spec:
limits:
- max:
cpu: 100m
memory: 100Mi
min:
cpu: 40m
memory: 20Mi
type: Pod
- default:
cpu: 80m
memory: 70Mi
defaultRequest:
cpu: 60m
memory: 50Mi
max:
cpu: 100m
memory: 100Mi
min:
cpu: 40m
memory: 20Mi
type: Container
有人可以帮助我吗?谢谢:)
答案 0 :(得分:2)
我认为这只是参数重复的问题。
resources:
requests:
memory: "60Mi"
cpu: "70m"
limits:
memory: "65Mi"
cpu: "75m"
requests:
ephemeral-storage: "2Gi"
limits:
ephemeral-storage: "4Gi"
进行如下修改,然后再次测试。
resources:
requests:
memory: "60Mi"
cpu: "70m"
ephemeral-storage: "2Gi"
limits:
memory: "65Mi"
cpu: "75m"
ephemeral-storage: "4Gi"