Commit Graph

376 Commits

Author SHA1 Message Date
Patrick Ohly
ad79e479c2 build: remove deprecated '// +build' tag
This has been replaced by `//build:...` for a long time now.

Removal of the old build tag was automated with:

    for i in $(git grep -l '^// +build' | grep -v -e '^vendor/'); do if ! grep -q '^// Code generated' "$i"; then sed -i -e '/^\/\/ +build/d' "$i"; fi; done
2025-12-18 12:16:21 +01:00
Heba
aceb89debc KEP-5471: Extend tolerations operators (#134665)
* Add numeric operations to tolerations

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* code review feedback

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* add default feature gate

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add integration tests

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add toleration value validation

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add validate options for new operators

Signed-off-by: helayoty <heelayot@microsoft.com>

* Remove log

Signed-off-by: helayoty <heelayot@microsoft.com>

* Update feature gate check

Signed-off-by: helayoty <heelayot@microsoft.com>

* emove IsValidNumericString func

Signed-off-by: helayoty <heelayot@microsoft.com>

* Implement IsDecimalInteger

Signed-off-by: helayoty <heelayot@microsoft.com>

* code review feedback

Signed-off-by: helayoty <heelayot@microsoft.com>

* Add logs to v1/toleration

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>
Signed-off-by: helayoty <heelayot@microsoft.com>

* Update integration tests and address code review feedback

Signed-off-by: helayoty <heelayot@microsoft.com>

* Add feature gate to the scheduler framework

Signed-off-by: helayoty <heelayot@microsoft.com>

* Remove extra test

Signed-off-by: helayoty <heelayot@microsoft.com>

* Fix integration test

Signed-off-by: helayoty <heelayot@microsoft.com>

* pass feature gate via TolerationsTolerateTaint

Signed-off-by: helayoty <heelayot@microsoft.com>

---------

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>
Signed-off-by: helayoty <heelayot@microsoft.com>
2025-11-10 12:42:54 -08:00
zhangzhifei16
84b78307e2 fix: the failed unit test 2025-10-14 22:01:35 +08:00
zhangzhifei16
5170982540 chore(kubelet): migrate eviction to contextual logging
fix: add context

kubelet: pass context to initializeRuntimeDependentModules
2025-09-08 22:15:32 +08:00
HirazawaUi
43c3b03685 Lock AllowOverwriteTerminationGracePeriodSeconds 2025-09-04 19:25:26 +08: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
Kevin Torres
13b122b6ff Unit tests for pod level resources eviction manager 2025-07-24 17:07:09 +00:00
Kevin Torres
9a3ca05f6b Use pod level resources for eviction manager 2025-07-24 17:07:05 +00:00
Natasha Sarkar
92359cdc69 update godoc for and rename observedGeneration helpers 2025-04-24 16:05:01 +00:00
zhangzhifei16
c1ff9cf4e8 chore: Upgrade the mockery version to v2.53.3. 2025-04-10 21:16:47 +08:00
Natasha Sarkar
4c2be4bdde kubelet sets observedGeneration in conditions 2025-03-18 15:43:24 +00:00
Kubernetes Prow Robot
0eaee48ecb Merge pull request #130569 from dims/update-to-latest-cadvisor-v0.52.0
Update to latest cadvisor @ v0.52.1 and new opencontainer/cgroups and drops opencontainers/runc
2025-03-07 17:09:51 -08:00
Davanum Srinivas
5ecddb6571 update to latest cadvisor @ v0.52.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-03-05 06:36:39 -05:00
Mark Rossetti
ec165ca560 fixing k8s.io/kubernetes/pkg/kubelet/eviction unit tests on Windows
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2025-02-12 16:57:19 -08:00
Patrick Ohly
8a908e0c0b remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".
2024-12-02 16:59:34 +01:00
Kubernetes Prow Robot
ad9dad07a8 Merge pull request #127874 from AnishShah/image-gc-eviction
Cleanup unused images or containers first when eviction manager detects ContainerFsInodesFree signal
2024-11-05 02:39:28 +00:00
Kevin Hannon
48dc7d3267 add TODO for image fs 2024-11-01 08:46:55 -04:00
Kevin Hannon
742ca47e72 bug: fix a bug when the check for dedicated container fs fails 2024-10-25 18:52:42 -04: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
Kubernetes Prow Robot
b3cf9c6e5c Merge pull request #128269 from tallclair/allocated
[FG:InPlacePodVerticalScaling] Rework handling of allocated resources
2024-10-25 23:24:52 +01:00
Kubernetes Prow Robot
d3fd5940e4 Merge pull request #128333 from AnishShah/eviction-manager
Revert #126562 that is causing eviction tests to fail
2024-10-25 21:22:52 +01:00
Anish Shah
9faab07dda fix lint errors 2024-10-25 11:15:31 -07:00
Kubernetes Prow Robot
aec2ea1877 Merge pull request #124609 from AxeZhan/refac
Move some helper functions from api/v1 to component-helpers
2024-10-25 17:26:52 +01: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
AxeZhan
2ffb568540 rename functions 2024-10-25 12:53:24 +08:00
Tim Allclair
321eff34f7 Rework allocated resources handling 2024-10-24 09:27:40 -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
Anish Shah
9b630cf28c deflake ImageGCNoEviction test 2024-10-05 04:11:06 +00:00
Matthieu MOREL
b7248077a9 fix: enable formatter rule from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-26 08:19:54 +02:00
Kubernetes Prow Robot
2ade53e264 Merge pull request #124947 from toVersus/fix/eviction-message
[Sidecar Containers] Consider init containers in eviction message
2024-09-24 08:58:00 +01:00
HirazawaUi
7c85784b9f fix the bug where pod grace period will be overwritten 2024-09-20 22:25:01 +08:00
Tsubasa Nagasawa
1d0777ac84 Consider init containers in eviction message
Signed-off-by: Tsubasa Nagasawa <toversus2357@gmail.com>
2024-09-18 13:49:35 +09:00
TommyStarK
2414cfdff5 kubelet/eviction: improve unit test coverage
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2024-08-29 00:59:47 +02: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
Kevin Hannon
7d8ba7849b priority pid tests should match on processes
pids 0
process should not be nonzero
2024-07-22 10:54:42 -04:00
Mark Rossetti
0411a3d565 Add support for memory pressure evictiong on Windows
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2024-07-17 15:11:30 -07:00
carlory
850bc09e9b clean up codes after PodDisruptionConditions was promoted to GA and locked to default 2024-07-11 10:40:21 +08:00
Kubernetes Prow Robot
4a214f6ad9 Merge pull request #125461 from mimowo/pod-disruption-conditions-ga
Graduate PodDisruptionConditions to stable
2024-07-09 11:08:13 -07:00
Kubernetes Prow Robot
34b8832edb Merge pull request #125631 from SergeyKanzhelev/logFailedAdmission
improve logging of pod admission denied
2024-06-28 19:36:20 -07:00
Kubernetes Prow Robot
16b7d5310a Merge pull request #125047 from zhanluxianshen/clean-typos-in-kubelet
clean typos logs in kubelet.
2024-06-28 16:48:24 -07:00
Michal Wozniak
780191bea6 review remarks for graduating PodDisruptionConditions 2024-06-28 17:32:27 +02:00
Michal Wozniak
bf0c9885a4 Graduate PodDisruptionConditions to stable 2024-06-28 16:36:51 +02:00
Sergey Kanzhelev
e8e2fda5c3 improve logging of pod admission denied 2024-06-21 17:46:49 +00:00
Stephen Kitt
3f36c83c68 Switch to stretchr/testify / mockery for mocks
testify is used throughout the codebase; this switches mocks from
gomock to testify with the help of mockery for code generation.

Handlers and mocks in test/utils/oidc are moved to a new package:
mockery operates package by package, and requires packages to build
correctly; test/utils/oidc/testserver.go relies on the mocks and fails
to build when they are removed. Moving the interface and mocks to a
different package allows mockery to process that package without
having to build testserver.go.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-06-20 19:42:53 +02:00
zhanluxianshen
e5c229fafa clean typos logs in kubelet. 2024-05-22 16:56:06 +08:00
Kubernetes Prow Robot
a7ece470e5 Merge pull request #124063 from olyazavr/immediate-eviction-grace-period-fix
fix grace period used for immediate evictions
2024-05-15 16:14:12 -07:00
Marek Siarkowicz
3ee8178768 Cleanup defer from SetFeatureGateDuringTest function call 2024-04-24 20:25:29 +02:00
Olga Shestopalova
0af674a459 fix grace period used for immediate evictions
Signed-off-by: Olga Shestopalova <oshestopalova@hubspot.com>
2024-03-27 14:55:56 -04:00
Stephen Kitt
6bf667af06 Switch from golang/mock to uber-go/mock
See https://github.com/golang/mock#gomock: golang/mock is no longer
maintained, and should be replaced by go.uber.org/mock.

This allows golang/mock to be dropped from the status and vendored
fields in unwanted-dependencies.json.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-03-07 09:12:16 +01:00
reinka
0f083966a7 set actual podToMake values 2024-02-25 19:28:22 +01:00