Commit Graph

134908 Commits

Author SHA1 Message Date
Patrick Ohly
c69259cb71 DRA device taints: switch to workqueue in controller
The approach copied from node taint eviction was to fire off one goroutine per
pod the intended time. This leads to the "thundering herd" problem: when a
single taint causes eviction of several pods and those all have no or the same
toleration grace period, then they all get deleted concurrently at the same
time.

For node taint eviction that is limited by the number of pods per node, which
is typically ~100. In an integration test, that already led to problems with
watchers:

   cacher.go:855] cacher (pods): 100 objects queued in incoming channel.
   cache_watcher.go:203] Forcing pods watcher close due to unresponsiveness: key: "/pods/", labels: "", fields: "". len(c.input) = 10, len(c.result) = 10, graceful = false

It also causes spikes in memory consumption (mostly the 2KB stack per goroutine
plus closure) with no upper limit.

Using a workqueue makes concurrency more deterministic because there is an
upper limit. In the integration test, 10 workers kept the watch active.

Another advantage is that failures to evict the pod get retried with
exponential backoff per affected pod forever. Previously, evicting was tried a
few times with a fixed rate and then the controller gave up. If the apiserver
was down long enough, pods didn't get evicted.
2025-10-31 18:11:19 +01:00
Patrick Ohly
e5fcd20a26 DRA device taints: tighten controller test
We know how often the controller should get a pod, let's check it.
Must run before we do our own GET call.
2025-10-31 18:11:18 +01:00
Patrick Ohly
6ebd853f17 DRA: implementation of none taint effect
While at it, ensure that future unknown effects are treating like
the None effect.
2025-10-31 18:11:18 +01:00
Patrick Ohly
75c9186792 generated files 2025-10-31 18:11:18 +01:00
Patrick Ohly
e4dda7b282 DRA device taints: fix DeviceTaintRule + missing slice case
When the ResourceSlice no longer exists, the ResourceSlice tracker didn't and
couldn't report the tainted devices even if they are allocated and in use. The
controller must keep track of DeviceTaintRules itself and handle this scenario.

In this scenario it is impossible to evaluation CEL expressions because the
necessary device attributes aren't available. We could:
- Copy them in the allocation result: too large, big change.
- Limit usage of CEL expressions to rules with no eviction: inconsistent.
- Remove the fields which cannot be supported well.

The last option is chosen.

The tracker is now no longer needed by the eviction controller. Reading
directly from the informer means that we cannot assume that pointers are
consistent. We have to track ResourceSlices by their name, not their pointer.
2025-10-31 18:11:18 +01:00
Patrick Ohly
fee14ffca2 DRA API: device taints 1.35
This raises the number of allowed taints per device to 16 by lowering
the number of allowed devices to 64 per ResourceSlice if (and only if!)
taints are used.

"effect: None" and DeviceTaintRule status with conditions get added
to support giving feedback to admins.

Instead of merely adding the new effect value, this also changes validation of
the enum so that unknown values are valid if they were already stored. This
will simplify adding new effects in the future because validation won't fail
for them after a downgrade. Consumers must treat them like this new None
effect, i.e. ignore them.
2025-10-31 18:11:18 +01:00
Kubernetes Prow Robot
5caeb4171d Merge pull request #134855 from sprait/fix-nil-deref-container-status
kubelet: add nil check for ContainerStatus in GetContainerStatus
2025-10-31 10:10:14 -07:00
Kubernetes Prow Robot
f66d1a9418 Merge pull request #133779 from carlory/kubelet-cleanup-pod-infra-container-image
Remove deprecated pod-infra-container-image flag
2025-10-31 10:10:07 -07:00
Kubernetes Prow Robot
ef1eb4bef8 Merge pull request #135006 from p0lyn0mial/upstream-watchlist-unsupported-wl-kubelet-fake-pod-lw
kubelet/config/apiserver_test: expose IsWatchListSemanticsUnSupported on fakePodLW
2025-10-31 08:32:15 -07:00
Kubernetes Prow Robot
83504f1b02 Merge pull request #134466 from mortent/AllowAllocationModeAllMultinodeResourcePools
DRA: Allow AllocationMode: All from multi-node resource pools
2025-10-31 08:32:06 -07:00
Abu Kashem
11e3147fdd kubelet: add a test to verify that dra plugin enforces timeout 2025-10-31 11:16:54 -04:00
Hemant Kumar
c71e45c735 Implement a csimanager for managing storage related assets 2025-10-31 11:06:58 -04:00
Siyuan Zhang
d4c6e0bfd0 change client go default features to versioned
so that their enablement can be consistent with emulated version.

Signed-off-by: Siyuan Zhang <sizhang@google.com>
2025-10-31 10:04:06 -05:00
Kubernetes Prow Robot
4ca91a6542 Merge pull request #134994 from liggitt/drop-strict-cost
Drop locked StrictCostEnforcementForVAP and StrictCostEnforcementForWebhooks feature gates
2025-10-31 07:38:12 -07:00
Kubernetes Prow Robot
ce7ba8aa76 Merge pull request #134959 from atiratree/deployment-integration-tests
add integration tests for pod replacement during scaling and Recreate/RollingUpdate strategies
2025-10-31 07:38:04 -07:00
Abu Kashem
344df7835c refactor dra fake grpc server 2025-10-31 10:11:49 -04:00
Kubernetes Prow Robot
3c2e64ec78 Merge pull request #135005 from p0lyn0mial/upstream-watchlist-unsupported-wl-tracker-wrapp
apiserver/pkg/admission/plugin/policy/test: wrap trackers with ToListWatcherWithWatchListSemantics
2025-10-31 05:40:18 -07:00
Kubernetes Prow Robot
02398258b1 Merge pull request #135004 from pohly/dependencies-x-repos
dependencies: various minor updates
2025-10-31 05:40:11 -07:00
Kubernetes Prow Robot
ad13a96a1f Merge pull request #134811 from p0lyn0mial/upstream-watchlist-unsupported-wl-cache-testing
client-go/tools/cache/test: wrap the LW with toListWatcherWithUnSupportedWatchListSemantics
2025-10-31 05:40:03 -07:00
Kubernetes Prow Robot
f1989437f8 Merge pull request #135002 from p0lyn0mial/upstream-watchlist-unsupported-wl-client-tools-watch-test
client-go/tools/watch/test: wrap the LW with toListWatcherWithUnSupportedWatchListSemantics
2025-10-31 04:50:03 -07:00
Lukasz Szaszkiewicz
1951e8dd88 kubelet/config/apiserver_test: expose IsWatchListSemanticsUnSupported on fakePodLW 2025-10-31 12:37:34 +01:00
Rodrigo Campos
05f5051be3 kubelet/userns: Print podUID on errors
We recently received this bug report: #132966. The issue seems to be
that the new range configured doesn't work for existing pods on the
node, and therefore the kubelet fails to start.

While I'll also improve the documentation to mention you need to drain
the node, let's also improve the error message saying which pod this
error comes from.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-10-31 12:06:30 +01:00
Kubernetes Prow Robot
279f214cc5 Merge pull request #134989 from alaypatel07/extended-resources-scheduler-perf
refactor scheduler_perf test for extended resources by dra to have 10-50 device classes
2025-10-31 03:52:12 -07:00
Kubernetes Prow Robot
299a4fc2d2 Merge pull request #134847 from prometherion/feat/kubeadm-dns-signature
refactor(kubeadm): including dns addon version to signature
2025-10-31 03:52:05 -07:00
Lukasz Szaszkiewicz
35423364e2 apiserver/pkg/admission/plugin/policy/test: wrap trackers with ToListWatcherWithWatchListSemantics 2025-10-31 11:43:18 +01:00
Patrick Ohly
5993782d65 dependencies: various minor updates
This is a collection of updating several unversioned modules. Those updates are
eventually going to reach Kubernetes, doing them together now makes PRs for
future major updates smaller.
2025-10-31 11:30:26 +01:00
Kubernetes Prow Robot
e23dbe1f6e Merge pull request #135000 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics-trackers
k8s.io/client-go/testing/fixture: does not support WatchList semantics
2025-10-31 02:52:11 -07:00
Kubernetes Prow Robot
710c80f72a Merge pull request #133503 from p0lyn0mial/upstream-disable-panic-watch-decode-err-for-integration
test-integration: set KUBE_PANIC_WATCH_DECODE_ERROR to false
2025-10-31 02:52:03 -07:00
Lukasz Szaszkiewicz
9e462123d6 client-go/tools/watch/test: wrap the LW with toListWatcherWithUnSupportedWatchListSemantics 2025-10-31 10:16:25 +01:00
Lukasz Szaszkiewicz
ae201951a8 k8s.io/client-go/tools/cache/test: wrap the LW with toListWatcherWithUnSupportedWatchListSemantics 2025-10-31 10:11:18 +01:00
Kubernetes Prow Robot
d8f8b017e1 Merge pull request #134941 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics-cacher-consistency-checker
apiserver/pkg/storage/cacher/lister_watcher: pass RV for request from the watchlist consistency checker
2025-10-31 01:50:02 -07:00
Swati Sehgal
f2257059d7 node: cm: fix linter failures
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2025-10-31 08:14:49 +00:00
Lukasz Szaszkiewicz
1055d8541e k8s.io/client-go/testing/fixture: does not support WatchList semantics 2025-10-31 09:06:05 +01:00
Lukasz Szaszkiewicz
1ca34bd0d2 apiserver/pkg/storage/cacher/lister_watcher: pass RV for request from the watchlist consistency checker 2025-10-31 09:02:51 +01:00
Nikolay Gorbatov
040516a6e7 fix linter changes 2025-10-31 11:44:17 +04:00
Swati Sehgal
67280d4df9 node: cm: update mocks for contextual logging migration
Autogenerated by running:
```
./hack/update-mocks.sh
```
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2025-10-31 06:50:28 +00:00
Kubernetes Prow Robot
b4d4cc9384 Merge pull request #123642 from aramase/aramase/f/kep_3331_jwks_metrics
Add JWKS fetch metrics for jwt authenticator
2025-10-30 22:42:02 -07:00
Jordan Liggitt
bd11e52bfc Drop locked StrictCostEnforcementForVAP and StrictCostEnforcementForWebhooks feature gates 2025-10-31 00:03:42 -04:00
Kubernetes Prow Robot
a13ad97048 Merge pull request #134949 from natasha41575/ippr-ga
Promote InPlacePodVerticalScaling to GA
2025-10-30 20:06:01 -07:00
carlory
b3415bfdfe kubeadm: added container runtime version check to preflight
Co-authored-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-10-31 09:51:01 +08:00
Kubernetes Prow Robot
76103bec09 Merge pull request #134963 from yongruilin/master_maxitem-rcs
feat(dra): Migrate maxItems and uniqueness declarative validation for NetworkDeviceData.IPs and DeviceAllocationConfiguration.Requests
2025-10-30 17:22:01 -07:00
yongruilin
d80ac77d98 feat(dra): add k8s:optional for all DV migrated optional fields 2025-10-30 23:31:01 +00:00
Kubernetes Prow Robot
1ffcea577b Merge pull request #134984 from michaelasp/crdObsGeneration
Add ObservedGeneration to CRD conditions
2025-10-30 16:22:02 -07:00
Michael Aspinwall
cde15e6450 Add ObservedGeneration to CRD conditions 2025-10-30 22:30:01 +00:00
Alay Patel
02289d08f6 refactor scheduler_perf test for extended resources by dra to have 10-50 device classes
Signed-off-by: Alay Patel <alayp@nvidia.com>
2025-10-30 16:55:32 -04:00
Kubernetes Prow Robot
9efb7ee538 Merge pull request #134313 from richabanker/statusz-structured
[KEP:4827] Structured statusz
2025-10-30 13:16:10 -07:00
Kubernetes Prow Robot
fb69410824 Merge pull request #133980 from siyuanfoundation/min-compat
[KEP-4330] add min-compatibility-version to control plane.
2025-10-30 13:16:03 -07:00
Kubernetes Prow Robot
31f83cdf2b Merge pull request #134647 from torredil/kadane-6123912
Enable `MutableCSINodeAllocatableCount` by default in Beta
2025-10-30 11:50:03 -07:00
Siyuan Zhang
67143028e7 Add --min-compatibility flag.
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2025-10-30 13:36:38 -05:00
Swati Sehgal
05f67d834a node: cm: migrate container manager to contextual logging
This commit migrates the container manager package to use
contextual logging.

This follows the contextual logging migration pattern where:
- Logger is passed from the boundary down to implementations
- klog.TODO() is used at call sites where context is not yet available
- Functions with context.Context extract logger via klog.FromContext(ctx)
- klog.InfoS/ErrorS/V().InfoS calls are replaced with logger.Info/Error/V().Info
- Sub-managers receive proper logger context from their callers

Some call sites still use klog.TODO() as placeholders, with TODO
comments indicating these will be replaced with proper contextual loggers
as the migration continues upward through the call stack.

Test/fake implementations use klog.Background() which is the appropriate
choice for test code where no real context is available.

Mock file updates (pkg/kubelet/cm/testing/mocks.go) were done manually
due to mockery tool incompatibility with Go 1.25 and will be committed
separately with an explanation.

Key changes:

1. PodContainerManager and ContainerManager interface updates:
   - PodContainerManager.EnsureExists: add logger parameter
   - PodContainerManager.Destroy: add logger parameter
   - PodContainerManager.ReduceCPULimits: add logger parameter
   - PodContainerManager.SetPodCgroupConfig: add logger parameter
   - ContainerManager.UpdateQOSCgroups: add logger parameter
   - Update all implementations (Linux, Windows, stub, noop, fake)

2. Helper function updates:
   - GetKubeletContainer: add logger parameter (Linux and unsupported platforms)
   - Update cmd/kubelet/app/server.go to pass logger to GetKubeletContainer
   - Comment out type assertion in helpers.go due to signature change

3. Cgroup manager contextual logging:
   - CgroupManager interface methods updated to accept logger:
     * Destroy: add logger parameter
     * ReduceCPULimits: add logger parameter
     * SetCgroupConfig: add logger parameter
   - Update cgroupCommon and unsupportedCgroupManager implementations
   - Migrate klog.InfoS/V().InfoS calls to logger.Info/V().Info

4. Container manager implementation updates:
   - Extract logger from context in NewContainerManager() and Start()
   - Pass logger to sub-managers (deviceManager, topologyManager)
   - Update DRA manager initialization to use logger from context
   - Migrate klog.InfoS/ErrorS to logger.Info/Error throughout

5. Call sites updated with TODO comments:
   - pkg/kubelet/kubelet.go: UpdateQOSCgroups, EnsureExists
   - pkg/kubelet/kubelet_pods.go: UpdateQOSCgroups, ReduceCPULimits, Destroy
   - pkg/kubelet/kuberuntime/kuberuntime_manager.go: SetPodCgroupConfig
   - pkg/kubelet/kuberuntime/kuberuntime_manager_test.go: test expectations

Most call sites currently use klog.TODO() as placeholders, with TODO
comments indicating these will be replaced with proper contextual loggers
as the migration continues upward through the call stack.

Test/fake implementations use klog.Background() which is the appropriate
choice for test code where no real context is available.

Mock file updates (pkg/kubelet/cm/testing/mocks.go) were done manually
due to mockery tool incompatibility with Go 1.25 and will be committed
separately with an explanation.

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2025-10-30 18:34:03 +00:00