plugin

package
v0.0.0-...-65eafd7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAvailable

func IsAvailable(port string) bool

func NewFreePort

func NewFreePort() (port int, err error)

func NewFreePorts

func NewFreePorts(n int) []string

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

Allocate which return list of devices.

func (*PortDevicePlugin) Devices

func (m *PortDevicePlugin) Devices() []*pluginapi.Device

func (*PortDevicePlugin) GetDevicePluginOptions

GetDevicePluginOptions returns the values of the optional settings for this plugin

func (*PortDevicePlugin) GetPreferredAllocation

GetPreferredAllocation returns the preferred allocation from the set of devices specified in the request

func (*PortDevicePlugin) ListAndWatch

ListAndWatch lists devices and update that list according to the health status

func (*PortDevicePlugin) PreStartContainer

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.

func (*PortDevicePlugin) Stop

func (m *PortDevicePlugin) Stop() error

Stop stops the gRPC server.

type PortOpt

type PortOpt struct {
	// smallest port can be allocated
	Min int
	// largest port can be allocated
	Max int
	// delimitation, [min, delim) for allocation and [delim, max) for backup
	Delim int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL