Commit Graph

10870 Commits

Author SHA1 Message Date
git-jxj
a5b3a4b738
cleanup: Update deprecated FromInt to FromInt32 (#119858)
* redo commit

* apply suggestions from liggitt

* update Parse function based on suggestions
2023-08-16 09:33:01 -07:00
Kubernetes Prow Robot
19deb04a90
Merge pull request #118619 from TommyStarK/gh_113832
dynamic resource allocation: reuse gRPC connection
2023-08-16 09:32:27 -07:00
Kubernetes Prow Robot
419df231bc
Merge pull request #119709 from charles-chenzz/fix_flaky
fix flaky test on dra TestPrepareResources/should_timeout
2023-08-16 06:16:26 -07:00
Antonio Ojea
f355b22f5f implement Stringer for podActions
klog prints an internal error when trying to log the podActions struct.

> I0505 14:12:12.827065  190662 kuberuntime_manager.go:1014] "computePodActions got for pod" podActions="<internal error: json: unsupported type: map[container.ContainerID]kuberuntime.containerToKillInfo>" pod="kube-system/coredns-8f5847b64-mzw46"

Implement the stringer interface on the struct to avoid the json error.

Change-Id: I22444524a78a0ecec9490b9240def371a4129434
2023-08-07 22:48:28 +00:00
charles-chenzz
ba9ce3ab08 fix flaky test on dra TestPrepareResources/should_timeout
Co-authored-by: TommyStarK <thomasmilox@gmail.com>
2023-08-03 22:37:54 +08:00
Kubernetes Prow Robot
d4fde1e92a
Merge pull request #118549 from a7i/kubelet-prober-metric-pod
fix 'pod' in kubelet prober metrics
2023-07-26 18:28:06 -07:00
Paco Xu
c4bf42199a do not touch swap for cgroup v1 if swap not enabled 2023-07-21 13:27:50 +08:00
TommyStarK
60a8bca507 dynamic resource allocation: add unit test to check the reuse of the gRPC connection
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-07-20 19:22:25 +02:00
TommyStarK
7ffd3063ce dynamic resource allocation: reuse gRPC connection
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-07-19 10:12:52 +02:00
Kevin Klues
0449cef8fd Increase timeout for DRA kubelet plugin client
The 10 second timeout was too low. Given that the retry loop for the
kubelet itself is 90s, increasing the timeout to half of this seems
reasonable. Ideally we would pull in the variable that sets the retry
timeout to 90s and then just set our local timeout to half of that.
Unfortunately, this is not exported, so we settle (for now with just
explicitly setting it to 45s.

Signed-off-by: Kevin Klues <kklues@nvidia.com>
2023-07-18 22:45:01 +01:00
Kubernetes Prow Robot
238165450a
Merge pull request #119307 from bart0sh/PR121-DRA-UnprepareResources-Dont-Query-claim
DRA: don't query claims from API server
2023-07-18 11:07:21 -07:00
Kubernetes Prow Robot
6b0e66abad
Merge pull request #116968 from mansikulkarni96/windowsStatsFromCRI
kubelet: Implement support for Windows podAndContainerStatsFromCRI
2023-07-18 11:07:10 -07:00
Ed Bartosh
0ec99fb0b2 Kubelet DRA: fix failing test cases 2023-07-18 19:06:33 +03:00
Ed Bartosh
f6431c6138 DRA: don't query claims from API server
When a pod is force-deleted UnprepareResources fails to get a claim
from an API server.
PrepareResources should cache claim info required by the
UnprepareResources so that UnprepareResources would get it from
the cache instead of querying API server.
2023-07-18 18:23:10 +03:00
Kubernetes Prow Robot
6d83e22ba4
Merge pull request #118711 from TommyStarK/tom/gh_118436
add unit test for dra/manager.go
2023-07-18 04:17:09 -07:00
charles-chenzz
0372e4b662 add unit test for dra/manager.go.
Co-Authored-By: charles-chenzz <Rekles666@gmail.com>
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-07-18 12:14:27 +02:00
Kubernetes Prow Robot
b4d793c450
Merge pull request #118865 from iholder101/kubelet/add-swap-to-summary-stats
Add swap to stats to Summary API and Prometheus endpoints (`/stats/summary` and `/metrics/resource`)
2023-07-17 19:49:18 -07:00
Kubernetes Prow Robot
da2fdf8cc3
Merge pull request #118764 from iholder101/Swap/burstableQoS-impl
Add full cgroup v2 swap support with automatically calculated swap limit for LimitedSwap and Burstable QoS Pods
2023-07-17 19:49:07 -07:00
Kubernetes Prow Robot
d17f3ba2cf
Merge pull request #119168 from gjkim42/sidecar-allow-probes-and-lifecycle-hooks
Allow all probes and lifecycle for restartable init containers
2023-07-17 18:11:07 -07:00
Itamar Holder
e429793db1 Unit tests: node swap usage resource metric
Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-18 02:55:56 +03:00
Itamar Holder
1d368420b2 Add a node swap usage resource metric (/metrics/resource)
Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-18 02:55:56 +03:00
Itamar Holder
7d187f967b Unit tests: CRI swap stats
Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-18 02:55:56 +03:00
Itamar Holder
59e3e3897e Add SwapStats to summary API through CRI
Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-18 02:55:56 +03:00
Itamar Holder
87ff9c4525 Add swap statistics to CRI-API
Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-18 02:55:53 +03:00
Itamar Holder
053d7ac61f Unit tests: cadvisor swap stats
Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-18 02:40:02 +03:00
Itamar Holder
c74ee8045d Add SwapStats to summary API through cadvisor
Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-18 02:40:02 +03:00
Gunju Kim
9d6c1030db
Generate containers ready condition including restartable init containers 2023-07-18 08:12:24 +09:00
Gunju Kim
3bf282652f
Allow restartable init containers to have lifecycle 2023-07-18 08:12:24 +09:00
Gunju Kim
7ef2d674e2
Allow restartable init containers to have livenessProbe 2023-07-18 07:54:33 +09:00
Gunju Kim
2c8b37498e
Allow restartable init containers to have readinessProbe 2023-07-18 07:54:33 +09:00
Kubernetes Prow Robot
ff90c1cc73
Merge pull request #119374 from danwinship/kep-3178-ga
move KEP-3178 IPTablesOwnershipCleanup to GA
2023-07-17 15:53:47 -07:00
Kubernetes Prow Robot
1fef8fd51d
Merge pull request #118770 from marquiz/devel/cgroup-driver-autoconfig
kubelet: get cgroup driver config from CRI
2023-07-17 15:53:18 -07:00
Kubernetes Prow Robot
a776bf0462
Merge pull request #116335 from gnufied/update-api-recovery-apis
Update api recovery apis
2023-07-17 14:52:35 -07:00
Dan Winship
f1e7386fbc Deprecate now-unused kubelet iptables flags 2023-07-17 16:51:47 -04:00
Dan Winship
d486736dd3 Remove IPTablesOwnershipCleanup checks and dead code 2023-07-17 16:51:47 -04:00
Kubernetes Prow Robot
92856db662
Merge pull request #118973 from ffromani/kubelet-podresources-getallocatable-ga
node: podresources: getallocatable: move to GA
2023-07-17 13:47:33 -07:00
Kubernetes Prow Robot
42141aaf93
Merge pull request #118578 from bart0sh/PR117-DRA-log-manager-errors
DRA: report NodePrepareResource errors
2023-07-17 13:47:13 -07:00
Hemant Kumar
e011187114 Update code to use new generic allocatedResourceStatus field 2023-07-17 15:30:35 -04:00
Markus Lehtonen
d2d5e2e27d Add CRI fake runtimes for RuntimeConfig rpc
Also update the CRI RuntimeService inteface to include the new
RuntimeConfig rpc.
2023-07-17 12:27:04 -04:00
Kubernetes Prow Robot
bdcf812c95
Merge pull request #118254 from elezar/4009/add-cdi-devices-to-device-plugin
Add CDI devices to device plugin API
2023-07-17 05:21:08 -07:00
Ed Bartosh
229eb93a83 DRA: report NodePrepareResource errors
Log an error and submit an event when NodePrepareResource fails.
2023-07-17 12:56:28 +03:00
Evan Lezar
b57c7e2fe4 Add CDI devices to device plugin API
This change adds CDI device IDs to the ContainerAllocateResponse in the
device plugin API. This allows a device plugin to specify CDI devices
by their unique fully-qualified CDI device names using the related field
in the CRI specification.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2023-07-17 11:53:09 +02:00
Kubernetes Prow Robot
71f8a2405d
Merge pull request #119333 from liggitt/flushfrequencystring
Conditionally serialize flushFrequency as int
2023-07-16 07:09:06 -07:00
Jordan Liggitt
6c0ea702d4
Conditionally serialize flushFrequency as int 2023-07-16 08:37:37 -04:00
Kubernetes Prow Robot
900237fada
Merge pull request #118635 from ffromani/devmgr-check-pod-running
kubelet: devices: skip allocation for running pods
2023-07-15 05:43:16 -07:00
Kubernetes Prow Robot
8a0ea1bd58
Merge pull request #109616 from wzshiming/feat/pod-host-ips
Field `status.hostIPs` added for Pod
2023-07-15 00:31:04 -07:00
Kubernetes Prow Robot
cab65e2008
Merge pull request #118816 from PiotrProkop/topo-opts-to-beta
topologymanager: Promote support for improved multi-numa alignment in Topology Manager to beta
2023-07-14 16:55:08 -07:00
Itamar Holder
4b6314f815 Unit test: Swap - Limited/Unlimited Swap, cgroups v1/v2, etc
Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-14 14:52:28 +03:00
Itamar Holder
a30410d9ce LimitedSwap: Automatically configure swap limit for Burstable QoS Pods
After this commit, when LimitedSwap is enabled,
containers would get swap acess limited with respect
the container memory request, total physical memory
on the node, and the swap size on the node.

Pods of Best-Effort / Guaranteed QoS classes don't get
to swap. In addition, container with memory requests
that are equal to their memory limits also don't get to
swap.

The swap limitation is calculated in the following way:
1. Calculate the container's memory proportionate to the node's memory:
- Divide the container's memory request by the total node's physical memory.
  Let's call this value ContainerMemoryProportion.

2. Multiply the container memory proportion by the available
swap memory for Pods:
Meaning: ContainerMemoryProportion * TotalPodsSwapAvailable.

Fore more information:
https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2400-node-swap/README.md

Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-14 14:52:28 +03:00
Itamar Holder
e4da568f33 Make kuberuntime unit tests environment independent + support cgroup v2
Before this commit, to find out the current node's
cgroup version, a libcontainers function was used
directly. This way, cgroup version is hard to mock
and is dependant on the environment in which the unit
tests are being run.

After this commit, libcontainer's function is wrapped
within a variable function that can be re-assigned by
the tests. This way the test can easily mock the cgroup
version and become environment independant.

After this commit both cgroup versions v1 and v2
are being tested, no matter in which environment
it runs.

Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-14 14:52:27 +03:00