deviceplugin

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PluginDeviceCheckInterval

func PluginDeviceCheckInterval(i time.Duration) func(*pluginManagerOptions)

func PluginManagerKubeletSocket

func PluginManagerKubeletSocket(socket string) func(*pluginManagerOptions)

func PluginManagerSocketPrefix

func PluginManagerSocketPrefix(prefix string) func(*pluginManagerOptions)

Types

type Plugin

type Plugin struct {
	Logger        *zap.Logger
	ResourceName  string
	SocketWatcher *SocketWatcher
	Socket        string
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin(l *zap.Logger, resourceName string, socketWatcher *SocketWatcher, pluginDir string,
	initialDeviceCount int, deviceType v1alpha1.DeviceType, kubeletSocket string, deviceCheckInterval time.Duration,
) *Plugin

func (*Plugin) CleanOldState

func (p *Plugin) CleanOldState() error

func (*Plugin) Run

func (p *Plugin) Run(ctx context.Context)

Run runs the plugin until the context is cancelled, restarting the server as needed

func (*Plugin) UpdateDeviceCount

func (p *Plugin) UpdateDeviceCount(count int)

type PluginManager

type PluginManager struct {
	Logger *zap.Logger
	// contains filtered or unexported fields
}

PluginManager runs device plugins for vnet nics and ib nics

func NewPluginManager

func NewPluginManager(l *zap.Logger, opts ...pluginManagerOption) *PluginManager

func (*PluginManager) AddPlugin

func (pm *PluginManager) AddPlugin(deviceType v1alpha1.DeviceType, deviceCount int) *PluginManager

func (*PluginManager) Run

func (pm *PluginManager) Run(ctx context.Context) error

Run runs the plugin manager until the context is cancelled or error encountered

func (*PluginManager) TrackDevices

func (pm *PluginManager) TrackDevices(deviceType v1alpha1.DeviceType, count int)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(logger *zap.Logger, address string, deviceCounter deviceCounter, deviceCheckInterval time.Duration) *Server

func (*Server) Allocate

This is a dummy implementation for allocate to conform to the interface requirements. Allocate is called during container creation so that the Device Plugin can run device specific operations and instruct Kubelet of the steps to make the Device available in the container We are not using this functionality currently

func (*Server) GetDevicePluginOptions

func (s *Server) GetDevicePluginOptions(context.Context, *v1beta1.Empty) (*v1beta1.DevicePluginOptions, error)

func (*Server) ListAndWatch

func (s *Server) ListAndWatch(_ *v1beta1.Empty, stream v1beta1.DevicePlugin_ListAndWatchServer) error

func (*Server) Ready

func (s *Server) Ready(ctx context.Context) error

Ready blocks until the server is ready

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the grpc server and blocks until an error or context is cancelled. Wait on Ready to know when the server is ready.

type SocketWatcher

type SocketWatcher struct {
	// contains filtered or unexported fields
}

func NewSocketWatcher

func NewSocketWatcher(logger *zap.Logger, opts ...SocketWatcherOption) *SocketWatcher

func (*SocketWatcher) WatchSocket

func (s *SocketWatcher) WatchSocket(ctx context.Context, socket string) <-chan struct{}

watchSocket returns a channel that will be closed when the socket is removed or the context is cancelled

type SocketWatcherOption

type SocketWatcherOption func(*socketWatcherOptions)

func SocketWatcherStatInterval

func SocketWatcherStatInterval(d time.Duration) SocketWatcherOption

Jump to

Keyboard shortcuts

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