Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Corrected links that should have been relative instead of absolute.

...

A pod/container is allowed to use more of the resources than specified in the request. However, it cannot use more than what is specified in the resource limit.

For example, if you set

...

a memory request of 3072Mi for a

...

pod, and

...

the available memory is 6144Mi, the pod can try to use more

...

If you set a memory limit of 4GiB for that container, the kubelet (and container runtime) enforce the limit. The runtime prevents the container from using more than the configured resource limit. For example: when a process in the container tries to consume more than the allowed amount of memory, the system kernel terminates the process that attempted the allocation, with an out of memory (OOM) error.

Limits can be implemented either reactively (the system intervenes once it sees a violation) or by enforcement (the system prevents the container from ever exceeding the limit). Different runtimes can have different ways to implement the same restrictions.

Info
If a container specifies its own memory limit, but does not specify a memory request, Kubernetes automatically assigns a memory request that matches the limit. Similarly, if a container specifies its own CPU limit, but does not specify a CPU request, Kubernetes automatically assigns a CPU request that matches the limit.

memory. Nevertheless, if you have set a memory limit of 4096Mi for that pod, the system will prevent the pod from using the more memory than defined in the resource limit.

Here is how you can change the CPU and memory figures for resources used by a microservice.

  1. Open the values.yaml file.
  2. Go to the respective microservice for which you want to configure the resource requests and limits as shown in the example below.
    Image Modified
  3. Save the file.





  


Panel
borderStylesolid
titleYou may be interested in...
What is new
Application architecture
Key terms
Install
Usage scenarios