January 2019
Intermediate to advanced
484 pages
11h 48m
English
There are two core resource types that participate in the scheduling process, namely CPU and memory. To see the capability of a node, we can check its .status.allocatable path:
# Here we only show the path with a go template.$ kubectl get node <node_name> -o go-template --template=\'{{range $k,$v:=.status.allocatable}}{{printf "%s: %s\n" $k $v}}{{end}}'cpu: 2ephemeral-storage: 14796951528hugepages-2Mi: 0memory: 1936300Kipods: 110
As we can see, these resources will be allocated to any pod in need by the scheduler. But how does the scheduler know how many resources a pod will consume? We actually have to instruct Kubernetes about the request and the limit for each pod. The syntax is spec.containers[].resources.{limits,requests}.{resource_name} ...
Read now
Unlock full access