Documentation
¶
Overview ¶
Package kubeletplugin provides helper functions for running a dynamic resource allocation kubelet plugin.
Index ¶
- type DRAPlugin
- type Option
- func DriverName(driverName string) Option
- func GRPCInterceptor(interceptor grpc.UnaryServerInterceptor) Option
- func GRPCVerbosity(level int) Option
- func KubeletPluginSocketPath(path string) Option
- func Logger(logger klog.Logger) Option
- func NodeV1alpha2(enabled bool) Option
- func NodeV1alpha3(enabled bool) Option
- func PluginListener(listener net.Listener) Option
- func PluginSocketPath(path string) Option
- func RegistrarListener(listener net.Listener) Option
- func RegistrarSocketPath(path string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DRAPlugin ¶
type DRAPlugin interface { // Stop ensures that all spawned goroutines are stopped and frees // resources. Stop() // RegistrationStatus returns the result of registration, nil if none // received yet. RegistrationStatus() *registerapi.RegistrationStatus // contains filtered or unexported methods }
DRAPlugin gets returned by Start and defines the public API of the generic dynamic resource allocation plugin.
type Option ¶
type Option func(o *options) error
Option implements the functional options pattern for Start.
func DriverName ¶
DriverName defines the driver name for the dynamic resource allocation driver. Must be set.
func GRPCInterceptor ¶
func GRPCInterceptor(interceptor grpc.UnaryServerInterceptor) Option
GRPCInterceptor is called for each incoming gRPC method call. This option may be used more than once and each interceptor will get called.
func GRPCVerbosity ¶
GRPCVerbosity sets the verbosity for logging gRPC calls. Default is 4. A negative value disables logging.
func KubeletPluginSocketPath ¶
KubeletPluginSocketPath defines how kubelet will connect to the dynamic resource allocation plugin. This corresponds to PluginSocketPath, except that PluginSocketPath defines the path in the filesystem of the caller and KubeletPluginSocketPath in the filesystem of kubelet.
func Logger ¶
func Logger(logger klog.Logger) Option
Logger overrides the default klog.Background logger.
func NodeV1alpha2 ¶ added in v0.28.0
NodeV1alpha2 explicitly chooses whether the DRA gRPC API v1alpha2 gets enabled.
func NodeV1alpha3 ¶ added in v0.28.0
NodeV1alpha2 explicitly chooses whether the DRA gRPC API v1alpha3 gets enabled.
func PluginListener ¶
PluginListener sets an already created listener for the dynamic resource allocation plugin API. Can be combined with PluginSocketPath.
At least one of these two options is required.
func PluginSocketPath ¶
PluginSocketPath sets the file path for a Unix domain socket. If PluginListener is not used, then Start will remove a file at that path, should one exist, and creates a socket itself. Otherwise it uses the provided listener and only removes the socket at the specified path during shutdown.
At least one of these two options is required.
func RegistrarListener ¶
RegistrarListener sets an already created listener for the plugin registrarion API. Can be combined with RegistrarSocketPath.
At least one of these two options is required.
func RegistrarSocketPath ¶
RegistrarSocketPath sets the file path for a Unix domain socket. If RegistrarListener is not used, then Start will remove a file at that path, should one exist, and creates a socket itself. Otherwise it uses the provided listener and only removes the socket at the specified path during shutdown.
At least one of these two options is required.