Commit Graph

40984 Commits

Author SHA1 Message Date
Artyom Lukianov
f7845ed4e9 memory manager: provide memory manager static policy unittests
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-02-09 01:09:59 +02:00
Krzysztof Wiatrzyk
d7175a831c memory manager: adding Memory Manager component unit tests
Signed-off-by: Krzysztof Wiatrzyk <k.wiatrzyk@samsung.com>
2021-02-09 01:09:59 +02:00
Pawel Rapacz
18c8a821e0 memory manager: implement GetPodTopologyHints method
It will return memory and hugepages hints for the whole pod.

Signed-off-by: Pawel Rapacz <p.rapacz@partner.samsung.com>
2021-02-09 01:09:59 +02:00
Artyom Lukianov
abb94bec51 memory manager: implement the memory manager static policy
- 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>
2021-02-09 01:09:59 +02:00
Artyom Lukianov
371c918e6c memory manager: add memory manager policy to defaulter and conversion files
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-02-09 01:09:59 +02:00
Artyom Lukianov
afb1ae3458 memory manager: add fake memory manager
The fake memory manager needed for the unittesting.

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-02-09 01:09:59 +02:00
Cezary Zukowski
4a64102918 memory manager: validate reserved-memory against Node Allocatable
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>
2021-02-09 00:54:58 +02:00
Artyom Lukianov
9ae499ae46 memory manager: pass memory manager flags to the container manager
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>
2021-02-09 00:54:58 +02:00
Artyom Lukianov
93accb51e4 memory manager: add memory manager flag under kubelet options and kubelet config
The commit also includes generated files after `make generated_files`.

Signed-off-by: Byonggon Chun <bg.chun@samsung.com>
2021-02-09 00:54:58 +02:00
Artyom Lukianov
95f81372e2 memory manager: implement the manager interface methods
The commit adds implementation for methods:
- Start
- AddContainer
- Allocate
- RemoveContainer
- State
- GetTopologyHints

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-02-09 00:54:58 +02:00
Artyom Lukianov
d0caec90e2 memory manager: add the policy interface
The commit also adds two policy skeletons:
- none
- static

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-02-09 00:54:58 +02:00
Artyom Lukianov
86df524948 memory manager: provide unittest for the state package
The commit includes tests to verify the functionallity:
- to restore state from the file
- to store the state to the file
- to clean the state from old data

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-02-09 00:54:58 +02:00
Artyom Lukianov
48ca6e53e6 memory manager: provide and use the checkpoint manager
The checkpoint manager provides a way to save the memory manager
`MemoryTable` both under the memory and under the state file.

Saving the `MemoryTable` under the state file can be useful when kubelet
restarted and you want to restore memory allocations for running containers.
Also, it provides a way to monitor memory allocations done by the memory manager,
and in the future, the state file content can be exposed under the pod metrics.

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-02-09 00:54:58 +02:00
Artyom Lukianov
4c75be0604 memory manager: provide the skeleton for the memory manager
Provide memory manager struct and methods that should be implemented.

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-02-09 00:54:58 +02:00
Kubernetes Prow Robot
97d40890d0 Merge pull request #98802 from dabaooline/fix-ignorederr
fix ignored podinfo parserr
2021-02-07 17:53:11 -08:00
Kubernetes Prow Robot
425d29b39a Merge pull request #98688 from wangkai1994/fix/pvc_protection_controller_log
migrate pkg/controller/volume/pvc_protection_controller.go to structured logs
2021-02-06 20:13:11 -08:00
dabaooline
7c99f426cd fix ignored podinfo parserr
Co-authored-by: Jie Shen <drfish.me@gmail.com>
2021-02-06 18:59:12 +08:00
Kubernetes Prow Robot
c15851b777 Merge pull request #98793 from wzshiming/ut/speed-up-endpointslice
Speed up pkg/controller/endpointslice unit tests
2021-02-05 17:51:11 -08:00
Kubernetes Prow Robot
0faf096041 Merge pull request #98755 from aojea/hostportdockershim
dockershim hostport manager use HostIP
2021-02-05 14:06:42 -08:00
Kubernetes Prow Robot
036cab71a6 Merge pull request #98691 from pacoxu/cronjob-ut
run cronjob every 1minute in UT
2021-02-05 11:34:52 -08:00
Kubernetes Prow Robot
19c9cf7a20 Merge pull request #98717 from mengjiao-liu/subpath-permission
fix VolumeMount permissions with subpaths only apply the right permsions to the last directory
2021-02-05 02:48:51 -08:00
Antonio Ojea
ad4776ba54 dockershim hostport respect IPFamily 2021-02-05 08:51:33 +01:00
Antonio Ojea
f7d86e8b1c dockershim hostport manager use HostIP
the hostport manager was not taking into consideration the hostIP
when binding the socket of the hostPort, causing that the same
HostPort can not be used with different IP addresses.
2021-02-05 08:51:33 +01:00
Kubernetes Prow Robot
6dc0047396 Merge pull request #98259 from tanjing2020/taint_manager_log
migrate scheduler/taint_manager.go structured logging
2021-02-04 23:50:51 -08:00
wzshiming
98eb869d63 Speed up pkg/controller/endpointslice unit tests 2021-02-05 15:28:37 +08:00
Kubernetes Prow Robot
d3fce91fdc Merge pull request #96293 from andyzhangx/azurefile-migration
azure file migration go beta
2021-02-04 22:32:51 -08:00
Kubernetes Prow Robot
f5fb1c93db Merge pull request #96021 from huffmanca/dont-remove-volume
Dont remove volumes when saveVolumeData fails
2021-02-04 18:20:51 -08:00
Kubernetes Prow Robot
4eb9d825d5 Merge pull request #98489 from alculquicondor/job-testtable
Make sync Job test tables more readable
2021-02-04 15:55:16 -08:00
Kubernetes Prow Robot
c14465cafb Merge pull request #98424 from rphillips/fixes/98142
kubelet: Pods created and rapidly terminated get stuck
2021-02-04 15:54:58 -08:00
Kubernetes Prow Robot
c1b3797f4b Merge pull request #97824 from hanlins/fix/97225/hc-rules
Explicitly add iptables rule to allow healthcheck nodeport
2021-02-04 15:54:52 -08:00
Kubernetes Prow Robot
7bbffd1126 Merge pull request #96911 from munnerz/fix-typo-admission-chain
Fix typo in API docs for sideEffects field on admission webhook resources
2021-02-04 13:22:52 -08:00
Ryan Phillips
f918e11e3a register all pending pod deletions and check for kill
do not delete the cgroup from a pod when it is being killed
2021-02-04 11:45:42 -06:00
Kubernetes Prow Robot
3416b6b0a4 Merge pull request #98715 from carlory/truncate-message
fix kube-scheduler cannot send event because the Note field is too large
2021-02-04 08:20:32 -08:00
andyzhangx
e22efa59da azure file migration go beta 2021-02-04 12:56:23 +00:00
Morten Torkildsen
b63342af70 Fix nil pointer dereference in disruption controller 2021-02-03 21:04:29 -08:00
Kubernetes Prow Robot
ebe7380b38 Merge pull request #98518 from tanjing2020/change-log
migrate default_preemption.go to structured logging
2021-02-03 19:54:28 -08:00
carlory
0b730f04ce fix kube-scheduler cannot send event because the Note field is too large 2021-02-04 10:36:11 +08:00
Kubernetes Prow Robot
429eaca536 Merge pull request #98700 from Jiawei0227/update_label
Update gce-pd volume topology label to GA
2021-02-03 16:42:28 -08:00
Kubernetes Prow Robot
0083786ca9 Merge pull request #98481 from gavinfish/sched-isstatusequal
Scheduler: add StatusEqual func for Status comparer
2021-02-03 13:32:28 -08:00
drfish
d15dacb57d Add Equal func for Status struct 2021-02-04 00:32:01 +08:00
Hanlin Shi
4cd1eacbc1 Add rule to allow healthcheck nodeport traffic in filter table
1. For iptables mode, add KUBE-NODEPORTS chain in filter table. Add
   rules to allow healthcheck node port traffic.
2. For ipvs mode, add KUBE-NODE-PORT chain in filter table. Add
   KUBE-HEALTH-CHECK-NODE-PORT ipset to allow traffic to healthcheck
   node port.
2021-02-03 15:20:10 +00:00
wangkai1994
7edf9e0155 change to kref and kobj 2021-02-03 17:45:38 +08:00
mengjiao.liu
d9138069fe fix VolumeMount permissions with subpaths only apply the right permissions to the last directory 2021-02-03 16:25:47 +08:00
Jiawei Wang
e76f60d2b8 Update gce-pd volume topology label to GA 2021-02-02 19:13:57 -08:00
Kubernetes Prow Robot
686a5cee36 Merge pull request #98696 from gavinfish/sched-ut
Scheduler: organize scheduler unit tests into subtests
2021-02-02 14:06:49 -08:00
Kubernetes Prow Robot
4d3ed163a0 Merge pull request #98477 from palnabarun/update-gogo/protobuf
Update gogo/protobuf to v1.3.2
2021-02-02 09:56:28 -08:00
Kubernetes Prow Robot
1119a505ac Merge pull request #98669 from liggitt/denyexec
Remove deprecated DenyEscalatingExec / DenyExecOnPrivileged admission
2021-02-02 06:52:28 -08:00
drfish
ebb6fb5b0c Organize scheduler unit tests into subtests 2021-02-02 21:41:20 +08:00
pacoxu
81e0ebcde9 run cronjob every 1minute(means 1s) in UT 2021-02-02 18:54:50 +08:00
wangkai1994
ab11816570 migrate pkg/controller/volume/pvcprotection.go to structured logs 2021-02-02 17:42:20 +08:00