Commit Graph

3373 Commits

Author SHA1 Message Date
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
PatrickLaabs
c530b02257 chore: depr. pointer pkg replacement for pkg/security and plugin/pkg 2025-07-08 11:22:07 +02: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
sreeram-venkitesh
5390f75360 Added podutil.HasAPIObjectReference to deny admission for static pods referencing API objects 2025-06-25 23:59:26 +05:30
Davanum Srinivas
03afe6471b Add a replacement for cmp.Diff using json+go-difflib
Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-06-16 17:10:42 -04:00
Gavin Lam
89f5453e31 Allow system:monitoring role to access kubelet metrics endpoints
Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
2025-06-10 23:16:41 -04:00
Patrick Ohly
1ec7231f63 DRA node: reject static pods which reference ResourceClaims
If someone gains the ability to create static pods, they might try to use that
ability to run code which gets access to the resources associated with some
existing claim which was previously allocated for some other pod. Such an
attempt already fails because the claim status tracks which pods are allowed to
use the claim, the static pod is not in that list, the node is not authorized
to add it, and the kubelet checks that list before starting the pod in
195803cde5/pkg/kubelet/cm/dra/manager.go (L218-L222).

Even if the pod were started, DRA drivers typically manage node-local resources
which can already be accessed via such an attack without involving DRA. DRA
drivers which manage non-node-local resources have to consider access by a
compromised node as part of their threat model.

Nonetheless, it is better to not accept static pods which reference
ResourceClaims or ResourceClaimTemplates in the first place because there
is no valid use case for it.

This is done at different levels for defense in depth:
- configuration validation in the kubelet
- admission checking of node restrictions
- API validation

Co-authored-by: Jordan Liggitt <liggitt@google.com>

Code changes by Jordan, with one small change (resourceClaims -> resourceclaims).
Unit tests by Patrick.
2025-05-05 14:21:25 +02:00
Jordan Liggitt
6bb6c99342 Drop null creationTimestamp from test fixtures 2025-05-02 15:38:40 -04:00
Kubernetes Prow Robot
070f0ad3bd Merge pull request #129970 from mortent/AddResourceV1beta2API
Add resource v1beta2 API
2025-03-26 09:10:47 -07:00
Morten Torkildsen
39507d911f Add resource v1beta2 API 2025-03-26 14:41:09 +00:00
James Munnelly
8cfb9adbf6 overwrite existing labels during pod Binding storage 2025-03-20 22:39:38 +00:00
James Munnelly
01ae1b1b5a remove kubernetes.io/hostname label copying 2025-03-20 20:19:53 +00:00
James Munnelly
934e247030 Remove kubernetes.io/hostname label copying, skip overriding, and support direct spec.nodeName changes. 2025-03-20 20:19:53 +00:00
James Munnelly
6ddabb6ee6 updating to reflect latest KEP design 2025-03-20 20:19:53 +00:00
James Munnelly
5e7e1e7cf1 KEP-4742: Node Topology Labels via Downward API 2025-03-20 20:19:51 +00:00
Kubernetes Prow Robot
ab3cec0701 Merge pull request #130447 from pohly/dra-device-taints
device taints and tolerations (KEP 5055)
2025-03-19 13:00:32 -07:00
Jon Huhn
5760a4f282 DRA scheduler: device taints and tolerations
Thanks to the tracker, the plugin sees all taints directly in the device
definition and can compare it against the tolerations of a request while
trying to find a device for the request.

When the feature is turnedd off, taints are ignored during scheduling.
2025-03-19 09:18:38 +01:00
Patrick Ohly
a027b439e5 DRA: add device taint eviction controller
The controller is derived from the node taint eviction controller.
In contrast to that controller it tracks the UID of pods to prevent
deleting the wrong pod when it got replaced.
2025-03-19 09:18:38 +01:00
Penghao
a548688ffe fix: add feature-gate is disabled unit tests 2025-03-15 10:41:10 +08:00
Penghao
0393497468 Add protection finalizer to vac when it is created 2025-03-15 10:41:04 +08:00
Rita Zhang
06482b6bd3 address comment
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>
2025-03-14 13:51:43 -07:00
Rita Zhang
04ac6df8a9 add dra to edit role and add featuregate test
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>
2025-03-14 09:14:15 -07:00
Rita Zhang
718ed7d0b5 dra: add user rbac
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>
2025-03-14 09:14:15 -07:00
Kubernetes Prow Robot
68899f8e6d Merge pull request #124360 from carlory/kep-3751-quota-2
Add quota support for PVC with VolumeAttributesClass
2025-03-13 07:35:48 -07:00
carlory
27706a0b54 Add quota support for PVC with VolumeAttributesClass
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-03-13 13:50:44 +08:00
Kubernetes Prow Robot
6b8341fc2e Merge pull request #130544 from jsafrane/selinux-beta
selinux: Promote SELinuxChangePolicy and SELinuxMount to beta
2025-03-12 11:29:47 -07:00
Anish Ramasekar
6defd8c0bd node authorizer changes to allow read on svcaccounts
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-11 19:26:45 -05:00
Anish Ramasekar
b09ca8c2c8 Use SAR to allow dynamic audiences for node audience restriction
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-07 16:25:14 -06:00
Jan Safranek
96bae53a37 Promote SELinuxChangePolicy and SELinuxMount to beta
SELinuxMount stays off by default, because it changes the default
kubelet behavior. SELinuxChangePolicy is on by default and notifies users
on Pods that could get broken by SELinuxMount feature gate.
2025-03-04 11:03:54 +01:00
Kubernetes Prow Robot
b8c95e1954 Merge pull request #129688 from cpanato/update-main-go124
[go] Bump images, dependencies and versions to go 1.24.0
2025-02-27 09:10:30 -08:00
Mitsuru Kariya
20cecaee97 Add Watch to controller roles (#130405)
* Add Watch to controller roles

Starting from version 1.32, the client feature `WatchListClient` has been
set to `true` in `kube-controller-manager`.
(commit 06a15c5cf9)

As a result, when the `kube-controller-manager` executes the `List` method,
it utilizes `Watch`. However, there are some existing controller roles that
include `List` but do not include `Watch`. Therefore, when processes using
these controller roles execute the `List` method, `Watch` is executed first,
but due to permission errors, it falls back to `List`.

This PR adds `Watch` to the controller roles that include `List` but do not
include `Watch`.

The affected roles are as follows (prefixed with `system:controller:`):

- `cronjob-controller`
- `endpoint-controller`
- `endpointslice-controller`
- `endpointslicemirroring-controller`
- `horizontal-pod-autoscaler`
- `node-controller`
- `pod-garbage-collector`
- `storage-version-migrator-controller`

Signed-off-by: Mitsuru Kariya <mitsuru.kariya@nttdata.com>

* Fix Fixture Data

I apologize, the Fixture Data modifications were missed.

Signed-off-by: Mitsuru Kariya <mitsuru.kariya@nttdata.com>

* Add ControllerRoles Test

Added a test to check that if a controller role includes `List`, it also includes `Watch`.

Signed-off-by: Mitsuru Kariya <mitsuru.kariya@nttdata.com>

* Fix typo

Co-authored-by: Jordan Liggitt <jordan@liggitt.net>

* Add Additional Tests

Added tests to check that if NodeRules, ClusterRoles, and NamespaceRoles
include `List`, it also include `Watch`.

Signed-off-by: Mitsuru Kariya <mitsuru.kariya@nttdata.com>

---------

Signed-off-by: Mitsuru Kariya <mitsuru.kariya@nttdata.com>
Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
2025-02-26 08:24:38 -08:00
Jordan Liggitt
8090db5dcf Switch to private instances of rand for seeding for tests 2025-02-26 11:27:10 +01:00
carlory
eb0f003d25 Fix a bug where the ResourceQuota admission plugin does not respect ANY scope change when a resource is being updated. i.e. to set/unset an existing pod's terminationGracePeriodSeconds field. 2025-02-25 10:26:34 +08: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
Anish Ramasekar
d6c50c391d node audience restriction: add unit tests to simulate intree inline_vol/pv to csi failure
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-02-06 12:13:34 -06:00
Kubernetes Prow Robot
2bda5dd8c7 Merge pull request #129656 from vinayakankugoyal/kep2862beta
KEP-2862: Graduate to BETA.
2025-01-27 19:05:23 -08:00
Davanum Srinivas
4e05bc20db Linter to ensure go-cmp/cmp is used ONLY in tests
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-01-24 20:49:14 -05:00
Vinayak Goyal
3a780a1c1b KEP-2862: Graduate to BETA. 2025-01-24 21:36:00 +00:00
Kubernetes Prow Robot
2deb8af139 Merge pull request #129670 from cslink/fix-ephemeral-container-secrets
Fix ephemeral container secret references
2025-01-23 15:53:20 -08:00
Antonio Ojea
ddfc4d3e58 update text fixtures for rbac 2025-01-20 13:01:53 +00:00
Cordelia Link
9898bfdbda Remove unused test code 2025-01-17 02:52:41 +00:00
Cordelia Link
fca697aca0 Add logic to check for new ephemeral containers on pod update and update secret cache if they exist. 2025-01-17 02:49:36 +00:00
Quan Tian
3571992ffc Add watch permission to namespace-controller for WatchListClient feature
The WatchListClient feature is enabled for kube-controller-manager, but
namespace-controller misses the necessary "watch" permission, which
results in 30 error logs being generated every time a namespace is
deleted and falling back to the standard LIST semantics.

Signed-off-by: Quan Tian <quan.tian@broadcom.com>
2024-12-13 18:15:00 +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
c25f5eefe4 Merge pull request #128407 from ndixita/pod-level-resources
[PodLevelResources] Pod Level Resources Feature Alpha
2024-11-08 07:10:50 +00:00
ndixita
28dea49c04 Limit Range changes to validate against Pod Level Resources 2024-11-08 03:00:54 +00:00
Richa Banker
da8dc433e9 Add flagz implementation and enablement in apiserver 2024-11-07 17:11:49 -08:00
Kubernetes Prow Robot
60651eb172 Merge pull request #125577 from richabanker/statusz
Add statusz endpoint for apiserver
2024-11-08 01:04:43 +00:00