316 Commits

Author SHA1 Message Date
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
Simran Kaur
c7d6c09683 List available endpoints for kube-apiserver (#132581)
Fix tests and formatting

Use ListedPaths for finding useful endpoints

Fix maps import

Update dependencies

Fix lint

Add option to pass listedpaths

Remove apiserver component check

Install statuz in genericapiserver

Register zpagesfeatures

Fix import order

Avoid adding non-debugging endpoints

Fix tests

Fix tests

fix tests

Sort paths

Sort in-place

Copy paths before sorting

Fix string initialization

Move sorting to later stage

Fix imports
2025-07-23 21:44:27 -07:00
Anish Ramasekar
21e2fcea9e Add automatic_reload_last_config_info metric for auth configs
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-07-17 17:47:51 -05: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
Anish Ramasekar
45dfb46448 Add TokenRequestServiceAccountUIDValidation feature gate with UID validation
This change introduces the TokenRequestServiceAccountUIDValidation feature
gate and implements feature-gated service account UID validation for the
TokenRequest API. When enabled, the API validates that the service account
UID in token requests matches the actual service account UID, preventing
token requests for recreated service accounts with the same name but
different UIDs.

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-07-10 23:20:23 -05:00
PatrickLaabs
1802c55652 chore: depr. pointer pkg replacement for test integration 2025-07-06 22:02:04 +02:00
Jordan Liggitt
6bb6c99342 Drop null creationTimestamp from test fixtures 2025-05-02 15:38:40 -04:00
Anish Ramasekar
3f5d30543d Add integration tests for using SAR with node audience restriction
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-07 16:25:18 -06:00
Jefftree
92cc680c8a Fix SelfSubjectReview test to decouple beta and GA types from the same apiserver 2025-02-20 19:32:16 +00:00
Anish Ramasekar
62809dd0de node audience restriction: use csi translator to convert intree inline_vol/pv to csi
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-02-06 13:17:16 -06:00
Davanum Srinivas
c9e81cd84c Switch to gopkg.in/go-jose/go-jose.v2 @ v2.6.3
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-01-21 09:21:27 -05:00
Jordan Liggitt
59850b5823 Promote ServiceAccountTokenNodeBinding to GA 2025-01-14 09:48:35 -05:00
Kubernetes Prow Robot
41ea061d2b Merge pull request #128705 from aramase/aramase/c/node_int_test_todo_cleanup
cleanup todo comment in node restriction integration tests
2024-12-18 00:40:52 +01:00
Jordan Liggitt
161a817812 Clean up v1alpha1 serving for authorization API 2024-12-13 08:37:57 -05:00
Monis Khan
779d76176a Update tests to handle RemoteRequestHeaderUID
Signed-off-by: Monis Khan <mok@microsoft.com>
2024-12-04 16:04:36 -05:00
Anish Ramasekar
50ed36229c cleanup todo comment in node restriction integration tests
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2024-11-08 10:10:59 -08:00
Richa Banker
8bf6eecedf add statusz implementation and enablement in apiserver 2024-11-07 12:37:38 -08:00
Harshal Neelkamal
6fdacf0411 Add plugin and key-cache for ExternalJWTSigner integration 2024-11-07 03:16:23 +00:00
Anish Ramasekar
e93d5d5425 Enforce sa token node audience restriction when ServiceAccountNodeAudienceRestriction=true
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2024-11-06 09:51:40 -08:00
Patrick Ohly
33ea278c51 DRA: use v1beta1 API
No code is left which depends on the v1alpha3, except of course the code
implementing that version.
2024-11-06 13:03:19 +01:00
Rita Zhang
e7cdc59555 deprecate EnforceMountableSecretsAnnotation in 1.32
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>
2024-11-04 13:13:32 -08:00
Kubernetes Prow Robot
79cca2786e Merge pull request #128172 from liggitt/3221-ga
KEP-3221: Promote StructuredAuthorizationConfiguration to GA
2024-10-18 20:21:09 +01:00
Jordan Liggitt
ad808e609a KEP-3221: Promote StructuredAuthorizationConfiguration to GA 2024-10-17 21:53:45 -04:00
Jordan Liggitt
0771f601e1 KEP-4193: Promote ServiceAccountTokenJTI, ServiceAccountTokenPodNodeInfo, ServiceAccountTokenNodeBindingValidation to stable 2024-10-17 21:25:09 -04:00
Robbie Cronin
cdbfbde4aa Add ut coverage for capabilities.Setup (#125395)
* Add ut coverage for capabilities.Setup

* Update pkg/capabilities/capabilities_test.go

Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>

* Add ut coverage for capabilities.Setup

Signed-off-by: robert-cronin <robert.owen.cronin@gmail.com>

---------

Signed-off-by: robert-cronin <robert.owen.cronin@gmail.com>
Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>
2024-10-17 18:23:03 +01:00
Kubernetes Prow Robot
6f1583990a Merge pull request #124792 from mjudeikis/mjudeikis/ctx.wiring
Wire in ctx into rbac plugins
2024-09-18 08:26:44 +01:00
Aaron Prindle
701e6c7ab1 chore: bump DefaultKubeBinaryVersion to 1.32, make 1.32 CEL changes, fix int tests to handle 1 version off API deprecation, and fix prerelease-lifecycle-gen for # of APIs 2024-09-17 19:32:14 +00:00
Mangirdas Judeikis
4e4eb8c5c9 wire in ctx to rbac plugins 2024-09-17 20:04:02 +03:00
Stanislav Láznička
3a4d9eccf4 integration: add a test for KAS remote UID headers 2024-09-05 14:34:15 +02:00
Kubernetes Prow Robot
bbd83d8644 Merge pull request #125634 from ahmedtd/x509credentialID
Define credential IDs for X.509 certificates
2024-08-28 16:02:56 +01:00
Taahir Ahmed
2ad2bd8907 Define credential IDs for X.509 certificates
This commit expands the existing credential ID concept to cover X.509
certificates.  We use the certificate's signature as the credential ID,
since this safe and unique.
2024-08-06 11:33:01 -07:00
Kubernetes Prow Robot
7590cb7adf Merge pull request #125257 from vinayakankugoyal/armor
KEP-24: Update AppArmor feature gates to GA stage.
2024-07-23 09:20:52 -07:00
Patrick Ohly
91d7882e86 DRA: new API for 1.31
This is a complete revamp of the original API. Some of the key
differences:
- refocused on structured parameters and allocating devices
- support for constraints across devices
- support for allocating "all" or a fixed amount
  of similar devices in a single request
- no class for ResourceClaims, instead individual
  device requests are associated with a mandatory
  DeviceClass

For the sake of simplicity, optional basic types (ints, strings) where the null
value is the default are represented as values in the API types. This makes Go
code simpler because it doesn't have to check for nil (consumers) and values
can be set directly (producers). The effect is that in protobuf, these fields
always get encoded because `opt` only has an effect for pointers.

The roundtrip test data for v1.29.0 and v1.30.0 changes because of the new
"request" field. This is considered acceptable because the entire `claims`
field in the pod spec is still alpha.

The implementation is complete enough to bring up the apiserver.
Adapting other components follows.
2024-07-22 18:09:34 +02:00
Patrick Ohly
b51d68bb87 DRA: bump API v1alpha2 -> v1alpha3
This is in preparation for revamping the resource.k8s.io completely. Because
there will be no support for transitioning from v1alpha2 to v1alpha3, the
roundtrip test data for that API in 1.29 and 1.30 gets removed.

Repeating the version in the import name of the API packages is not really
required. It was done for a while to support simpler grepping for usage of
alpha APIs, but there are better ways for that now. So during this transition,
"resourceapi" gets used instead of "resourcev1alpha3" and the version gets
dropped from informer and lister imports. The advantage is that the next bump
to v1beta1 will affect fewer source code lines.

Only source code where the version really matters (like API registration)
retains the versioned import.
2024-07-21 17:28:13 +02:00
Jordan Liggitt
5f22dd7c1a Add integration test exercising webhook selector authz 2024-07-19 15:06:52 -04:00
Patrick Ohly
8d814298bb kubelet: grant permission for DeleteCollection
2e34e187c9 enabled kubelet to do List and Watch
requests with the caveat that kubelet should better use a field selector (which
it does). The same is now also needed for DeleteCollection because kubelet will
use that to clean up in one operation instead of using multiple.
2024-07-18 09:09:19 +02:00
Vinayak Goyal
bc06071495 Update AppArmor feature gates to GA stage.
Signed-off-by: Vinayak Goyal <vinaygo@google.com>
2024-07-15 23:29:37 +00:00
Kubernetes Prow Robot
ac9aec9f9b Merge pull request #125116 from pohly/dra-one-of-source
DRA: remove "source" indirection from v1 Pod API
2024-06-28 12:46:45 -07:00
Patrick Ohly
bde9b64cdf DRA: remove "source" indirection from v1 Pod API
This makes the API nicer:

    resourceClaims:
    - name: with-template
      resourceClaimTemplateName: test-inline-claim-template
    - name: with-claim
      resourceClaimName: test-shared-claim

Previously, this was:

    resourceClaims:
    - name: with-template
      source:
        resourceClaimTemplateName: test-inline-claim-template
    - name: with-claim
      source:
        resourceClaimName: test-shared-claim

A more long-term benefit is that other, future alternatives
might not make sense under the "source" umbrella.

This is a breaking change. It's justified because DRA is still
alpha and will have several other API breaks in 1.31.
2024-06-27 17:53:24 +02:00
Siyuan Zhang
403301bfdf apiserver: Add API emulation versioning.
Co-authored-by: Siyuan Zhang <sizhang@google.com>
Co-authored-by: Joe Betz <jpbetz@google.com>
Co-authored-by: Alex Zielenski <zielenski@google.com>

Signed-off-by: Siyuan Zhang <sizhang@google.com>
2024-06-25 22:12:11 +00:00
Jordan Liggitt
c50f68d6ee Fix structured authorization webhook timeout wiring 2024-06-19 15:36:36 -04:00
Dr. Stefan Schimanski
e37917fea7 pkg/controlplane: split up config into generic controlplane and kube-related part
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2024-04-26 14:14:06 +02:00
Marek Siarkowicz
3ee8178768 Cleanup defer from SetFeatureGateDuringTest function call 2024-04-24 20:25:29 +02:00
Jordan Liggitt
02139c9102 Deflake authz config reload test 2024-03-29 10:18:45 -04:00
Peter Hunt
49ee96eed4 pod security test: add user namespaces feature
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2024-03-07 15:56:06 -05:00
Kubernetes Prow Robot
46a2137c1b Merge pull request #123639 from liggitt/authz-metrics
Add authorization webhook duration/count/failopen metrics
2024-03-04 14:09:30 -08:00
Jordan Liggitt
79b344d85e Add authorization webhook duration/count/failopen metrics 2024-03-04 14:01:15 -05:00
Jordan Liggitt
0605a75c5e Duplicate v1alpha1 AuthorizationConfiguration to v1beta1 2024-03-02 02:00:31 -05:00
Kubernetes Prow Robot
8845c4c657 Merge pull request #123135 from munnerz/4193-beta-promotion
KEP-4193: promote ServiceAccountTokenJTI, ServiceAccountTokenPodNodeInfo and ServiceAccountTokenNodeBindingValidation to beta
2024-03-01 19:48:18 -08:00