Documentation ¶
Index ¶
- func IsAvailable(port string) bool
- func NewFreePort() (port int, err error)
- func NewFreePorts(n int) []string
- type PortDevicePlugin
- func (m *PortDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (m *PortDevicePlugin) Devices() []*pluginapi.Device
- func (m *PortDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (m *PortDevicePlugin) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
- func (m *PortDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (m *PortDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (m *PortDevicePlugin) Register() error
- func (m *PortDevicePlugin) Serve() error
- func (m *PortDevicePlugin) Start() error
- func (m *PortDevicePlugin) Stop() error
- type PortOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAvailable ¶
func NewFreePort ¶
func NewFreePorts ¶
Types ¶
type PortDevicePlugin ¶
type PortDevicePlugin struct { pluginapi.UnimplementedDevicePluginServer // contains filtered or unexported fields }
PortDevicePlugin implements the Kubernetes device plugin API
func NewPortDevicePlugin ¶
func NewPortDevicePlugin(resourceName string, deviceListEnvvar string, deviceListAnnotations string, socket string, portOpt *PortOpt) *PortDevicePlugin
NewPortDevicePlugin returns an initialized PortDevicePlugin
func (*PortDevicePlugin) Allocate ¶
func (m *PortDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
Allocate which return list of devices.
func (*PortDevicePlugin) Devices ¶
func (m *PortDevicePlugin) Devices() []*pluginapi.Device
func (*PortDevicePlugin) GetDevicePluginOptions ¶
func (m *PortDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
GetDevicePluginOptions returns the values of the optional settings for this plugin
func (*PortDevicePlugin) GetPreferredAllocation ¶
func (m *PortDevicePlugin) 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 (*PortDevicePlugin) ListAndWatch ¶
func (m *PortDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
ListAndWatch lists devices and update that list according to the health status
func (*PortDevicePlugin) PreStartContainer ¶
func (m *PortDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
PreStartContainer is unimplemented for this plugin
func (*PortDevicePlugin) Register ¶
func (m *PortDevicePlugin) Register() error
Register registers the device plugin for the given resourceName with Kubelet.
func (*PortDevicePlugin) Serve ¶
func (m *PortDevicePlugin) Serve() error
Serve starts the gRPC server of the device plugin.
func (*PortDevicePlugin) Start ¶
func (m *PortDevicePlugin) Start() error
Start starts the gRPC server, registers the device plugin with the Kubelet, and starts the device healthchecks.