Commit Graph

584 Commits

Author SHA1 Message Date
Hank Freund
af9b314fb4 Propagate backoff duration for crashloop backoff.
Fix lint issues.

Address review comments.

- Modify BackoffError to hold an absolute timestamp instead of duration
- Update pod sync loop to calculate the proper enqueue time based off
  this timestamp

Fix merge conflict error.

Address review comments.
2025-10-01 13:34:10 +00:00
Kubernetes Prow Robot
b18cfd6141 Merge pull request #132873 from tallclair/runtime-actuated
Make actuated resources an internal detail of the KubeGenericRuntimeManager
2025-09-10 11:48:13 -07:00
Ali Abbasi Alaei
9ca3159e34 Fix fake runtime's image pull
Fixed fake_runtime.PullImage to be blocked at the fake image pulling behavior,
not just before before returning
2025-09-09 19:40:23 -04:00
Ali Abbasi Alaei
a77fc586c7 Fix negative pod startup duration
Fixed an issue with the pod startup duration metric,
which may show negative values when parallel image pulling is enabled
2025-09-09 19:36:22 -04:00
Tim Allclair
82eb8bd23a Populate memory requests from actuated resources at pod status generation time 2025-09-08 12:56:01 -07:00
zhangzhifei16
80e6f9e20a chore(kubelet): migrate container to contextual logging
fix: the failed ci
2025-09-05 21:55:15 +08:00
Tim Allclair
09548c6bdf Move actuated resources state to kuberuntime.Manager 2025-09-03 15:53:45 -07:00
Stephen Kitt
81cec6df1d Bump to mockery v3
mockery has introduced breaking changes and switched to a v3 branch,
this migrates to that, mostly using the built-in migration tool. Mocks
are now generated in single files per package, except in packages
containing mocks for multiple interface packages (in
pkg/kubelet/container/testing).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2025-08-29 13:43:54 +02:00
Yuan Wang
9086e52fee Implement restart rules in kubelet 2025-07-24 16:49:54 +00:00
Tim Allclair
d9c91127d0 Check memory usage before decreasing limits 2025-07-17 13:17:35 -07:00
Kubernetes Prow Robot
93c1605310 Merge pull request #131083 from HirazawaUi/clean-return-value
kubelet: Remove the unused 'error' parameter return from the GeneratePodStatus method
2025-07-15 10:56:30 -07:00
PatrickLaabs
cfd65c5f74 chore: replacement of helper functions to ptr packge 2025-07-07 21:28:54 +02:00
Kubernetes Prow Robot
4dbfe24404 Merge pull request #132541 from acpana/acpana/helpers-tests
tests: add more units
2025-07-01 14:15:24 -07:00
Alex Pana
4c09aa9073 review: feedback
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
2025-06-30 22:53:40 +00:00
Alex Pana
776382daa5 review: assert
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
2025-06-30 21:19:21 +00:00
Alex Pana
43f6bd45f5 review: assert
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
2025-06-30 21:06:47 +00:00
Alex Pana
e82d4f8e55 review: feedback
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
2025-06-26 18:25:42 +00:00
Alex Pana
39dda2b88d tests: runtime units
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
2025-06-26 00:59:34 +00:00
Alex Pana
8bd8c14312 tests: add more units
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
2025-06-25 22:00:40 +00:00
zhangzhifei16
c1ff9cf4e8 chore: Upgrade the mockery version to v2.53.3. 2025-04-10 21:16:47 +08:00
HirazawaUi
ae08504ca6 Remove unneeded return values 2025-03-27 22:29:39 +08:00
Sreeram
70540c9f43 API changes 2025-03-25 01:56:45 +05:30
Ajay Sundar Karuppasamy
a09cb22e4d disable in-place vertical pod scaling for non-restartable swappable containers 2025-03-20 20:43:18 +00:00
Gunju Kim
657ccc3099 Ensure that the pod has the proper phase upon re-initialization
This fixes the pod with restartable init containers to have a proper
phase after the pod sandbox re-creation.

Currently, the `runtime.PodStatus` cannot retrieve the active container
statuses, which are the container statuses associated with the current
pod sandbox. This adds the `ActiveContainerStatuses` to
`runtime.PodStatus`, allowing it to include the container statuses of
the current pod sandbox, and fixes the kubelet to correctly set the pod
Phase to `Pending` when no active regular containers are present.
2025-03-20 17:38:41 +09:00
Natasha Sarkar
16abcd78bd [FG:InPlacePodVerticalScaling] surface pod resize actuation errors in pod resize conditions (#130902)
* surface pod resize actuation errors in pod resize conditions

* update kubelet unit tests

* fix all other kubelet unit tests

* fix linter error

* address feedback

* fix test failure
2025-03-19 20:12:54 -07:00
Stanislav Láznička
cb7468b077 kubelet imagepuller: PullImage() - accept TrackAuthConfigs directly
The image puller's PullImage() method should be just a dumb pull
without any further logic. Make it accept everything it needs
to pull an image and defer any other magic to the image manager.
2025-03-14 10:47:54 +01:00
Kubernetes Prow Robot
7b6c56e5fb Merge pull request #130135 from saschagrunert/image-volume-beta
[KEP-4639] Graduate image volume sources to beta
2025-03-12 18:03:58 -07:00
Anish Ramasekar
ad8666ce88 Update credential provider plugin to support using service account token
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-11 20:36:32 -07:00
Sascha Grunert
f9e5dd84ad Graduate image volume sources to beta
Graduate the feature to beta, by:

- Allowing `subPath`/`subPathExpr` for image volumes
- Modifying the CRI to pass down the (resolved) sub path
- Adding metrics which are outlined in the KEP

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-03-11 13:41:45 +01:00
Tim Allclair
bf8354d460 Revert "[FG:InPlacePodVerticalScaling] kubelet: Propagate error in doPodResizeAction() to the caller" 2024-11-07 22:43:59 -08:00
Kubernetes Prow Robot
30052523d7 Merge pull request #127300 from hshiina/error-propagation
[FG:InPlacePodVerticalScaling] kubelet: Propagate error in doPodResizeAction() to the caller
2024-11-08 02:20:57 +00:00
Tim Allclair
da9c2c553b Set pod watch conditions for resize 2024-11-06 11:05:24 -08:00
Hironori Shiina
5562cb165b kubelet: Propagate error in doPodResizeAction() to the caller
This fix makes doPodResizeAction() return the result instead of setting
an error to the `result` argument, which should have been passed as a
pointer, so that the error is propagated to the caller. This fix also
makes the usage of PodSyncResult more consistent with other operations
like starting and killing a container.
2024-11-05 16:37:29 +01:00
Kevin Hannon
c25563b9ab Fix a bug where container fs is considered split if imagefs and
containerfs are on the same drive but different path
2024-10-25 18:51:22 -04:00
Anish Shah
ac82e8a005 Revert "Fix issue in split filesystem where layers are stored on same disk but different paths"
This reverts commit aea0b90652.
2024-10-25 02:09:55 -07:00
Kubernetes Prow Robot
c4a14d7ef5 Merge pull request #126562 from kannon92/split-filesystem-on-same-disk
[KEP-4191]: Fix issue in split filesystem
2024-10-22 19:48:53 +01:00
Matthieu MOREL
f736cca0e5 fix: enable expected-actual rule from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-27 07:56:31 +02:00
Matthieu MOREL
27b98be303 fix: enable nil-compare and error-nil rules from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-25 06:02:47 +02:00
Matthieu MOREL
fa0e38981c fix: enable compares rule from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-22 11:20:05 +02:00
Ed Bartosh
e1bc8defac kubelet: Migrate DRA Manager to contextual logging
Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>
2024-08-22 11:12:41 +03:00
Kubernetes Prow Robot
b860feb2a6 Merge pull request #126540 from skitt/avoid-double-mock-headers
Handle all mock header generation with mockery
2024-08-15 15:39:51 -07:00
Kubernetes Prow Robot
702cea241d Merge pull request #123952 from kinvolk/rata/userns-add-tests-namespacesForPod
pkg/kubelet/kuberuntime: Add userns tests for NamespacesForPod
2024-08-14 04:23:22 -07:00
Kevin Hannon
aea0b90652 Fix issue in split filesystem where layers are stored on same disk but different paths 2024-08-07 10:43:19 -04:00
Stephen Kitt
f4ddb44c36 Handle all mock header generation with mockery
mockery is set up to generate headers in all the mocks it produces, so
the separate header generation in update-mocks.sh is no longer useful
(and leads to duplicate headers in three cases). This removes the
relevant parts of the shell script.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-08-05 11:19:37 +02:00
Kubernetes Prow Robot
581a073dc4 Merge pull request #125663 from saschagrunert/oci-volumesource-kubelet
[KEP-4639] Add `ImageVolumeSource` implementation
2024-07-22 15:48:33 -07:00
Sascha Grunert
979863d15c Add ImageVolumeSource implementation
This patch adds the kubelet implementation of the image volume source
feature.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-07-22 18:46:46 +02:00
Patrick Ohly
877829aeaa DRA kubelet: adapt to v1alpha3 API
This adds the ability to select specific requests inside a claim for a
container.

NodePrepareResources is always called, even if the claim is not used by any
container. This could be useful for drivers where that call has some effect
other than injecting CDI device IDs into containers. It also ensures that
drivers can validate configs.

The pod resource API can no longer report a class for each claim because there
is no such 1:1 relationship anymore. Instead, that API reports claim,
API devices (with driver/pool/device as ID) and CDI device IDs. The kubelet
itself doesn't extract that information from the claim. Instead, it relies on
drivers to report this information when the claim gets prepared. This isolates
the kubelet from API changes.

Because of a faulty E2E test, kubelet was told to contact the wrong driver for
a claim. This was not visible in the kubelet log output. Now changes to the
claim info cache are getting logged. While at it, naming of variables and some
existing log output gets harmonized.

Co-authored-by: Oksana Baranova <oksana.baranova@intel.com>
Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>
2024-07-22 18:09:34 +02:00
Kubernetes Prow Robot
a8d354bf39 Merge pull request #126122 from HirazawaUi/remove-unused-options
kubelet: Remove unused run container options
2024-07-19 18:05:16 -07:00
Rodrigo Campos
6f81aa6aa9 pkg/kubelet/kuberuntime: Add userns tests for NamespacesForPod
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-07-19 12:32:57 +02:00
HirazawaUi
0dbf1d3ceb remove kubelet unused run container options 2024-07-16 20:43:02 +08:00