Commit Graph

4 Commits

Author SHA1 Message Date
Patrick Ohly de4c476767 DRA kubelet: use unique protobuf package name
As mentioned in https://protobuf.dev/programming-guides/style, package names
"should be unique". For generated API pb files, Kubernetes uses
"k8s.io.api.<api group>.<version>". The same approach is now used for the
kubelet DRA v1beta1 API. This can be changed without a breaking change because
the API is still unreleased.

This avoids a conflict between the DevicePlugin and the DRA API when both get
used by kubelet:

    2024/11/10 12:51:40 proto: duplicate proto type registered: v1beta1.Device

The exact impact of that conflict is unknown but it seems better to
pro-actively avoid the problem.

Kubernetes-commit: 6c27e8dc8f789fd9daf11f6fc367adf586f727b5
2024-11-27 19:53:01 +00:00
Patrick Ohly 4109653856 DRA kubelet: separate beta and alpha gRPC APIs
Reusing types from the alpha in the beta made it possible to provide and use
both versions without conversion. The downside was that removal of the alpha
would have been harder, if not impossible. DRA drivers could continue to
use the alpha types and provided the beta interface automatically.

Now the two versions are completely separate gRPC APIs, although in practice
there are no differences besides the name. Support for the alpha API in kubelet
is provided via automatically generated conversion and manually written
interface wrappers.

Those are provided as part of the v1alpha4 package. The advantage of having all
of that in a central place is that it'll be easier to remove when no longer
needed.

Kubernetes-commit: 9261a182bb7693bc603a94e76af8bf98168ca16e
2024-11-07 07:38:10 +01:00
Patrick Ohly 5cbf982c86 DRA kubelet: rename gRPC server from Node to DRAPlugin in v1beta1
The version bump is an opportunity to pick a name that is a bit more
descriptive. It matches the "DevicePlugin" service name.

Kubernetes-commit: 437be1e651a6c5ff2259975c77af8575d2e66449
2024-11-02 20:34:04 +01:00
Patrick Ohly cc48d93402 DRA kubelet: add v1beta1 gRPC API
The v1beta1 API is identical to the previous v1alpha4, which erroneously was
still called "v1alpha3" in a few places, including the gRPC interface
definition itself.

The only reason for v1beta1 is to document the increased maturity of this API.

To simplify the transition, kubelet supports both v1alpha4 and v1beta1, picking
the more recent one automatically. All that DRA driver authors need to do to
implement v1beta1 is to update to the latest
k8s.io/dynamic-resource-allocation/kubeletplugin: it will automatically
register both API versions unless explicitly configured otherwise, which is
mostly just for testing.

DRA driver authors may replace their package import of v1alpha4 with v1beta1,
but they don't have to because the types in both packages are the same.

Kubernetes-commit: 7b3a9afca35cf60f4a5bc1d9cca5e25ff414d39d
2024-09-20 17:09:18 +02:00