I do not understand kubernetes LimitRange
configuration. I created a manifest with following contents:
apiVersion: v1
kind: LimitRange
metadata:
name: cpu-limit-range
spec:
limits:
- default:
cpu: 4
defaultRequest:
cpu: 4
max:
cpu: 6
type: Container
And then I run following commands :
[root@localhost ~]# kubectl delete pods default-cpu-demo-19 1^C
[root@localhost ~]# kubectl get pods -n=limit
NAME READY STATUS RESTARTS AGE
default-cpu-demo-19 0/1 Pending 0 9s
[root@localhost ~]# kubectl describe pods -n=limit
......(omitted unnecessary echo here)......
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 14s (x8 over 9m2s) default-scheduler 0/1 nodes are available: 1 Insufficient cpu.
Of course, I know that most amount of limit:cpu of a container can not be more bigger than that of above configuration. Otherwise, kubernets will report insufficient cpu.
And yet most amount of max:cpu of a container can not be bigger than that of above configuration as well.
I can't distinguish between maximum and limit, because a value is bigger than the limit or max is not allowed.
So, I want to know what they represent respectively and relation among them.
If i understand your question correctly, what you asked is -- what's the difference between min, max, default and defaultRequest limits for containers set in LimitRange
resource. The answer is very simple:
Here is part of official documentation that has examples and more info on that topic.