Documentation ¶
Index ¶
- func PluginDeviceCheckInterval(i time.Duration) func(*pluginManagerOptions)
- func PluginManagerKubeletSocket(socket string) func(*pluginManagerOptions)
- func PluginManagerSocketPrefix(prefix string) func(*pluginManagerOptions)
- type Plugin
- type PluginManager
- type Server
- func (s *Server) Allocate(_ context.Context, req *v1beta1.AllocateRequest) (*v1beta1.AllocateResponse, error)
- func (s *Server) GetDevicePluginOptions(context.Context, *v1beta1.Empty) (*v1beta1.DevicePluginOptions, error)
- func (s *Server) GetPreferredAllocation(context.Context, *v1beta1.PreferredAllocationRequest) (*v1beta1.PreferredAllocationResponse, error)
- func (s *Server) ListAndWatch(_ *v1beta1.Empty, stream v1beta1.DevicePlugin_ListAndWatchServer) error
- func (s *Server) PreStartContainer(context.Context, *v1beta1.PreStartContainerRequest) (*v1beta1.PreStartContainerResponse, error)
- func (s *Server) Ready(ctx context.Context) error
- func (s *Server) Run(ctx context.Context) error
- type SocketWatcher
- type SocketWatcherOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (*Plugin) CleanOldState ¶
func (*Plugin) Run ¶
Run runs the plugin until the context is cancelled, restarting the server as needed
func (*Plugin) UpdateDeviceCount ¶
type PluginManager ¶
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 (*Server) Allocate ¶
func (s *Server) Allocate(_ context.Context, req *v1beta1.AllocateRequest) (*v1beta1.AllocateResponse, error)
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 (*Server) GetPreferredAllocation ¶
func (s *Server) GetPreferredAllocation(context.Context, *v1beta1.PreferredAllocationRequest) (*v1beta1.PreferredAllocationResponse, error)
func (*Server) ListAndWatch ¶
func (*Server) PreStartContainer ¶
func (s *Server) PreStartContainer(context.Context, *v1beta1.PreStartContainerRequest) (*v1beta1.PreStartContainerResponse, error)
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
Click to show internal directories.
Click to hide internal directories.