Commit Graph

3322 Commits

Author SHA1 Message Date
Stanislav Láznička
a4b83e77d9 trustbundles: add a new kube-apiserver-serving signer 2024-11-07 18:07:06 +01:00
Kubernetes Prow Robot
28900b8069 Merge pull request #128077 from aramase/aramase/f/kep_4412_sa_node_aud_restriction
Enforce service account node audience restriction
2024-11-06 23:17:28 +00:00
Kubernetes Prow Robot
dfba334a33 Merge pull request #128242 from jsafrane/selinux-controller
1710: Add SELinux warning controller
2024-11-06 20:09:44 +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
Jan Safranek
df88b1a771 Add all RBAC rules for the SELinux controller
The SELinuxWarningController does not necessarily need permissions to read
the objects, because it gets them through a shared informer instantiated by
KCM itself, but let's list the permissions for completeness.
2024-11-06 13:06:52 +01: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
Jan Safranek
aa8872d7a3 Add SELinux warning controller 2024-11-06 11:16:02 +01:00
Anish Shah
832d7f7dc2 apply feedback 2024-11-06 01:33:15 +00:00
Anish Shah
dc3c4ed559 pod resize support in LimitRanger admission plugin 2024-11-06 01:33:15 +00:00
Kubernetes Prow Robot
f81a68f488 Merge pull request #128377 from tallclair/allocated-status-2
[FG:InPlacePodVerticalScaling] Implement AllocatedResources status changes for Beta
2024-11-05 23:21:49 +00:00
Kubernetes Prow Robot
08391b3d27 Merge pull request #123549 from carlory/kep-3751-finalizer
A new controller adds/removes finalizer to VAC for protection
2024-11-05 21:45:30 +00:00
Tim Allclair
dc45ae38c6 Clarify limit ranger use of status resources 2024-11-05 09:21:22 -08:00
Tim Allclair
f557903263 Delete unusued max resources function 2024-11-01 14:46:56 -07:00
Tim Allclair
6cb301a56f Don't consider allocated resources for limitranger constraints 2024-11-01 14:10:14 -07:00
Kubernetes Prow Robot
352056f09d Merge pull request #127757 from torredil/scheduler-bugfix-5123
scheduler: Improve CSILimits plugin accuracy by using VolumeAttachments
2024-10-23 18:12:52 +01:00
torredil
56f2b192cc scheduler: Improve CSILimits plugin accuracy by using VolumeAttachments
Signed-off-by: torredil <torredil@amazon.com>
2024-10-18 19:02:14 +00:00
Kubernetes Prow Robot
f5ae0413ca Merge pull request #126347 from vinayakankugoyal/kep2862impl
KEP-2862: Fine-grained Kubelet API Authorization
2024-10-18 03:53:04 +01:00
Vinayak Goyal
b1f290d444 KEP-2862: Fine-grained Kubelet API Authorization
Signed-off-by: Vinayak Goyal <vinaygo@google.com>
2024-10-17 20:53:27 +00:00
Patrick Ohly
f84eb5ecf8 DRA: remove "classic DRA"
This removes the DRAControlPlaneController feature gate, the fields controlled
by it (claim.spec.controller, claim.status.deallocationRequested,
claim.status.allocation.controller, class.spec.suitableNodes), the
PodSchedulingContext type, and all code related to the feature.

The feature gets removed because there is no path towards beta and GA and DRA
with "structured parameters" should be able to replace it.
2024-10-16 23:09:50 +02:00
Kubernetes Prow Robot
67cdc26214 Merge pull request #127497 from pohly/dra-scheduler-queueing-hints-fix
DRA scheduler: fix queuing hint support
2024-09-30 23:21:48 +01:00
Patrick Ohly
aee77bfc84 DRA scheduler: add special ActionType for ResourceClaim changes
Having a dedicated ActionType which only gets used when the scheduler itself
already detects some change in the list of generated ResourceClaims of a pod
avoids calling the DRA plugin for unrelated Pod changes.
2024-09-27 16:53:58 +02:00
Kubernetes Prow Robot
9571d3b6c6 Merge pull request #125995 from carlory/remove-unnecessary-permissions
remove unneeded permissions for volume controllers
2024-09-24 15:38:00 +01:00
Mangirdas Judeikis
4e4eb8c5c9 wire in ctx to rbac plugins 2024-09-17 20:04:02 +03:00
Antoni Zawodny
2156efa7b3 Make Node authorizer's index authoritative for unauthorized calls 2024-09-06 09:26:19 +02:00
Antoni Zawodny
cf93a5bfa8 Clean up Node authorizer's non-thread-safe method names 2024-09-03 21:27:24 +02:00
carlory
a9de9a3d07 controller-manager adds a new controller named volumeattributesclass-protection-controller which adds/removes finalizer to VAC for protection 2024-08-30 15:00:46 +08:00
Kubernetes Prow Robot
71389d5082 Merge pull request #126920 from atiratree/statefulset-autodelete-pvc-rbac
add missing RBAC to statefulset-controller for StatefulSetAutoDeletePVC feature
2024-08-28 19:29:10 +01:00
Filip Křepinský
55efd85c10 add missing RBAC to statefulset-controller for StatefulSetAutoDeletePVC feature 2024-08-26 13:57:50 +02:00
Cici Huang
0f19faf9be Remove feature gate ValiatingAdmissionPolicy after stable. 2024-08-22 17:39:18 +00:00
carlory
ae9e381f6c remove unneeded permissions for system:controller:persistent-volume-binder and system:controller:expand-controller clusterroles 2024-08-21 12:01:53 +08:00
Kubernetes Prow Robot
5fdab96c6c Merge pull request #121997 from dongjiang1989/admission-ioutil
chores: Replace deprecation ioutil fucntions
2024-08-13 14:44:42 -07:00
Micah Hausler
a7af830209 Rename kubelet CSR admission feature gate
Retitle the feature to the affirmative ("AllowInsecure...=false") instead of a
double-negative ("Disable$NEWTHING...=false") for clarity

Signed-off-by: Micah Hausler <mhausler@amazon.com>
2024-07-29 10:14:19 -05:00
Jefftree
b5a62f14cd CLE rbac for lease and leasecandidate in kube-system 2024-07-24 14:38:11 +00:00
Kubernetes Prow Robot
107f621462 Merge pull request #126108 from gnufied/changes-volume-recovery
Reduce state changes when expansion fails and mark certain failures as infeasible
2024-07-23 13:30:56 -07:00
Kubernetes Prow Robot
d21b17264e Merge pull request #125488 from pohly/dra-1.31
DRA for 1.31
2024-07-22 11:45:55 -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
Jordan Liggitt
c75c07c8e1 Authorize Node reads via name, not graph 2024-07-21 15:01:46 -04: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
Micah Hausler
b251efe0ad Enhance node admission to validate kubelet CSR's CN
Signed-off-by: Micah Hausler <mhausler@amazon.com>
2024-07-20 19:06:00 -05:00
Kubernetes Prow Robot
892acaa6a7 Merge pull request #126107 from enj/enj/i/svm_not_found_err
svm: set UID and RV on SSA patch to cause conflict on logical create
2024-07-20 08:18:01 -07:00
Jordan Liggitt
4d535db8be Add selector authorization to the Node authorizer 2024-07-19 15:06:51 -04:00
David Eads
92e3445e9d add field and label selectors to authorization attributes
Co-authored-by: Jordan Liggitt <liggitt@google.com>
2024-07-19 15:06:47 -04:00
Kubernetes Prow Robot
f2428d66cc Merge pull request #125163 from pohly/dra-kubelet-api-version-independent-no-rest-proxy
DRA: make kubelet independent of the resource.k8s.io API version
2024-07-18 17:47:48 -07:00
Patrick Ohly
a7396fdd3f kubelet: grant permission for DeleteCollection also with RBAC
If the node authorizer is active, RBAC rules are not needed. But if it's
disabled, kubelet needs to get permission through RBAC. In contrast to the
authorizer code which is a bit more flexible and isn't directly tied to the
current kubelet implementation (i.e. it allows list+delete instead of just
deletecollection), the RBAC entry is just for what the current kubelet does
because it's a bit easier to change.
2024-07-18 23:30:09 +02:00
Monis Khan
6a6771b514 svm: set UID and RV on SSA patch to cause conflict on logical create
When a resource gets deleted during migration, the SVM SSA patch
calls are interpreted as a logical create request.  Since the object
from storage is nil, the merged result is just a type meta object,
which lacks a name in the body.  This fails when the API server
checks that the name from the request URL and the body are the same.
Note that a create request is something that SVM controller should
never do.

Once the UID is set on the patch, the API server will fail the
request at a slightly earlier point with an "uid mismatch" conflict
error, which the SVM controller can handle gracefully.

Setting UID by itself is not sufficient.  When a resource gets
deleted and recreated, if RV is not set but UID is set, we would get
an immutable field validation error for attempting to update the
UID.  To address this, we set the resource version on the SSA patch
as well.  This will cause that update request to also fail with a
conflict error.

Added the create verb on all resources for SVM controller RBAC as
otherwise the API server will reject the request before it fails
with a conflict error.

The change addresses a host of other issues with the SVM controller:

1. Include failure message in SVM resource
2. Do not block forever on unsynced GC monitor
3. Do not immediately fail on GC monitor being missing, allow for
   a grace period since discovery may be out of sync
4. Set higher QPS and burst to handle large migrations

Test changes:

1. Clean up CRD webhook convertor logs
2. Allow SVM tests to be run multiple times to make finding flakes easier
3. Create and delete CRs during CRD test to force out any flakes
4. Add a stress test with multiple parallel migrations
5. Enable RBAC on KAS
6. Run KCM directly to exercise wiring and RBAC
7. Better logs during CRD migration
8. Scan audit logs to confirm SVM controller never creates

Signed-off-by: Monis Khan <mok@microsoft.com>
2024-07-18 17:19:11 -04:00
Kubernetes Prow Robot
595927da21 Merge pull request #125660 from saschagrunert/oci-volumesource-api
[KEP-4639] Add `ImageVolumeSource` API
2024-07-18 10:39:15 -07:00
Sascha Grunert
f7ca3131e0 Add ImageVolumeSource API
Adding the required Kubernetes API so that the kubelet can start using
it. This patch also adds the corresponding alpha feature gate as
outlined in KEP 4639.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-07-18 17:25:54 +02: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
Hemant Kumar
ad28dfb42e Fix code that uses old values for resize errors 2024-07-12 14:37:35 -04:00
carlory
850bc09e9b clean up codes after PodDisruptionConditions was promoted to GA and locked to default 2024-07-11 10:40:21 +08:00