Problem/Requirement:-
Solution:-
Concepts:-
Resource Limit is the feature of Kubernetes which enables you to specify the CPU and memory of the container:-
CPU and memory are collectively referred to as compute resources, or just resources. Compute resources are measurable quantities that can be requested, allocated, and consumed. They are distinct from API resources. API resources, such as Pods and Services are objects that can be read and modified through the Kubernetes API server
CPU and memory are each a resource type. A resource type has a base unit. CPU is specified in units of cores, and memory is specified in units of bytes.
Limits and requests for CPU resources are measured in cpu units. One cpu, in Kubernetes, is equivalent to:
Limits and requests for memory
are measured in bytes. You can express memory as a plain integer or as a fixed-point integer using one of these suffixes: E, P, T, G, M, K. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki. For example, the following represent roughly the same value:
KiB- ,KiloByte, MiB- MegaByte
Ccoder, Weavescope are many other tools which can be used for testing the resource limit and performance of any running container in a realtime UI
based environment.
When Containers have resource requests specified, the scheduler can make better decisions about which nodes(Hosts) to place Pods(Containers) on. And when Containers have their limits specified, contention for resources on a node(Host) can be handled in a specified manner such as Auto Scaling/replicas.