Documentation
¶
Index ¶
- type DevicePlugin
- type NullDevicePlugin
- func (m *NullDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (m *NullDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (m *NullDevicePlugin) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
- func (m *NullDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (m *NullDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (m *NullDevicePlugin) Register() error
- func (m *NullDevicePlugin) Serve() error
- func (m *NullDevicePlugin) Start() error
- func (m *NullDevicePlugin) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DevicePlugin ¶
type DevicePlugin interface {
Start() error
Stop() error
Serve() error
Register() error
GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
}
type NullDevicePlugin ¶
type NullDevicePlugin struct {
// contains filtered or unexported fields
}
NullDevicePlugin implements the Kubernetes device plugin API
func NewNullDevicePlugin ¶
func NewNullDevicePlugin(resourceName string, socket string) *NullDevicePlugin
NewNullDevicePlugin returns an initialized NullDevicePlugin
func (*NullDevicePlugin) Allocate ¶
func (m *NullDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
Allocate which return list of devices.
func (*NullDevicePlugin) GetDevicePluginOptions ¶
func (m *NullDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
GetDevicePluginOptions returns the values of the optional settings for this plugin
func (*NullDevicePlugin) GetPreferredAllocation ¶
func (m *NullDevicePlugin) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
GetPreferredAllocation returns the preferred allocation from the set of devices specified in the request
func (*NullDevicePlugin) ListAndWatch ¶
func (m *NullDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
ListAndWatch lists devices and update that list according to the health status
func (*NullDevicePlugin) PreStartContainer ¶
func (m *NullDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
PreStartContainer is unimplemented for this plugin
func (*NullDevicePlugin) Register ¶
func (m *NullDevicePlugin) Register() error
Register registers the device plugin for the given resourceName with Kubelet.
func (*NullDevicePlugin) Serve ¶
func (m *NullDevicePlugin) Serve() error
Serve starts the gRPC server of the device plugin.
func (*NullDevicePlugin) Start ¶
func (m *NullDevicePlugin) Start() error
Start starts the gRPC server, registers the device plugin with the Kubelet, and starts the device healthchecks.