This patch makes the CRI `v1` API the new project-wide default version.
To allow backwards compatibility, a fallback to `v1alpha2` has been added
as well. This fallback can either used by automatically determined by
the kubelet.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Remove init containers from the state file once the app container started,
it will release the memory allocated for the init container and can intense
the density of containers on the NUMA node in cases when the memory allocated
for init containers is bigger than the memory allocated for app containers.
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
Set the container cpuset.memory during the creation and avoid an additional
call to the resources update of the container.
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
We will have two layers of the validation.
- the first part of the validation logic will be implemented under the
`ValidateKubeletConfiguration` method
- the second one that requires knowledge about machine topology and
node allocatable resources will be implemented under the memory manager.
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
Calculate the total amount of reserved memory only for NUMA nodes
that are existing under the machine.
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
- The `Allocate` method will try to allocate the memory according to the affinity hints
saved under the `TopologyManager` store. If the store does not have any hints for the memory
it will call `getDefaultHint` to get the default hint. If the affinity does not satisfy
the memory request, it will call `extendTopologyManagerHint` to extend the topology hint to
satisfy the memory request. Once it has the preferred hint, it will allocate the memory and
update the the memory manager state accordingly.
- The `RemoveContainer` will release the allocated memory and update the memory manager state accordingly.
- The `GetTopologyHints` method will try to re-generate topology hints when the container already presents
under the memory manager state. If it does not present it will call `calculateHints` to get topology hints.
The `calculateHints` uses an approach similar to the one used under the CPU manager:
1. If the container memory request can be satisfied by the single NUMA node, it will not allocate the memory from
more than one NUMA node and it will set only single NUMA hints as the preferred one.
It can affect the density, but it gives us guarantees regarding the NUMA alignment.
2. The NUMA node used in the multi NUMA assignment can not be used in the single NUMA assignment.
And the NUMA node used in the single NUMA assignment can not be used in the multi NUMA assignment.
3. Only hints with NUMA node that have enough memory will be returned.
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
Reserved memory of all kinds (and over all
NUMA nodes) must be equal to the values determined
by Node Allocatable feature.
Signed-off-by: Cezary Zukowski <c.zukowski@samsung.com>
Pass memory manager flags to the container manager and call all relevant memory manager
methods under the container manager.
Signed-off-by: Byonggon Chun <bg.chun@samsung.com>