Commit graph

3418 commits

Author SHA1 Message Date
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
Maciej Skoczeń
4a067cc022 Add read Workload permissions to kube-scheduler 2025-11-06 10:47:30 +00:00
Kubernetes Prow Robot
b869afe68d
Merge pull request #133389 from pravk03/node-capabilities
Introduce node declared features framework
2025-11-06 01:32:54 -08:00
Kubernetes Prow Robot
50b4bcbab5
Merge pull request #134210 from yliaog/admit_quota
DRA extended resource quota
2025-11-06 00:42:53 -08:00
Praveen Krishna
e7a42e8e8e feat(admission): Add NodeDeclaredFeatures admission plugin 2025-11-06 01:21:17 +00:00
yliao
870062df4f adjusts DRA extended resource quota to include devices usages from regular resource claims 2025-11-05 23:24:24 +00:00
Patrick Ohly
eaee6b6bce DRA device taints: add separate feature gate for rules
Support for DeviceTaintRules depends on a significant amount of
additional code:
- ResourceSlice tracker is a NOP without it.
- Additional informers and corresponding permissions in scheduler and controller.
- Controller code for handling status.

Not all users necessarily need DeviceTaintRules, so adding a second feature
gate for that code makes it possible to limit the blast radius of bugs in that
code without having to turn off device taints and tolerations entirely.
2025-11-05 20:03:17 +01:00
Kubernetes Prow Robot
c1a6a3ca71
Merge pull request #134152 from pohly/dra-device-taints-1.35
DRA: device taints: new ResourceSlice API, new features
2025-11-04 15:32:07 -08:00
Patrick Ohly
bbf8bc766e DRA device taints: DeviceTaintRule status
To update the right statuses, the controller must collect more information
about why a pod is being evicted. Updating the DeviceTaintRule statuses then is
handled by the same work queue as evicting pods.

Both operations already share the same client instance and thus QPS+server-side
throttling, so they might as well share the same work queue. Deleting pods is
not necessarily more important than informing users or vice-versa, so there is
no strong argument for having different queues.

While at it, switching the unit tests to usage of the same mock work queue as
in staging/src/k8s.io/dynamic-resource-allocation/internal/workqueue. Because
there is no time to add it properly to a staging repo, the implementation gets
copied.
2025-11-04 21:57:24 +01:00
Kubernetes Prow Robot
a058cf788a
Merge pull request #134624 from yt2985/podcertificates-beta
Promote Pod Certificates feature to beta
2025-11-04 11:42:12 -08:00
tinatingyu
59e075e8d3 Promote PodCertificateRequests to v1beta1 2025-11-02 05:33:44 +00:00
Peter Hunt
e8bd3f629d drop UserNamespacesPodSecurityStandards feature gate
this feature gate was meant to be ephemeral, and only was used for guaranteeing a
cluster admin didn't accidentally relax PSA policies before the kubelet would deny a pod
was created if it didn't support user namespaces. As of kube 1.33, the supported apiserver version
skew of n-3 guarantees that all supported kubelets are of 1.30 or later, meaning they do this.

Now, we can unconditionally relax PSA policy if a pod is in a user namespace.

This PR reserves older policies default behavior by never relaxing

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2025-10-31 14:08:21 -04:00
Kubernetes Prow Robot
3ec2d82da5
Merge pull request #134784 from michaelasp/svm_beta2
SVM: bump the API to beta, remove unused fields
2025-10-29 13:56:02 -07:00
Michael Aspinwall
3b72759d1b Update SVM to Beta
Co-authored-by: Stanislav Láznička <stlaz.devel@proton.me>
2025-10-29 19:36:11 +00:00
Patrick Ohly
8b6f98b06e DRA: lock to default-on
The core functionality was enabled by default in 1.34 without any issues that
would have suggested turning it off, so now we can lock it to on-by-default.

Tests which cover disabling the feature must use version emulation.
2025-10-24 20:04:20 +02:00
Tim Allclair
4986abe0b8 Automated refactoring to use SetFeatureGatesDuringTest 2025-10-01 21:10:53 -07:00
Ismail Alidzhikov
4a76cd8405 Remove configmaps related rules from the kube-controller-manager and kube-scheduler leader election roles 2025-09-26 16:52:09 +03:00
Jordan Liggitt
4b0eeeb618
Make pod-security-admission honor emulation version 2025-09-17 15:32:32 -04:00
Jordan Liggitt
7f4ee652ea
Delete temporary ProbeHostPodSecurityStandards feature gate 2025-09-17 15:23:32 -04:00
Jordan Liggitt
55419eca7a
Plumb effective version into admission initializer 2025-09-17 15:23:31 -04:00
Kubernetes Prow Robot
529f147dfc
Merge pull request #133740 from pacoxu/add-events-group-view
add events.events.k8s.io to clusterrole view/edit default
2025-09-03 08:45:15 -07:00
Paco Xu
ef7cee89bf add events.events.k8s.io to clusterrole view/edit/node default 2025-09-03 10:06:14 +08:00
Kubernetes Prow Robot
a6693542b7
Merge pull request #133781 from pohly/test-apiserver-flag-registration
test/integration/apiserver: fix several data races
2025-09-02 13:09:17 -07:00
Patrick Ohly
fa1f9d444c apiserver: avoid default toleration seconds data race for all tests
This reverts commit 2e756e7412,
which addressed the data race only for test/integration/apiserver/oidc.
It also occurs for test/integration/controlplane/transformation:

    WARNING: DATA RACE
    Read at 0x000008b9de38 by goroutine 104616:
      k8s.io/kubernetes/plugin/pkg/admission/defaulttolerationseconds.RegisterFlags()
          /home/prow/go/src/k8s.io/kubernetes/plugin/pkg/admission/defaulttolerationseconds/admission.go:42 +0x30
      k8s.io/kubernetes/pkg/kubeapiserver/options.registerAllAdmissionPluginFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/kubeapiserver/options/plugins.go:115 +0x64
      k8s.io/kubernetes/pkg/kubeapiserver/options.(*AdmissionOptions).AddFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/kubeapiserver/options/admission.go:73 +0x55
      k8s.io/kubernetes/pkg/controlplane/apiserver/options.(*Options).AddFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/controlplane/apiserver/options/options.go:154 +0x388
      k8s.io/kubernetes/cmd/kube-apiserver/app/options.(*ServerRunOptions).Flags()
          /home/prow/go/src/k8s.io/kubernetes/cmd/kube-apiserver/app/options/options.go:101 +0x73
      k8s.io/kubernetes/cmd/kube-apiserver/app/testing.StartTestServer()
          /home/prow/go/src/k8s.io/kubernetes/cmd/kube-apiserver/app/testing/testserver.go:219 +0xb77
      k8s.io/kubernetes/test/integration/controlplane/transformation.newTransformTest()
          /home/prow/go/src/k8s.io/kubernetes/test/integration/controlplane/transformation/transformation_test.go:131 +0x6d0
      k8s.io/kubernetes/test/integration/controlplane/transformation.TestKMSv2Healthz()
          /home/prow/go/src/k8s.io/kubernetes/test/integration/controlplane/transformation/kmsv2_transformation_test.go:874 +0x1c8
      testing.tRunner()
          /usr/local/go/src/testing/testing.go:1792 +0x225
      testing.(*T).Run.gowrap1()
          /usr/local/go/src/testing/testing.go:1851 +0x44

    Previous write at 0x000008b9de38 by goroutine 111926:
      github.com/spf13/pflag.newInt64Value()
          /home/prow/go/src/k8s.io/kubernetes/vendor/github.com/spf13/pflag/int64.go:9 +0x49
      github.com/spf13/pflag.(*FlagSet).Int64Var()
          /home/prow/go/src/k8s.io/kubernetes/vendor/github.com/spf13/pflag/int64.go:41 +0x3d
      k8s.io/kubernetes/plugin/pkg/admission/defaulttolerationseconds.RegisterFlags()
          /home/prow/go/src/k8s.io/kubernetes/plugin/pkg/admission/defaulttolerationseconds/admission.go:42 +0x25
      k8s.io/kubernetes/pkg/kubeapiserver/options.registerAllAdmissionPluginFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/kubeapiserver/options/plugins.go:115 +0x64
      k8s.io/kubernetes/pkg/kubeapiserver/options.(*AdmissionOptions).AddFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/kubeapiserver/options/admission.go:73 +0x55
      k8s.io/kubernetes/pkg/controlplane/apiserver/options.(*Options).AddFlags()
          /home/prow/go/src/k8s.io/kubernetes/pkg/controlplane/apiserver/options/options.go:154 +0x388
      k8s.io/kubernetes/cmd/kube-apiserver/app/options.(*ServerRunOptions).Flags()
          /home/prow/go/src/k8s.io/kubernetes/cmd/kube-apiserver/app/options/options.go:101 +0x73
      k8s.io/kubernetes/cmd/kube-apiserver/app/testing.StartTestServer()
          /home/prow/go/src/k8s.io/kubernetes/cmd/kube-apiserver/app/testing/testserver.go:219 +0xb77
      k8s.io/kubernetes/test/integration/controlplane/transformation.newTransformTest()
          /home/prow/go/src/k8s.io/kubernetes/test/integration/controlplane/transformation/transformation_test.go:131 +0x6d0
      k8s.io/kubernetes/test/integration/controlplane/transformation.TestKMSv2FeatureFlag()
          /home/prow/go/src/k8s.io/kubernetes/test/integration/controlplane/transformation/kmsv2_transformation_test.go:1009 +0x117
      testing.tRunner()
          /usr/local/go/src/testing/testing.go:1792 +0x225
      testing.(*T).Run.gowrap1()
          /usr/local/go/src/testing/testing.go:1851 +0x44

A more general solution is to lock while registering the variables (= write)
and while reading the variables once in InspectFeatureGates.
2025-09-02 21:01:04 +02:00
Maciej Szulik
09e357d31f
Drop StatefulSetAutoDeletePVC after the feature GA-ed in 1.32
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-08-28 13:35:16 +02:00
Sergey Kanzhelev
944b0a4923 do not allow the node to update it's owner reference 2025-08-10 14:38:24 -07:00
carlory
89b5034d56 Make podcertificaterequestcleaner role feature-gated 2025-08-07 13:46:08 +08:00
yliao
34a64db2c7 extended resource backed by DRA: implementation 2025-07-29 18:55:21 +00:00
Kubernetes Prow Robot
2d5f58a0ed
Merge pull request #133176 from liggitt/psa-host-probe-emulation
Make PSA host enforcement honor emulation version
2025-07-24 17:59:27 -07:00
Kubernetes Prow Robot
7912e5fd67
Merge pull request #131549 from carlory/KEP-3751-GA
[Kep-3751] Promote VolumeAttributesClass to GA
2025-07-24 16:44:27 -07:00
carlory
94bf8fc8a9 Promoted API VolumeAttributesClass and VolumeAttributesClassList to storage.k8s.io/v1.
Promoted feature-gate `VolumeAttributesClass` to GA (on by default)

Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-07-25 01:53:59 +08:00
Jordan Liggitt
27e1675153
Make PSA host enforcement honor emulation version 2025-07-24 12:36:26 -04:00
Patrick Ohly
24de875ceb DRA: graduate DynamicResourceAllocation feature to GA
It hasn't been on-by-default before, therefore it does not get locked to the
new default on yet. This has some impact on the scheduler configuration
because the plugin is now enabled by default.

Because the feature is now GA, it doesn't need to be a label on E2E tests,
which wouldn't be possible anyway once it gets removed entirely.
2025-07-24 08:33:56 +02:00
Patrick Ohly
d8df1dc1b8 DRA RBAC: fix kube-scheduler bootstrap policy
The pods/finalizer permission can be restricted to just updates because that is
all that matters.

The DeviceTaints rules were under the wrong feature gate check (copy-and-paste)
and must remain disabled when DRA itself becomes enabled.
2025-07-24 08:33:56 +02:00
Patrick Ohly
5c4f81743c DRA: use v1 API
As before when adding v1beta2, DRA drivers built using the
k8s.io/dynamic-resource-allocation helper packages remain compatible with all
Kubernetes release >= 1.32. The helper code picks whatever API version is
enabled from v1beta1/v1beta2/v1.

However, the control plane now depends on v1, so a cluster configuration where
only v1beta1 or v1beta2 are enabled without the v1 won't work.
2025-07-24 08:33:45 +02:00
Kubernetes Prow Robot
cc674e7470
Merge pull request #128010 from ahmedtd/pod-certificates-types
Pod Certificates: Preliminary implementation of KEP-4317
2025-07-21 19:26:30 -07:00
Taahir Ahmed
4624cb9bb9 Pod Certificates: Basic implementation
* Define feature gate
* Define and serve PodCertificateRequest
* Implement Kubelet projected volume source
* kube-controller-manager GCs PodCertificateRequests
* Add agnhost subcommand that implements a toy signer for testing

Change-Id: Id7ed030d449806410a4fa28aab0f2ce4e01d3b10
2025-07-21 21:49:57 +00:00
Kubernetes Prow Robot
cdef93cedb
Merge pull request #133017 from aramase/aramase/f/kep_4412_beta
Mark KubeletServiceAccountTokenForCredentialProviders feature gate as beta
2025-07-21 14:14:47 -07:00
Kubernetes Prow Robot
558e903fb1
Merge pull request #132462 from munnerz/update-pod-topology-domain
podtopologylabels: update topology.k8s.io->topology.kubernetes.io
2025-07-21 13:06:35 -07:00
Anish Ramasekar
5d4010d2d2
Mark KubeletServiceAccountTokenForCredentialProviders feature gate as beta
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-07-21 09:08:43 -05:00
Kubernetes Prow Robot
99f55ae4ef
Merge pull request #132662 from gnufied/bump-recovery-feature-ga
Bump recovery feature ga
2025-07-17 17:10:25 -07:00
Kubernetes Prow Robot
d5b2a0438d
Merge pull request #132401 from togettoyou/refactor-admission-plugin-flags
Refactor: isolate flag registration to kube-apiserver to eliminate global state
2025-07-15 22:44:29 -07:00
Junhao Zou
ae4a43de6d Refactor: isolate flag registration to kube-apiserver to eliminate global state 2025-07-16 11:01:37 +08:00
Kubernetes Prow Robot
3430e34d88
Merge pull request #132656 from liggitt/selector-authz
KEP-4601: Graduate selector authorization to stable
2025-07-14 16:42:38 -07:00
Jordan Liggitt
a04e7cf5eb
KEP-4601: Graduate selector authorization to stable 2025-07-14 16:19:52 -04:00
Hemant Kumar
c126870ebc Bump RecoverVolumeExpansionFailure to GA 2025-07-10 12:19:31 -04:00
PatrickLaabs
c530b02257 chore: depr. pointer pkg replacement for pkg/security and plugin/pkg 2025-07-08 11:22:07 +02:00
James Munnelly
38bf213271 podtopologylabels: update topology.k8s.io->topology.kubernetes.io 2025-07-03 08:37:23 +01:00
Kubernetes Prow Robot
b7c9333f5c
Merge pull request #131837 from sreeram-venkitesh/static-pod-strict-validation-for-api-object-reference
Deny pod admission for static pods referencing API objects
2025-06-26 12:18:30 -07:00
sreeram-venkitesh
f9a5aec318 Added unit tests 2025-06-25 23:59:44 +05:30