Setting limits

If you've done work with containers before, you will know that one of the first and easiest things to set up for your containers is resource limits in the form of the following metrics:

  • CPU
  • Memory
  • Requests

You may be familiar with setting runtime limits on resources with Docker's CLI, which specify flags to limit these items and more:

docker run --it --cpu-rt-runtime=950000 
--ulimit rtprio=99
--memory=1024m
--cpus=".5"
alpine /bin/sh

Here, we're setting a runtime parameter, creating a ulimit, and setting memory and CPU quotas. The story evolves a bit in Kubernetes, as you can create these limits to a specific namespace, which allows you to characterize your limits by the domains of your cluster. You have four overarching parameters so that you can work resource limits in Kubernetes:

spec.containers[].resources.limits.cpu
spec.containers[].resources.requests.cpu
spec.containers[].resources.limits.memory
spec.containers[].resources.requests.memory
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.203.134