• Home
  • Resource Requests for Compute

Requesting CPU and memory from Kubernetes

Resource Requests for Compute

Requesting CPU and memory from Kubernetes
Resource Requests for Compute

As application developers, we love to consume two types of resources: CPU and memory.

If you don’t inform Kubernetes how much CPU and memory your application will consume during regular and peak activity, Kubernetes will have to guess. The last thing you want is Kubernetes to estimate wrong and underallocate resources. The Kubernetes scheduler continuously runs a bin packing algorithm to calculate the optimal place for your application to run. The Kubernetes scheduler considers many things, and if you provide both your CPU and memory needs, you will significantly help the algorithm find the best fit.

This lab introduces you to the best practices for ensuring the optimal amount of CPU and memory to reserve for your applications. The instructions in this lab closely follow the section “Resource Management” in Chapter 5, “Pods,” of the book Kubernetes: Up and Running, third edition.

In this lab, you will learn how to:

    ☐ Request CPU and memory for containers and Pods
    ☐ Configure Pods for three different resource request modes
    ☐ Apply ResourceQuotas for restricting compute resources
    ☐ Inspect what happens to Pods with inadequate resources
    ☐ Run a linter to find missing resource request declarations

  • LEVEL

    Beginner

  • DURATION

    20 minutes

  • UPDATED

    12 Jul, 2022

Categories