Commit Graph

123789 Commits

Author SHA1 Message Date
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
Patrick Ohly
7701a48bd6 dra kubelet: bump gRPC API to v1alpha4
The previous changes are an API break, therefore we need a new version.
2024-07-18 23:30:09 +02:00
Patrick Ohly
ee3205804b dra e2e: demonstrate how to use RBAC + VAP for a kubelet plugin
In reality, the kubelet plugin of a DRA driver is meant to be deployed as a
daemonset with a service account that limits its
permissions. https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#additional-metadata-in-pod-bound-tokens
ensures that the node name is bound to the pod, which then can be used
in a validating admission policy (VAP) to ensure that the operations are
limited to the node.

In E2E testing, we emulate that via impersonation. This ensures that the plugin
does not accidentally depend on additional permissions.
2024-07-18 23:30:09 +02:00
Patrick Ohly
348f94ab55 DRA: read ResourceClaim in DRA drivers
This is the second and final step towards making kubelet independent of the
resource.k8s.io API versioning because it now doesn't need to copy structs
defined by that API from the driver to the API server.
2024-07-18 09:09:20 +02:00
Patrick Ohly
616a014347 DRA: move ResourceSlice publishing into DRA drivers
This is a first step towards making kubelet independent of the resource.k8s.io
API versioning because it now doesn't need to copy structs defined by that API
from the driver to the API server. The next step is removing the other
direction (reading ResourceClaim status and passing the resource handle to
drivers).

The drivers must get deployed so that they have their own connection to the API
server. Securing at least the writes via a validating admission policy should
be possible.

As before, the kubelet removes all ResourceSlices for its node at startup, then
DRA drivers recreate them if (and only if) they start up again. This ensures
that there are no orphaned ResourceSlices when a driver gets removed while the
kubelet was down.

While at it, logging gets cleaned up and updated to use structured, contextual
logging as much as possible. gRPC requests and streams now use a shared,
per-process request ID and streams also get logged.
2024-07-18 09:09:19 +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
Patrick Ohly
3d4bc44a2f dra e2e node: addd test case for ResourceSlice handling during kubelet startup
Any redundant object must get deleted, but not the ones of other names.
2024-07-18 09:09:19 +02:00
Kubernetes Prow Robot
5a99930ab5
Merge pull request #125328 from harche/v1_warning
[KEP-4569] Add a warning log, an event for cgroup v1 usage and a metric for cgroup version
2024-07-10 23:50:32 -07:00
Kubernetes Prow Robot
1740d85aff
Merge pull request #125866 from aroradaman/can-use-nfacct
nfacct: conditionally ensure counters and register metrics
2024-07-10 19:26:36 -07:00
Kubernetes Prow Robot
c3c8a9cfd4
Merge pull request #125676 from benluddy/cbor-bufferpool
KEP-4222: Don't pool large CBOR encode buffers
2024-07-10 17:08:41 -07:00
Kubernetes Prow Robot
d31ba91240
Merge pull request #126010 from aroradaman/proxy-options-refactor
Kube-Proxy options refactor
2024-07-10 14:54:48 -07:00
Kubernetes Prow Robot
2d877b5259
Merge pull request #125629 from benluddy/cbor-rawextension
KEP-4222: Automatically transcode RawExtension between unstructured protocols.
2024-07-10 14:54:35 -07:00
Ben Luddy
a19d142f0d
Don't pool large CBOR encode buffers.
Objects in a sync.Pool are assumed to be fungible. This is not a good assumption for pools
of *bytes.Buffer because a *bytes.Buffer's underlying array grows as needed to accomodate writes. In
Kubernetes, apiservers tend to encode "small" objects very frequently and much larger
objects (especially large lists) only occasionally. Under steady load, pooled buffers tend to be
borrowed frequently enough to prevent them from being released. Over time, each buffer is used to
encode a large object and its capacity increases accordingly. The result is that practically all
buffers in the pool retain much more capacity than needed to encode most objects.

As a basic mitigation for the worst case, buffers with more capacity than the default max request
body size are never returned to the pool.
2024-07-10 17:27:49 -04:00
Kubernetes Prow Robot
135f2e0372
Merge pull request #125997 from mimowo/job-comment-cleanup
Cleanup TODO comment in the Job controller
2024-07-10 12:15:39 -07:00
Daman Arora
0d14f18f8f cmd/kube-proxy: refactor options test
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-10 23:55:28 +05:30
Daman Arora
458b56811a cmd/kube-proxy: refactor server.go
Split server.go into server.go and options.go and same for
server_test.go

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-10 23:55:27 +05:30
Daman Arora
210ed2fc41 kube-proxy: fix error wrapping, error handling and deprecated methods
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-10 23:51:17 +05:30
Kubernetes Prow Robot
1608dc2b09
Merge pull request #125985 from kaisoz/fix-failureTarget-manually-added
job_controller: Ignore FailureTarget JobCondition with Status != True
2024-07-10 09:02:59 -07:00
Kubernetes Prow Robot
6a45c8b7d1
Merge pull request #125944 from timofurrer/fix/error-msg-type
Fix typo in type name of watch decode error
2024-07-10 09:02:50 -07:00
Kubernetes Prow Robot
27c6c30905
Merge pull request #124607 from gjtempleton/HPA-Reviewers-Addition
HPA - Add gjtempleton to reviewers
2024-07-10 07:08:50 -07:00
Michal Wozniak
8a8717c3a9 Cleanup TODO comment in the Job controller 2024-07-10 12:27:56 +02:00
Tomas Tormo
2aed11ec78 job_controller: Ignore FailureTarget!=True 2024-07-10 08:02:14 +00:00
Kubernetes Prow Robot
0c8b3e5f30
Merge pull request #125986 from vinayakankugoyal/typo
Fix typo in error message for anonymous field in AuthenticationConfig…
2024-07-09 20:45:05 -07:00
Kubernetes Prow Robot
20b216738a
Merge pull request #125971 from googs1025/integration_test
chore: use testCtx instead of context.TODO() for scheduler integration
2024-07-09 18:57:06 -07:00
Kubernetes Prow Robot
a0bfe666df
Merge pull request #125202 from hjet/inplace-vertical-scaling-e2e-rollback
[FG:InPlacePodVerticalScaling] Roll back resize patches in doPodResizeTests
2024-07-09 17:53:12 -07:00
Kubernetes Prow Robot
90615231a6
Merge pull request #125097 from YamasouA/ft/queuehit-csinode
volumebinding: scheduler queueing hints - CSINode
2024-07-09 17:53:05 -07:00
Kubernetes Prow Robot
672af9406e
Merge pull request #125981 from dims/cleanup-pods-after-test-runs
[e2e-node] Cleanup pods after the test runs
2024-07-09 15:01:01 -07:00
Vinayak Goyal
27e8923c70 Fix typo in error message for anonymous field in AuthenticationConfiguration. 2024-07-09 21:04:28 +00:00
Ben Luddy
4755e1f859
Automatically transcode RawExtension between unstructured protocols. 2024-07-09 17:02:34 -04:00
Davanum Srinivas
f6836df520
[e2e-node] Cleanup pods after the test runs
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-07-09 16:53:28 -04:00
Kubernetes Prow Robot
4a214f6ad9
Merge pull request #125461 from mimowo/pod-disruption-conditions-ga
Graduate PodDisruptionConditions to stable
2024-07-09 11:08:13 -07:00
Kubernetes Prow Robot
048b2912b8
Merge pull request #124761 from benluddy/fuzz-cbor-decode
KEP-4222: Add CBOR fuzz test for unreasonable allocations during decode.
2024-07-09 10:02:17 -07:00
Harshal Patil
68d317a8d1 Add a warning log, event and metric for cgroup version 1
Signed-off-by: Harshal Patil <harpatil@redhat.com>
2024-07-09 11:34:46 -04:00
Kubernetes Prow Robot
bb089b9374
Merge pull request #125970 from carlory/sync-masked-path-from-moby
defaultMaskedPaths must be kept in sync with moby/moby
2024-07-09 07:10:14 -07:00
Daman Arora
33bac685a7 conditionally register nfacct metrics and ensure nfacct counters
If the nfacct sub-system is not available in the kernel then:
1. nfacct based metrics won't be registered.
2. proxier will not attempt to ensure the counters

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-09 18:49:01 +05:30
Daman Arora
75b18b86dd proxy/utils/nfacct: API to check if nfacct sub-system is present
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-09 18:44:04 +05:30
Kubernetes Prow Robot
42064e03c5
Merge pull request #125973 from fxierh/sample-apiserver-e2e-race-fix
Mark test cases which set up a sample-apiserver as serial
2024-07-09 06:02:04 -07:00
Feilian Xie
9cdacdc514 Mark a test case which sets up a sample-apiserver as serial due to potential conflicts with other test cases which do the same.
Signed-off-by: Feilian Xie <fxie@redhat.com>
2024-07-09 19:28:14 +08:00
Kubernetes Prow Robot
06c7d9a565
Merge pull request #125966 from pohly/e2e-framework-label-filter-skip-fix
e2e framework: don't add default skip when --label-filter is used
2024-07-09 04:12:38 -07:00
googs1025
15cc77603e chore: use testCtx instead of context.TODO() 2024-07-09 16:20:03 +08:00
Kubernetes Prow Robot
7127246344
Merge pull request #125945 from fxierh/sample-apiserver-rbac-fix
Add missing RBAC permissions to the sample-apiserver
2024-07-09 00:30:41 -07:00
Kubernetes Prow Robot
51bf5df54a
Merge pull request #125836 from mjudeikis/mjudeikis/auth.token.getter
Extend service accounts with optional tokenGetter provider
2024-07-09 00:30:34 -07:00
carlory
f0c2afa19f defaultMaskedPaths must be kept in sync with moby/moby. 2024-07-09 13:22:29 +08:00
Kubernetes Prow Robot
3125877de0
Merge pull request #125949 from jeffinkottaram/fix-status-patch-test
Fix `should complete a service status lifecycle` test
2024-07-08 17:25:20 -07:00
Kubernetes Prow Robot
cf33bef284
Merge pull request #125908 from aojea/race_pforward
fix race on integration test for portforward
2024-07-08 17:25:10 -07:00
Kubernetes Prow Robot
4a48562a81
Merge pull request #125557 from MikeSpreitzer/apf-int-test-tolerate-more-noise
Increase noise margin for TestConcurrencyIsolation
2024-07-08 16:21:34 -07:00
Kubernetes Prow Robot
8c7ee69212
Merge pull request #124730 from tkashem/read-write-deadline-test
Add test to document request timeout behavior
2024-07-08 16:21:25 -07:00
Kubernetes Prow Robot
e48d42d81d
Merge pull request #122627 from sanposhiho/remove-AssignedPodUpdated
take PodTopologySpread into consideration when requeueing Pods based on Pod related events
2024-07-08 16:21:11 -07:00
Kubernetes Prow Robot
7cf5ae8e98
Merge pull request #125930 from sanposhiho/cleanup-ifs
cleanup: remove non-necessary `if`s
2024-07-08 14:13:50 -07:00
Kubernetes Prow Robot
b106c291c3
Merge pull request #125841 from saschagrunert/get-container-events-ctx
cri: allow `GetContainerEvents` to pass a context
2024-07-08 14:13:41 -07:00