logo

Resource Requests and Limits Under the Hood: The Journey of a Pod Spec

Authors:   Kohei Ota, Kaslin Fields


Summary

Resource requests and limits in Kubernetes are essential for ensuring that applications have the resources they need to run successfully without interfering with each other. This presentation uses a fun analogy of a doggy daycare to explain how Kubernetes manages compute resources.
  • Resource requests and limits are defined in a pod spec and used by Kubernetes for planning.
  • Requests are like planning out how much space a doggy daycare needs to take care of a dog.
  • Limits are like setting boundaries for how much a dog can eat or play with other dogs.
  • Kubernetes manages compute resources by assigning nodes to pods based on their resource requests and limits.
  • Vertical pod auto scalers can be used to automatically adjust resource requests and limits based on application usage.
  • The journey of a pod spec involves the pod spec being registered, fetched by the scheduler, assigned to a node by the kubelet, and executed by the CRI/OCI runtime.
  • Vertical pod auto scalers provide recommendations for resource requests and limits based on target, lower bound, upper bound, and uncapped target.
The analogy of a doggy daycare helps to illustrate the importance of resource requests and limits in Kubernetes. Just like how different dogs have different needs and personalities, different applications have different resource requirements. By setting resource requests and limits, Kubernetes can ensure that each application has the resources it needs to run successfully without interfering with other applications, just like how a doggy daycare sets boundaries for how much each dog can eat or play with other dogs.

Abstract

Let's learn how resource requests and limits work by illustrating what is really happening inside of your cluster - literally! CNCF Ambassadors Kohei Ota and Kaslin Fields will use fun hand-drawn artwork to walk you through understanding what your cluster is really doing when you set a resource restriction in Kubernetes. Engineers and their applications are going through a transformation. From running apps on a machine or VM directly, to running it in containers, and then to container orchestration via Kubernetes. During this journey, it is easy to become disconnected from what’s really happening on the underlying infrastructure. By learning what Kubernetes is doing under the hood, you can get a deep understanding for how Kubernetes manages compute resources. This talk will cover what happens, starting from setting the restriction on a Kubernetes Pod, then how these parameters will be delivered from the Pod spec to the Linux kernel layer through kubelet and CRI/OCI runtimes.

Materials:

Tags:

Post a comment