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 ¶
- type AllocationDevicePlugin
- func (dp AllocationDevicePlugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (dp AllocationDevicePlugin) GetDevicePluginOptions(ctx context.Context, in *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (dp AllocationDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (dp AllocationDevicePlugin) PreStartContainer(ctx context.Context, r *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- type DevicePlugin
- func (dp DevicePlugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (dp DevicePlugin) GetDevicePluginOptions(ctx context.Context, in *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (dp DevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (dp DevicePlugin) PreStartContainer(ctx context.Context, r *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- type Lister
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 ¶
func (dp AllocationDevicePlugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
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 ¶
func (dp AllocationDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
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 ¶
func (dp AllocationDevicePlugin) PreStartContainer(ctx context.Context, r *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
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 ¶
func (dp DevicePlugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
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 ¶
func (dp DevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
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 ¶
func (dp DevicePlugin) PreStartContainer(ctx context.Context, r *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
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 ¶
GetResourceNamespace returns namespace of the resource