deviceplugin

package
v0.0.0-...-1830409 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

TODO: remove orhpan interfaces in another thread TODO: Smarter handling of nicPoolSize TODO: use prestart container request, no need to wait TODO: cleanup if a step fails TODO: load networkSpec annotation name from common module

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocationDevicePlugin

type AllocationDevicePlugin struct{}

AllocationDevicePlugin implements deviceplugin v1beta1 interface. It reports available (fake) devices and connects Pod to requested networks

func (AllocationDevicePlugin) Allocate

Allocate is executed when a new Pod appears and it requires requested resource to be allocated and attached. In our case we create new interface on OVS integration bridge (mapped to selected OVN network) and pass it to the Pod

func (AllocationDevicePlugin) GetDevicePluginOptions

func (dp AllocationDevicePlugin) GetDevicePluginOptions(ctx context.Context, in *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)

GetDevicePluginOptions is used to pass parameters to device manager

func (AllocationDevicePlugin) ListAndWatch

ListAndWatch returns list of devices available on the host. Since we don't work with limited physical interfaces, we report set of virtual devices that are later used to identify Pod

func (AllocationDevicePlugin) PreStartContainer

PreStartContainer is currently unused method that should be later used to move OVS interface to Pod and configure it

type DevicePlugin

type DevicePlugin struct{}

DevicePlugin implements deviceplugin v1beta1 interface. It reports available (fake) devices and connects Pod to requested networks

func (DevicePlugin) Allocate

Allocate is executed when a new Pod appears and it requires requested resource to be allocated and attached. In our case we create new interface on OVS integration bridge (mapped to selected OVN network) and pass it to the Pod TODO: cleanup if fails

func (DevicePlugin) GetDevicePluginOptions

func (dp DevicePlugin) GetDevicePluginOptions(ctx context.Context, in *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)

GetDevicePluginOptions is used to pass parameters to device manager

func (DevicePlugin) ListAndWatch

ListAndWatch returns list of devices available on the host. Since we don't work with limited physical interfaces, we report set of virtual devices that are later used to identify Pod

func (DevicePlugin) PreStartContainer

PreStartContainer is currently unused method that should be later used to move OVS interface to Pod and configure it TODO: use this instead of separate thread during Allocate

type Lister

type Lister struct {
	ResourceNamespace           string
	ReservedMainResourceName    string
	ReservedOverlayResourceName string
}

Lister implements device-plugin-manager Lister interface. It is used to track and initialize available resources within one resource namespace. In this case it handles only one resource - OVN overlay.

func (Lister) Discover

func (l Lister) Discover(pluginListCh chan dpm.PluginNameList)

Discover keeps list of currently available resources. In this implementation it is static, one overlay is always exposed TODO: Check if br-int is available, if not, don't expose any resource

func (Lister) GetResourceNamespace

func (l Lister) GetResourceNamespace() string

GetResourceNamespace returns namespace of the resource

func (Lister) NewPlugin

func (l Lister) NewPlugin(resourceName string) dpm.PluginInterface

NewPlugin initializes new Device Plugin instance. This is called by device-plugin-manager once a new resource is discovered

Jump to

Keyboard shortcuts

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