Commit Graph

112035 Commits

Author SHA1 Message Date
Patrick Ohly
14db9d1f92 e2e dra: add test driver and tests for dynamic resource allocation
The driver can be used manually against a cluster started with
local-up-cluster.sh and is also used for E2E testing. Because the tests proxy
connections from the nodes into the e2e.test binary and create/delete files via
the equivalent of "kubectl exec dd/rm", they can be run against arbitrary
clusters. Each test gets its own driver instance and resource class, therefore
they can run in parallel.
2022-11-12 00:17:15 +01:00
Patrick Ohly
b2c39798f4 staging dra: use MutationCache in controller
Directly after modifying a ResourceClaim in the apiserver, the locally cached
copy is outdated until the informer receives the update. If any operation looks
at the claim during that time frame, it will act based on stale
information. For example, it might try to allocate again. If that works because
of idempotency, then the following update operation fails with a conflict
error.

This is harmless, but leads to confusing log output. It can be avoided by
keeping a copy of the updated claim and using that instead of the one from the
informer cache.
2022-11-12 00:12:03 +01:00
Patrick Ohly
bb040efd84 staging: generic dynamic resource allocation driver code
These helper packages implement the parts of a dynamic resource allocation
driver that are generic and can be used by the in-tree test driver as well as
out-of-tree vendor drivers.

Functional options make it possible to treat some parameters as
optional (logger) and extend the API later on.
2022-11-12 00:11:35 +01:00
Ed Bartosh
abcb56defb kubelet: do not enter termination status if pod might need to unprepare resources 2022-11-11 21:58:03 +01:00
Ed Bartosh
ae0f38437c kubelet: add support for dynamic resource allocation
Dependencies need to be updated to use
github.com/container-orchestrated-devices/container-device-interface.

It's not decided yet whether we will implement Topology support
for DRA or not. Not having any toppology-related code
will help to avoid wrong impression that DRA is used as a hint
provider for the Topology Manager.
2022-11-11 21:58:03 +01:00
Patrick Ohly
d2ff210c20 scheduler: add dynamic resource allocation plugin
The plugin handles the interaction with ResourceClaims that are referenced by a
Pod.
2022-11-11 21:58:03 +01:00
Patrick Ohly
0133df3929 kube-controller-manager: add ResourceClaim controller
The controller uses the exact same logic as the generic ephemeral inline volume
controller, just for inline ResourceClaimTemplate -> ResourceClaim.

In addition, it supports removal of pods from the ReservedFor field when those
pods are known to not need the claim anymore. At the moment, only this special
case is supported. Removal of arbitrary objects would imply granting full read
access to all types to determine whether a) an object is gone and b) if the
current incarnation is the one which is listed in ReservedFor. This may get
added later.
2022-11-10 20:23:50 +01:00
Patrick Ohly
b87530af4f kube-controller-manager: clone resource controller from volume/ephemeral 2022-11-10 20:23:50 +01:00
Patrick Ohly
59d46c026f staging: add ResourceClaim support code
This is similar to the support code for generic ephemeral inline volumes.
Differences:
- to avoid stuttering, the functions are just resourceclaim.Name and
  resourceclaim.IsForPod
- resourceclaim.Name returns the right name for both cases (template
  and reference), which will simplify some code

Other helper functions check some simple status conditions.
2022-11-10 20:23:50 +01:00
Patrick Ohly
76cb805af2 staging: create dynamic resource allocation repo
This will be used for different individual packages. A separate repo
is better than reusing something like component-helpers because dependencies
will be different.
2022-11-10 20:23:50 +01:00
Patrick Ohly
c34185b2e5 logcheck.conf: ensure that dra uses contextual logging
It's new code, so we should follow the latest recommendations for logging.
2022-11-10 20:23:50 +01:00
Patrick Ohly
8018ab7cd9 api: fully validate PotentialNodes and SuitableNodes
This is in response to review feedback. Checking for valid node names and the
set property catches programming mistakes in the components that have write
permission.
2022-11-10 20:23:50 +01:00
Patrick Ohly
ec06d2c1fd api: update testdata
This is the result of

   cd staging/src/k8s.io/api && UPDATE_COMPATIBILITY_FIXTURE_DATA=true go test ./...
2022-11-10 20:23:47 +01:00
Patrick Ohly
5c5e060fb8 api: implement printers for dynamic resource allocation
This is needed for "kubectl get". It depends on the generated swagger docs.
2022-11-10 20:22:47 +01:00
Patrick Ohly
9683c60c05 api: generated files 2022-11-10 20:22:42 +01:00
Patrick Ohly
5cca60f0b8 api: dynamic resource allocation API
This adds a new resource.k8s.io API group with v1alpha1 as version. It contains
four new types: resource.ResourceClaim, resource.ResourceClass, resource.ResourceClaimTemplate, and
resource.PodScheduling.
2022-11-10 20:08:24 +01:00
Patrick Ohly
5433da0419 test: adapt reference data to Pod changes
These tests print a v1.Pod with Sprintf, which includes the new field even when
it is empty.
2022-11-10 20:08:24 +01:00
Patrick Ohly
7d11b422e3 api: add resource claims to core API
The resource.k8s.io/ClaimTemplate only gets referenced by name, therefore the
changes to the core API are limited.
2022-11-10 20:08:24 +01:00
Patrick Ohly
155d49813f kube features: add DynamicResourceAllocation 2022-11-10 20:08:24 +01:00
Kubernetes Release Robot
3964214dc3 CHANGELOG: Update directory for v1.23.14 release 2022-11-10 17:30:13 +00:00
Kubernetes Release Robot
b01f1c7503 CHANGELOG: Update directory for v1.22.16 release 2022-11-10 17:29:04 +00:00
Kubernetes Release Robot
675c43eb60 CHANGELOG: Update directory for v1.24.8 release 2022-11-10 17:27:53 +00:00
Kubernetes Release Robot
43ff82d112 CHANGELOG: Update directory for v1.25.4 release 2022-11-10 16:50:55 +00:00
Kubernetes Prow Robot
d94261e904
Merge pull request #113186 from ttakahashi21/KEP-3294
Introduce APIs to support CrossNamespaceSourceProvisioning
2022-11-10 08:06:54 -08:00
Kubernetes Prow Robot
70e73a6cda
Merge pull request #113809 from jsafrane/add-selinux-feature
Add [Feature:SELinux] to all tests that require SELinux
2022-11-10 02:46:54 -08:00
Jan Safranek
ee12e3ff42 Add [Feature:SELinux] to all tests that require SELinux
Most CI jobs run an OS that does not support SELinux, therefore tests that
need it should be skipped by default.

* [Feature:SELinux] marks tests that need SELinux (for any feature)
* [Feature:SELinuxMountReadWriteOncePod] marks tests that need
  SELinuxMountReadWriteOncePod alpha gate enabled.

Currently, all SELinux tests have both, but it will change in the future.
2022-11-10 10:18:11 +01:00
Kubernetes Prow Robot
77b027936a
Merge pull request #113803 from dashpole/revert-113693-apiserver_tracing_beta
Revert "Graduate API Server tracing to beta"
2022-11-09 23:36:53 -08:00
Kubernetes Prow Robot
72a25b1772
Merge pull request #113735 from cici37/renameDir
Rename cel admission package and the feature gate to validatingadmissionpolicy
2022-11-09 20:40:57 -08:00
Cici Huang
2973712486 Rename FG to ValidatingAdmissionPolicy 2022-11-10 03:37:35 +00:00
Cici Huang
e81820dd20 Update modules.txt 2022-11-10 03:37:35 +00:00
Cici Huang
40c21dafcd Rename admission cel package to validatingadmissionpolicy 2022-11-10 03:37:30 +00:00
David Ashpole
e799fcdadd
Revert "Graduate API Server tracing to beta" 2022-11-09 22:37:28 -05:00
Kubernetes Prow Robot
98bd73cfe0
Merge pull request #113724 from kerthcet/cleanup/klog
Replace klog with benchmark log framework in scheduler_perf
2022-11-09 19:34:53 -08:00
Kubernetes Prow Robot
aeb8a8dfa4
Merge pull request #113758 from alexzielenski/readyFunc-refactor
use admission.Handler readyFunc for CEL Admission plugin
2022-11-09 18:24:53 -08:00
Alexander Zielenski
acf571fcbe add test for error when informers are not ready 2022-11-09 17:23:50 -08:00
Kubernetes Prow Robot
f87231003a
Merge pull request #113475 from DangerOnTheRanger/validation-admission-metrics-integration
Validating admission metrics integration
2022-11-09 16:00:54 -08:00
Alexander Zielenski
df315f347c use existing admissionHandler readyfunc to wait for sync
is what other plugins do, and should decrease verbosity in logs
2022-11-09 15:28:35 -08:00
Kubernetes Prow Robot
2c1b7f5759
Merge pull request #112618 from jingyuanliang/fastStatusUpdateOnce
kubelet: Keep trying fast status update at startup until node is ready
2022-11-09 13:30:53 -08:00
Takafumi Takahashi
cb12a2bc51 Generate code 2022-11-09 21:21:52 +00:00
Takafumi Takahashi
87c1ca88d4 Add API and validation for CrossNamespaceVolumeDataSource 2022-11-09 20:58:25 +00:00
Kubernetes Prow Robot
623376bc82
Merge pull request #113788 from PiotrProkop/fix-discovering-numa-distance
Fix discovering numa distance when node ids are not starting from 0 or it's ids are not sequential
2022-11-09 12:22:53 -08:00
Kubernetes Prow Robot
8eddcac00a
Merge pull request #113597 from ionutbalutoiu/tests/lifecycle-hooks
tests: Spawn poststart / prestop pods on the same node as the https pod
2022-11-09 11:12:40 -08:00
Kubernetes Prow Robot
ff19efdf9b
Merge pull request #112744 from pwschuurman/statefulset-slice-impl
Add implementation of KEP-3335, StatefulSetSlice
2022-11-09 11:12:28 -08:00
Kermit Alexander II
99494e6777 Add metrics integration. 2022-11-09 19:10:54 +00:00
Kubernetes Prow Robot
c84e920a48
Merge pull request #113786 from sanposhiho/revert-prefilter-skip
Revert "feature(scheduler): won't run Filter if PreFilter returned a Skip status"
2022-11-09 10:08:13 -08:00
PiotrProkop
540b5bd308 [topologymanager] rely on Cadvisor to calculate NUMA distance
Signed-off-by: PiotrProkop <pprokop@nvidia.com>
2022-11-09 17:52:14 +01:00
PiotrProkop
315f0dc6f1 Fix discovering numa distance when node ids are not starting from 0 or their ids are not sequential
Signed-off-by: PiotrProkop <pprokop@nvidia.com>
2022-11-09 17:52:08 +01:00
Kubernetes Prow Robot
37e73b419e
Merge pull request #113769 from bobbypage/bump-cadvisor-v046
deps: Bump cAdvisor to v0.46.0
2022-11-09 08:31:08 -08:00
Kubernetes Prow Robot
e9ef6ee8b3
Merge pull request #113754 from logicalhan/kubelet-metrics
fix credential provider metric names
2022-11-09 08:31:00 -08:00
Kubernetes Prow Robot
f2fccffd9b
Merge pull request #113708 from apelisse/fix-ssa-flaky-test
Ignore error when getting api-resources until it's ready
2022-11-09 08:30:48 -08:00