concept request in category kubernetes

appears as: requests, request, request, requests, The request
Kubernetes in Action

This is an excerpt from Manning's book Kubernetes in Action.

Requests are hitting different pods randomly. This is what services in Kubernetes do when more than one pod instance backs them. They act as a load balancer standing in front of multiple pods. When there’s only one pod, services provide a static address for the single pod. Whether a service is backed by a single pod or a group of pods, those pods come and go as they’re moved around the cluster, which means their IP addresses change, but the service is always there at the same address. This makes it easy for clients to connect to the pods, regardless of how many exist and how often they change location.

$ kubectl run requests-pod-2 --image=busybox --restart Never
➥  --requests='cpu=800m,memory=20Mi' -- dd if=/dev/zero of=/dev/null
pod "requests-pod-2" created


!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":0,\"ch\":0},{\"line\":0,\"ch\":60}],[{\"line\":1,\"ch\":3},{\"line\":1,\"ch\":68}]]"}
!@%STYLE%@!
Understanding how the relationship between requests and limits de- efines the QoS class

All three QoS classes and their relationships with requests and limits are shown in figure 14.4.

Figure 14.4. Resource requests, limits and QoS classes

Thinking about what QoS class a pod has can make your head spin, because it involves multiple containers, multiple resources, and all the possible relationships between requests and limits. It’s easier if you start by thinking about QoS at the container level (although QoS classes are a property of pods, not containers) and then derive the pod’s QoS class from the QoS classes of containers.

If only requests are set, but not limits, refer to the table rows where requests are less than the limits. If only limits are set, requests default to the limits, so refer to the rows where requests equal limits.