However, later when using examples. It's run against a quota with only a memory limit.
First, it attempts to create a pod with no limits. So the error message is
$ kubectl apply -f pod.yaml
Error from server (Forbidden): error when creating "pod.yaml": pods "nginx-pod" is forbidden: failed quota: quota: must specify memory
This is wrong, the error message must mention that both memory and cpu must be specified.
failed quota: quota: must specify cpu,memory
The tutorial then mentions we should use a memory limit. It should mention that we need to specify both a CPU and a memory limit.
The error message indicates that a ResourceQuota is in effect, and that the Pod must explicitly specify memory resources.
Later, a pod with a memory limit is created. This does not work with the quota from the previous step because it only has a memory limit and no CPU limit.
Under Get more details about the ResourceQuota: the output of kubectl describe quota/quota says 400m in front of CPU. It should be 1.
This line explains due to a bug in Kubernetes, we do not need to specify both a CPU and a memory limit.
kubernetes#55433 provide more details on how an explicit CPU resource is not needed to create a Pod with ResourceQuota.
kubernetes/kubernetes#55433 appears to have been fixed. I tried on the latest AWS EKS and we need both CPU and memory limit in the pod.
In Create resources with ResourceQuota, a ResourceQuota with both CPU and memory limit is set.
However, later when using examples. It's run against a quota with only a memory limit.
First, it attempts to create a pod with no limits. So the error message is
This is wrong, the error message must mention that both memory and cpu must be specified.
The tutorial then mentions we should use a memory limit. It should mention that we need to specify both a CPU and a memory limit.
Later, a pod with a memory limit is created. This does not work with the quota from the previous step because it only has a memory limit and no CPU limit.
Under
Get more details about the ResourceQuota
: the output of kubectl describe quota/quota says 400m in front of CPU. It should be 1.This line explains due to a bug in Kubernetes, we do not need to specify both a CPU and a memory limit.
kubernetes#55433 provide more details on how an explicit CPU resource is not needed to create a Pod with ResourceQuota.
kubernetes/kubernetes#55433 appears to have been fixed. I tried on the latest AWS EKS and we need both CPU and memory limit in the pod.