1249 Commits

Author SHA1 Message Date
Kevin Klues
67c92a5cd4 Refactor / simplify logic for CPU assignment algorithm in CPUManager
Signed-off-by: Kevin Klues <kklues@nvidia.com>
2021-05-14 14:53:06 +00:00
s-ito-ts
1dea66439c Adds unit tests for pkg/kubelet/cm/cpumanager/topology 2021-05-12 07:13:04 +00:00
Kir Kolyshkin
b49744f177 vendor: bump runc to rc94
One notable change is cgroup manager's Set now accept Resources rather
than Cgroup (see https://github.com/opencontainers/runc/pull/2906).
Modify the code accordingly.

Also update runc dependencies (as hinted by hack/lint-depdendencies.sh):

	github.com/cilium/ebpf v0.5.0
	github.com/containerd/console v1.0.2
	github.com/coreos/go-systemd/v22 v22.3.1
	github.com/godbus/dbus/v5 v5.0.4
	github.com/moby/sys/mountinfo v0.4.1
	golang.org/x/sys v0.0.0-20210426230700-d19ff857e887
	github.com/google/go-cmp v0.5.4
	github.com/kr/pretty v0.2.1
	github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-05-11 11:56:42 -07:00
Jim Ramsay
a21179ae69 cpuset.Parse: Fix edge cases and add negative tests
The cpuset.Parse function missed a couple bad input cases, specifically
"1--3" and "10-6".  These were silently ignored when they should instead
be flagged as invalid.

This now catches these cases and expands the unit tests for cpuset to
cover them (and other negative test cases as well).

Signed-off-by: Jim Ramsay <jramsay@redhat.com>
2021-05-11 11:05:38 -04:00
Giuseppe Scrivano
fd7ecd3915 kubelet: reuse manager
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-05-10 17:34:53 -07:00
Kubernetes Prow Robot
160425640e Merge pull request #101771 from klueska/upstream-only-uppdate-if-needed
Add logic to only call CPUManager Update() if state different than last Update()
2021-05-10 09:45:09 -07:00
Kubernetes Prow Robot
9f9d774eee Merge pull request #101615 from aheng-ch/podTopologyHints
fix removing pods from podTopologyHints mapping
2021-05-10 08:13:26 -07:00
aheng-ch
ff7b94fa5a fix removing pods from podTopologyHints mapping 2021-05-10 19:44:15 +08:00
Kevin Klues
6646039481 Add logic to only call Update() if state different than last Update()
Signed-off-by: Kevin Klues <kklues@nvidia.com>
2021-05-06 23:38:08 +02:00
Ryan Phillips
4488162bd9 kubelet: change cgroup move message to log level 3 2021-04-28 14:54:54 -05:00
Kubernetes Prow Robot
e213fb61ef Merge pull request #100778 from Fish-pro/fix-delete-duplicate-log
delete duplicate logs
2021-04-26 12:53:37 -07:00
Kubernetes Prow Robot
9cc6c2a82f Merge pull request #100150 from bobbypage/remove-unused-limit-func
kubelet: remove unused applyLimits function
2021-04-22 13:18:22 -07:00
Kubernetes Prow Robot
12f8466459 Merge pull request #100267 from Jeffwan/support_arbitratry_resources
Expose resources overrides and maxPods conf in kubemark
2021-04-08 20:29:12 -07:00
Kubernetes Prow Robot
f72410d4c6 Merge pull request #100067 from changshuchao/testcase_status
Add test case for state.go
2021-04-08 17:11:21 -07:00
chen zechun
d16d57b7d1 fix delete duplicate logs 2021-04-02 16:18:47 +08:00
Elana Hashman
6af7eb6d49 Migrate missed log entries in kubelet
Co-Authored-By: pacoxu <paco.xu@daocloud.io>
2021-03-18 14:26:26 -07:00
Jiaxin Shan
1b4dc87a1f Expose resources overrides and maxPods conf in kubemark 2021-03-17 16:31:58 -07:00
Kubernetes Prow Robot
1d4777b798 Merge pull request #100163 from lala123912/kubelet_log_3
Migrate pkg/kubelet/cm/cpumanage/{topology/togit pology.go, policy_none.go, cpu_assignment.go} to structured logging
2021-03-16 15:57:08 -07:00
Kubernetes Prow Robot
1cd909606d Merge pull request #100176 from pacoxu/structured-log-kubelet-last
Kubelet migration to structured logs: cpumanager/{cpu_manager.go\fake_cpu_manager.go\policy_static.go)
2021-03-16 14:50:31 -07:00
Kubernetes Prow Robot
f217f3c0f9 Merge pull request #100081 from utsavoza/ugo/issue-98976/10-03-2021
Migrate pkg/kubelet/cm/cgroup_manager_linux.go to structured logging
2021-03-16 14:50:22 -07:00
Kubernetes Prow Robot
21de277402 Merge pull request #100007 from utsavoza/ugo/issue-98976/09-03-2021
Migrate remaining pkg/kubelet/cm/ top level files to structured logging
2021-03-16 14:50:14 -07:00
Kubernetes Prow Robot
38fbecf0c8 Merge pull request #100001 from shiyajuan123/logs
migrate kubelet/cm/container logs to structured logging
2021-03-16 14:50:06 -07:00
Kubernetes Prow Robot
e5309efbdf Merge pull request #99974 from knabben/sl-memorymanager
Migrate pkg/kubelet/cm/memorymanager to structured logging
2021-03-16 14:49:47 -07:00
Kubernetes Prow Robot
81a1a793a1 Merge pull request #99969 from knabben/sl-topologymanager
Migrate pkg/kubelet/cm/topologymanager to structure logging
2021-03-16 14:49:39 -07:00
Kubernetes Prow Robot
a951e877be Merge pull request #99563 from jmguzik/migrate-cm-cpumanager-state-structured-logging
Migrate pkg/kubelet/cm/cpumanager/state to structured logging
2021-03-16 14:48:55 -07:00
Kubernetes Prow Robot
e082d84575 Merge pull request #100196 from ehashman/remains-of-logs
Migrate remaining logs to structured logging
2021-03-16 13:12:55 -07:00
pacoxu
8d24c8d0ab update structured log for cpumanager/cpu_manager.go 2021-03-16 09:40:53 +08:00
Amim Knabben
b078a4ff7a Memory manager structured logging 2021-03-15 15:51:19 -04:00
Elana Hashman
ee0bcac1d2 Migrate devicemanager/topology_hints.go to structured logs 2021-03-15 12:39:45 -07:00
lala123912
b247240ad7 Migrate pkg/kubelet/cm/cpumanage/{topology/topology.go, policy_none.go, cpu_assignment.go} to structured logging 2021-03-15 09:42:07 +08:00
Amim Knabben
c1d24c87bb Migrate devicemanager to structured logging 2021-03-14 11:57:06 -04:00
Utsav Oza
2f3a4ec9cb Migrate remaining files in pkg/kubelet to structured logging 2021-03-12 22:36:28 +05:30
pacoxu
9e024e839b update structured log for policy_static.go 2021-03-12 16:26:20 +08:00
pacoxu
4cf80f160d update structured log for fake_cpu_manager.go 2021-03-12 16:06:52 +08:00
Amim Knabben
95db61e37b Structured log for topologymanager 2021-03-11 20:50:14 -05:00
David Porter
7b7c842eec kubelet: remove unused applyLimits function 2021-03-11 13:49:09 -08:00
changshuchao
bf18a1ca53 Add test case for state.go 2021-03-11 17:06:56 +08:00
shiyajuan123
d344fc612e fix and update 2021-03-10 14:58:17 +08:00
shiyajuan123
9cee635494 fix and update 2021-03-10 14:29:03 +08:00
Kubernetes Prow Robot
770a9504ea Merge pull request #95734 from fromanirh/podresources-concrete-resources-apis
podresources APIs: concrete resources apis: implement GetAllocatableResources
2021-03-09 14:29:04 -08:00
Utsav Oza
13513f9762 Migrate pkg/kubelet/cm/ top level files to structured logging 2021-03-09 23:15:24 +05:30
Francesco Romani
da55ef0b9a node: podresources: list devices without topology
It's legal for device plugins to not expose topology informations.
Previously, the code was just skipping these devices.
Review highlighted is better to report them anyway and let the
client application decide if they still want somehow to track them
or skip them entirely.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2021-03-09 13:13:37 +01:00
Francesco Romani
9c69db3f04 e2e: node: add tests for GetAllocatableResources
Add e2e tests for the new GetAllocatableResources API.
The tests are added in the `podresources_test` suite
created previously in this series.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2021-03-09 13:13:36 +01:00
Francesco Romani
8afdf4f146 node: podresources: translate types in cm
during the review, we convened that the manager types
(CPUSet, ResourceDeviceInstances) should not cross the
containermanager API boundary; thus, the ContainerManager layer
is the correct place to do the type conversion

We push back the type conversions from the podresources server
layer, fixing tests accordingly.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2021-03-09 13:13:36 +01:00
Francesco Romani
ad68f9588c node: podresources: make GetDevices() consistent
We want to make the return type of the GetDevices() method of the
podresources DevicesProvider interface consistent with
the newly added GetAllocatableDevices type.
This makes the code easier to read and reduces the coupling between
the podresourcesapi server and the devicemanager code.

No intended changes in behaviour, but the different return types
now requires some data massaging. Tests are updated accordingly.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2021-03-09 13:13:36 +01:00
Francesco Romani
6d33354e4c node: podresources: implement GetAllocatableResources API
Extend the podresources API implementing the GetAllocatableResources endpoint,
as specified in the KEPs:

https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2043-pod-resource-concrete-assigments
https://github.com/kubernetes/enhancements/pull/2404

Signed-off-by: Francesco Romani <fromani@redhat.com>
2021-03-09 13:13:36 +01:00
Francesco Romani
1375c5bdc7 node: podresources: make GetCPUs return cpuset
a upcoming patch wants to add GetAllocatableCPUs() returning a cpuset.
To make the code consistent and a bit more flexible, we change the
existing interface to also return a cpuset.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2021-03-09 13:13:36 +01:00
shiyajuan123
6b53f8c65d migrate kubelet/cm/container logs to structured logging 2021-03-09 18:27:54 +08:00
David Porter
904cb67267 Fixes after runc libcontainer and docker update
- libcontainer renamed
  `github.com/opencontainers/runc/libcontainer/configs` to
  `github.com/opencontainers/runc/libcontainer/devices` so use the new
  references

- Update `dockershim` `ContainerCreate` call after docker update to
  v20.10.2
2021-03-08 22:10:29 -08:00
Krzysztof Gibuła
e46b280f96 Replace klog with with testing.T logging in pkg/kubelet tests 2021-03-07 23:10:02 +01:00