package plugin
import "k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin"
Index ¶
- type Plugin
- func NewDRAPluginClient(pluginName string) (*Plugin, error)
- func (p *Plugin) NodePrepareResources( ctx context.Context, req *drapbv1beta1.NodePrepareResourcesRequest, opts ...grpc.CallOption, ) (*drapbv1beta1.NodePrepareResourcesResponse, error)
- func (p *Plugin) NodeUnprepareResources( ctx context.Context, req *drapbv1beta1.NodeUnprepareResourcesRequest, opts ...grpc.CallOption, ) (*drapbv1beta1.NodeUnprepareResourcesResponse, error)
- type RegistrationHandler
- func NewRegistrationHandler(kubeClient kubernetes.Interface, getNode func() (*v1.Node, error), wipingDelay time.Duration) *RegistrationHandler
- func (h *RegistrationHandler) DeRegisterPlugin(pluginName, endpoint string)
- func (h *RegistrationHandler) RegisterPlugin(pluginName string, endpoint string, supportedServices []string, pluginClientTimeout *time.Duration) error
- func (h *RegistrationHandler) Stop()
- func (h *RegistrationHandler) ValidatePlugin(pluginName string, endpoint string, supportedServices []string) error
Types ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func NewDRAPluginClient ¶
NewDRAPluginClient returns a wrapper around those gRPC methods of a DRA driver kubelet plugin which need to be called by kubelet. The wrapper handles gRPC connection management and logging. Connections are reused across different NewDRAPluginClient calls.
func (*Plugin) NodePrepareResources ¶
func (p *Plugin) NodePrepareResources( ctx context.Context, req *drapbv1beta1.NodePrepareResourcesRequest, opts ...grpc.CallOption, ) (*drapbv1beta1.NodePrepareResourcesResponse, error)
func (*Plugin) NodeUnprepareResources ¶
func (p *Plugin) NodeUnprepareResources( ctx context.Context, req *drapbv1beta1.NodeUnprepareResourcesRequest, opts ...grpc.CallOption, ) (*drapbv1beta1.NodeUnprepareResourcesResponse, error)
type RegistrationHandler ¶
type RegistrationHandler struct {
// contains filtered or unexported fields
}
RegistrationHandler is the handler which is fed to the pluginwatcher API.
func NewRegistrationHandler ¶
func NewRegistrationHandler(kubeClient kubernetes.Interface, getNode func() (*v1.Node, error), wipingDelay time.Duration) *RegistrationHandler
NewPluginHandler returns new registration handler.
Must only be called once per process because it manages global state. If a kubeClient is provided, then it synchronizes ResourceSlices with the resource information provided by plugins.
func (*RegistrationHandler) DeRegisterPlugin ¶
func (h *RegistrationHandler) DeRegisterPlugin(pluginName, endpoint string)
DeRegisterPlugin is called when a plugin has removed its socket, signaling it is no longer available.
func (*RegistrationHandler) RegisterPlugin ¶
func (h *RegistrationHandler) RegisterPlugin(pluginName string, endpoint string, supportedServices []string, pluginClientTimeout *time.Duration) error
RegisterPlugin is called when a plugin can be registered.
DRA uses the version array in the registration API to enumerate all gRPC services that the plugin provides, using the "<gRPC package name>.<service name>" format (e.g. "v1beta1.DRAPlugin"). This allows kubelet to determine in advance which version to use resp. which optional services the plugin supports.
func (*RegistrationHandler) Stop ¶
func (h *RegistrationHandler) Stop()
Stop cancels any remaining background activities and blocks until all goroutines have stopped.
func (*RegistrationHandler) ValidatePlugin ¶
func (h *RegistrationHandler) ValidatePlugin(pluginName string, endpoint string, supportedServices []string) error
ValidatePlugin is called by kubelet's plugin watcher upon detection of a new registration socket opened by DRA plugin.
Source Files ¶
plugin.go plugins_store.go registration.go
- Version
- v1.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 23 packages
- Last checked
- 3 hours ago –
Tools for package owners.