19.06.2021 Views

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 10 ■ Configuring Compute Resources

Overview

The two types of resources, compute resources and API resources, are shown in Figure 10-2. Compute

resources are measurable quantities that can be requested by containers in a pod, allocated to containers

and consumed by containers. API resources are Kubernetes objects such as pods and services, which are

written to and retrieved from the API server.

Kubernetes

Resource

Compute Resources

API Resources

Figure 10-2. Kubernetes resource types

We will only be discussing compute resources in this chapter. By default, compute resources available

to a container or a pod are limited only by the node capacity. While resources are consumed by containers

in a pod (a pod can have one or more container), resources are also implied to be consumed by pods. The

resources requested, allocated, and consumed by a pod are the total of the resources requested, allocated,

and consumed by the containers in the pod. Node capacity comprises the resources available to a node in

terms of CPUs, memory, and the maximum number of pods that can be scheduled on the node. The total of

all allocated resources for each resource (CPUs, memory) to containers running on a node cannot exceed

the node capacity for the resource. Kubernetes Scheduler ensures that sufficient resources are available on

a node before it schedules a pod on the node. Even after scheduling a node, the Scheduler ensures that the

total of allocated resources on a node does not exceed the node capacity, which it cannot by virtue of the

node capacity. The Scheduler only monitors the containers started by the kubelet and not containers started

by the Docker engine. This chapter looks at the following topics:

Types of compute resources

Resource requests and limits

Quality of service

Setting the environment

Finding node capacity

Creating a pod with resources specified

Overcommitting resource limits

Reserving node resources

238

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

Saved successfully!

Ooh no, something went wrong!