19.06.2021 Views

148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 10 ■ Configuring Compute Resources

Overcommitting Resource Limits

As shown in an earlier example, a maximum of three pods can be scheduled on a node with the allocated

requests consuming 90% of allocable CPU. The memory limits are at 300%, which makes the limits

overcommitted. If all the pods were to request their maximum allocable memory concurrently, the resource

consumption would exceed 100% and some pods would terminate. Even with a single pod on a node the

memory limits are overcommitted at 109%, though not by much, as shown in Figure 10-22.

Figure 10-22. Overcommitted memory limits

Reserving Node Resources

Pods are not the only objects or processes consuming resources on a node. It may be suitable to reserve

some resources for non-pod processes such as system processes. Resources may be reserved by running a

placeholder pod. Create a pod definition file pod-reserve-resource.yaml. Run the Docker image gcr.io/

google_containers/pause and specify resource limits for resources to be reserved such as 200m for cpu and

200Mi for memory.

apiVersion: v1

kind: Pod

metadata:

name: reserve-resource

spec:

containers:

- name: reserve-resource

image: gcr.io/google_containers/pause:0.8.0

resources:

limits:

cpu: “0.1”

memory: 200Mi

The pod definition file is shown in a vi editor in Figure 10-23.

254

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!