Commit Graph

11054 Commits

Author SHA1 Message Date
likakuli
e167ecbb9e fix: only invoke AddReference first time when to sync same pod to minimize unnecessary API requests to the API server for the configmap/secret get API
Signed-off-by: likakuli <1154584512@qq.com>
2023-08-31 22:56:49 +08:00
Harshal Patil
2e174a029f Add timeout to listContainerStats context
Signed-off-by: Harshal Patil <harpatil@redhat.com>
2023-08-30 10:49:44 -04:00
ithrael
e187368242 fix(test): fix TestGetPodResourcesV1 comparison logic in tests 2023-08-30 10:39:58 +08:00
Sohan Kunkerkar
d5690f12b6 pkg/kubelet: allow sandbox image pinning from CRI
As part of this change, the code responsible for managing the sandbox
image within the kubelet has been removed. Previously, the kubelet used
to prevent sandbox image from the garbage collection process. However,
with this update, the responsibility of managing the sandbox containers
has been shifted to the CRI implementation itself. By allowing sandbox
image pinning from CRI, we improve efficiency and simplify the kubelet's
interaction with the container runtime. As a result, the kubelet can now
rely on the container runtime's built-in mechanisms for sandbox container
lifecycle management.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
2023-08-29 15:34:51 -04:00
cvvz
03126c5465 add comment 2023-08-29 10:46:31 +08:00
ithrael
9a24dd2c27 fix(test): fix error comparison in GetPodResourcesV1 test 2023-08-28 18:55:12 +08:00
cvvz
94d03ccc83 Squashed commit of the following:
commit d623614de31fe411f1dcb1e784472135f3ca0c5e
Merge: 8054af3b303 91344b4008
Author: cvvz <ftdchenwz@gmail.com>
Date:   Mon Aug 28 18:43:49 2023 +0800

    Merge branch 'master' of https://github.com/kubernetes/kubernetes into fix-volumemanager-logs

commit 8054af3b303e10e7b74b1ba4d3c4035f488cbdad
Author: cvvz <ftdchenwz@gmail.com>
Date:   Fri Aug 25 22:03:08 2023 +0800

    fix

commit b414972831c4e4030162ee385d8f600e1e0257ac
Author: cvvz <ftdchenwz@gmail.com>
Date:   Fri Aug 25 21:41:36 2023 +0800

    fix

commit ebea00a8dd50eb3d8859a912b464bbda5548b1d4
Author: cvvz <ftdchenwz@gmail.com>
Date:   Fri Aug 25 20:54:40 2023 +0800

    123

commit 9f6f1dbbe717fa34e1c13fec645f4c474cbf99a0
Author: cvvz <ftdchenwz@gmail.com>
Date:   Fri Aug 25 20:53:16 2023 +0800

    add MarshalLog

commit d7d2878409343df937c770d6796f8c125e18ce7a
Author: cvvz <ftdchenwz@gmail.com>
Date:   Tue Aug 8 23:57:47 2023 +0800

    fix volumemanager logs
2023-08-28 18:44:40 +08:00
ithrael
d680bc540b fix(test): fix error handling condition in test 2023-08-27 21:11:39 +08:00
cvvz
56c241783e fix 2023-08-25 19:56:54 +08:00
cvvz
ab1f97bd6e fix 2023-08-25 19:55:56 +08:00
Patrick Ohly
2472291790 api: introduce separate VolumeResourceRequirements struct
PVC and containers shared the same ResourceRequirements struct to define their
API. When resource claims were added, that struct got extended, which
accidentally also changed the PVC API. To avoid such a mistake from happening
again, PVC now uses its own VolumeResourceRequirements struct.

The `Claims` field gets removed because risk of breaking someone is low:
theoretically, YAML files which have a claims field for volumes now
get rejected when validating against the OpenAPI. Such files
have never made sense and should be fixed.

Code that uses the struct definitions needs to be updated.
2023-08-21 15:31:28 +02:00
Eric Lin
286628b030 Fix error message for invalid resource reservation
Signed-off-by: Eric Lin <exlin@google.com>
2023-08-20 12:55:26 +00:00
Kubernetes Prow Robot
addc0391e7 Merge pull request #116897 from Richabanker/kubelete-resource-metrics-ga
Graduate kubelet resource metrics to GA
2023-08-18 16:03:37 -07:00
Richa Banker
4712025ea8 Graduate kubelet resource metrics to GA 2023-08-17 09:22:48 -07:00
ruiwen-zhao
5bbc4f7605 Pass Pinned field to kubecontainer.Image
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2023-08-17 00:32:59 +00:00
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
cvvz
e40d00cf53 fix: 119921 2023-08-13 15:52:25 +08:00
Sascha Grunert
b9cf6991e6 Use tracing semconv types instead of own defines
To keep things in sync when adding new traces, we now use the official
semconv types of OTEL rather than our own values.

Nothing should change for now behavior wise.

Refers to https://github.com/kubernetes/kubernetes/pull/119771

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-08-11 09:24:34 +02: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
Qian Xiao
0944c00778 Fix some typo in kubelet component source code 2023-08-03 23:56:50 -07: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
TommyStarK
391c1a3ecc dra: cleanup manager unit tests
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-08-02 23:35:45 +02: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
Liang Deng
18c46b2487 add validation for static pods to have a name
Signed-off-by: Liang Deng <283304489@qq.com>
2023-07-26 09:47:11 +08: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