Commit Graph

122180 Commits

Author SHA1 Message Date
Michal Wozniak
1163c7ed9c Adjust the API comments to the current state 2024-03-08 17:29:49 +01:00
Kubernetes Prow Robot
e0a142dc5c
Merge pull request #123815 from mimowo/job-managed-by-test2
Follow up fix to the job status update test
2024-03-08 08:00:35 -08:00
Kubernetes Prow Robot
5639f8f848
Merge pull request #123723 from mimowo/job-managed-by-impl-test
Integration test for change in syncOrphanPod for managedBy jobs
2024-03-08 06:35:36 -08:00
Joel Speed
793ac57e5a
Fix field path on CustomResource status update validations 2024-03-08 18:00:05 +04:00
Kubernetes Prow Robot
74b2f4d976
Merge pull request #123821 from dims/check-taints-as-well-for-control-plane
Check taints as well for control-plane
2024-03-08 05:32:32 -08:00
Davanum Srinivas
ee64b30d05
Check taints as well for control-plane
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-03-08 07:17:21 -05:00
Michal Wozniak
acf6b500ee Follow up fix to the job status update test 2024-03-08 07:33:10 +01:00
Nilekh Chaudhari
91a7708cdc
feat: implements Storage Version Migration API in-tree
Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>
2024-03-08 04:18:56 +00:00
Kubernetes Prow Robot
7ea3d0245a
Merge pull request #123516 from pohly/dra-structured-parameters
DRA: structured parameters
2024-03-07 19:24:48 -08:00
Kubernetes Prow Robot
5ec8dc8c6f
Merge pull request #123803 from dims/revert-portion-of-the-gpu-test-case
Revert portion of the GPU testcase
2024-03-07 18:21:15 -08:00
Kubernetes Prow Robot
9ad2aabc64
Merge pull request #123520 from haircommander/proc-mount-rely-userns-2
KEP-4265: Update Unmasked ProcMountType to fail validation without a pod level user namespace
2024-03-07 18:21:08 -08:00
Kubernetes Prow Robot
b1741c004b
Merge pull request #123811 from tallclair/apparmor-ga
Keep providing the deprecated AppArmor CRI API for runtimes that haven't migrated
2024-03-07 16:18:44 -08:00
Tim Allclair
04ac13b6b7 Keep providing the deprecated AppArmor CRI API for runtimes that haven't migrated 2024-03-07 15:00:07 -08:00
Kubernetes Prow Robot
364ef335db
Merge pull request #123412 from tenzen-y/add-new-jobsuccesspolicy-api
Job: Support for the SuccessPolicy
2024-03-07 14:49:20 -08:00
Patrick Ohly
6a361e1f36 dra api: enable new CEL features by faking their version
There are two approaches for making new versioned CEL features available in the
release where they get introduced:
- Always use the environment for "StoredExpressions".
- Use an older version (typically 1.0) and only bump it up later.

The second approach was used before, so this is now also done here.
2024-03-07 22:26:20 +01:00
Patrick Ohly
7f5566ac6f dra e2e: enable more tests for usage with structured parameters
This finishes the shuffling around of test scenarios so that all of them which
make sense with structured parameters are also executed with those.
2024-03-07 22:26:20 +01:00
Patrick Ohly
251b3859b0 dra scheduler: consider in-flight allocation for resource calculation
Storing a modified claim with allocation and the original resource version in
the assume cache was not reliable: if an update was received, it replaced the
modified claim and the resource that was reserved for the claim might have been
used for some other claim.

To fix this, the in-flight claims are now stored in the map instead of just a
boolean and the status stored there overrides whatever is in the assume cache.

Logging got extended to diagnose this problem better. It started to occur in
E2E tests after splitting the claim update so that first the finalizer is set
and then the status, because setting the finalizer triggered an update.
2024-03-07 22:26:16 +01:00
Patrick Ohly
2c6246c906 dra e2e: move ResourceSlice test
This should better run with multiple nodes, it's more realistic that way.
2024-03-07 22:23:03 +01:00
Patrick Ohly
0b6a0d686a dra api: rename NodeResourceSlice -> ResourceSlice
While currently those objects only get published by the kubelet for node-local
resources, this could change once we also support network-attached
resources. Dropping the "Node" prefix enables such a future extension.

The NodeName in ResourceSlice and StructuredResourceHandle then becomes
optional. The kubelet still needs to provide one and it must match its own node
name, otherwise it doesn't have permission to access ResourceSlice objects.
2024-03-07 22:22:55 +01:00
Patrick Ohly
42ee56f093 dra api: implement semver attribute value type
This adds support for semantic version comparison to the CEL support in the
"named resources" structured parameter model. For example, it can be used to
check that an instance supports a certain API level.

To minimize the risk, the new "semver" type is only defined in the CEL
environment for DRA expressions, not in the base library. See
https://github.com/kubernetes/kubernetes/pull/123664 for a PR which
adds it to the base library.

Validation of semver strings is done with the regular expression from
semver.org. The actual evaluation at runtime then uses semver/v4.
2024-03-07 22:22:13 +01:00
Patrick Ohly
234dc1f63d dra e2e: run more test scenarios with structured parameters 2024-03-07 22:22:13 +01:00
Patrick Ohly
d59676a545 dra kubelet: publish NodeResourceSlices
The information is received from the DRA driver plugin through a new gRPC
streaming interface. This is backwards compatible with old DRA driver kubelet
plugins, their gRPC server will return "not implemented" and that can be
handled by kubelet. Therefore no API break is needed.

However, DRA drivers need to be updated because the Go API changed. They can
return
    status.New(codes.Unimplemented, "no node resource support").Err()
if they don't support the new ListAndWatchResources method and
structured parameters.

The controller in kubelet then synchronizes this information from the driver
with NodeResourceSlice objects, creating, updating and deleting them as needed.
2024-03-07 22:22:13 +01:00
Patrick Ohly
5e40afca06 dra testing: add tests for structured parameters
The test driver now supports a ConfigMap (as before) and the named resources
structured parameter model. It doesn't have any instance attributes.
2024-03-07 22:22:13 +01:00
Patrick Ohly
3de376ecf6 dra controller: support structured parameters
When allocation was done by the scheduler, the controller needs to do the
deallocation because there is no control-plane controller which could react to
"DeallocationRequested".
2024-03-07 22:22:13 +01:00
Patrick Ohly
6f1ddfcd2e kubelet: support structured parameters for preparing resources
If the resource handle has data from a structured parameter model, then we need
to pass that to the DRA driver kubelet plugin. Because Kubernetes uses
gogo/protobuf, we cannot use "optional" for that new optional field and have to
resort to "repeated" with a single repetition if present.

This is a new, backwards-compatible field.

That extending the resource.k8s.io changes the checksum of a kubelet checkpoint
is unfortunate. Updating the test cases is a stop-gap measure, the actual
solution will have to be something else before beta.
2024-03-07 22:22:13 +01:00
Patrick Ohly
4ed2b3eaeb scheduler_perf: test DRA with structured parameters 2024-03-07 22:21:58 +01:00
Patrick Ohly
d4d5ade7f5 dra: add "named resources" structured parameter model
Like the current device plugin interface, a DRA driver using this model
announces a list of resource instances. In contrast to device plugins, this
list is made available to the scheduler together with attributes that can be
used to select suitable instances when they are not all alike.

Because this is the first structured parameter model, some checks that
previously were not possible, in particular "is one structured parameter field
set", now gets enabled. Adding another structured parameter model will be
similar.

The applyconfigs code generator assumes that all types in an API are defined in
a single package. If it wasn't for that, it would be possible to place the
"named resources" types in separate packages, which makes their names in the Go
code more natural and provides an indication of their stability level because
the package name could include a version.
2024-03-07 22:21:16 +01:00
Patrick Ohly
096e948905 dra scheduler: support structured parameters
When a claim uses structured parameters, as indicated by the resource class
flag, the scheduler is responsible for allocating it. To do this it needs to
gather information about available node resources by watching
NodeResourceSlices and then match the in-tree claim parameters against those
resources.
2024-03-07 22:21:04 +01: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
Peter Hunt
1f9c271c8c PSA: update procmount tests to have hostUsers
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2024-03-07 15:56:06 -05:00
Peter Hunt
23706cb90c api validation: validate proc mount against user namespace
fail if container uses proc mount unmasked but pod does not use user namespace

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2024-03-07 15:56:06 -05:00
Yuki Iwai
e216742672 Job: Support for the JobSuccessPolicy (alpha)
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2024-03-08 05:49:09 +09:00
Kubernetes Prow Robot
cc6d9b3037
Merge pull request #123789 from tallclair/apparmor-warnings
Warn on deprecated AppArmor annotation use
2024-03-07 11:53:54 -08:00
Kubernetes Prow Robot
46f017a90b
Merge pull request #123770 from Jefftree/go-restful
fix aggregator path filtering to include /
2024-03-07 10:21:53 -08:00
Tim Allclair
7bd78b06e9 Warn on deprecated AppArmor annotation use 2024-03-07 09:51:48 -08:00
Davanum Srinivas
b1341c8795
Revert portion of the GPU testcase
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-03-07 12:39:04 -05:00
Kubernetes Prow Robot
ebf4ca686a
Merge pull request #123801 from HirazawaUi/followup-allow-special-characters
Follow-up on unresolved question in PR #123385
2024-03-07 09:18:17 -08:00
Michal Wozniak
194009fac9 Add integration test for managedBy and cleanup of finalizers 2024-03-07 17:54:16 +01:00
HirazawaUi
2867be47b3 followup to allow special characters 2024-03-08 00:08:43 +08:00
Kubernetes Prow Robot
246e678acc
Merge pull request #123751 from mimowo/job-update-conformance-test
Update Job conformance test for job status updates
2024-03-07 07:49:24 -08:00
Patrick Ohly
a92d2a4cea noderestriction admission: lock down create of NodeResourceSlice
The proper value of NodeName must be checked here for create because
the node authorizer cannot do it.
2024-03-07 16:15:52 +01:00
Patrick Ohly
2e34e187c9 node authorizer: lock down access for NodeResourceSlice
The kubelet running on one node should not be allowed to access
NodeResourceSlice objects belonging to some other node, as defined by the
NodeResourceSlice.NodeName field.
2024-03-07 16:15:52 +01:00
Patrick Ohly
39bbcedbca dra api: add structured parameters
NodeResourceSlice will be used by kubelet to publish resource information on
behalf of DRA drivers on the node. NodeName and DriverName in
NodeResourceSlice must be immutable. This simplifies tracking the different
objects because what they are for cannot change after creation.

The new field in ResourceClass tells scheduler and autoscaler that they are
expected to handle allocation.

ResourceClaimParameters and ResourceClassParameters are new types for telling
in-tree components how to handle claims.
2024-03-07 16:15:31 +01:00
Patrick Ohly
eb1470d60d scheduler: fix assume cache with no index
The assume cache in the volumbinding plugin can be created with no separate
index, but List then failed because it tried to use the empty index name
instead of using the store's List function.
2024-03-07 16:09:44 +01:00
Kubernetes Prow Robot
bf7fcfdc7f
Merge pull request #123776 from dims/adjust-gpu-test-to-work-with-latest-nvidia-daemonset
Adjust GPU test to work with latest nvidia daemonset on AWS/ec2
2024-03-07 06:30:55 -08:00
Kubernetes Prow Robot
a035f5b19e
Merge pull request #123774 from cici37/vapGA
Enabled conformance test for GA feature.
2024-03-07 06:30:48 -08:00
Kubernetes Prow Robot
fb1d8b015d
Merge pull request #123798 from cpanato/update-bot
Update publishing-bot rules to Go 1.21.8
2024-03-07 05:24:39 -08:00
cpanato
48daa91857
Update publishing-bot rules to Go 1.21.8
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-03-07 06:32:51 -05:00
Kubernetes Prow Robot
a31a465405
Merge pull request #123735 from thockin/master
Don't embed plural exceptions in tools
2024-03-07 02:08:27 -08:00
Stephen Kitt
6bf667af06
Switch from golang/mock to uber-go/mock
See https://github.com/golang/mock#gomock: golang/mock is no longer
maintained, and should be replaced by go.uber.org/mock.

This allows golang/mock to be dropped from the status and vendored
fields in unwanted-dependencies.json.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-03-07 09:12:16 +01:00