nfdeviceplugin

package
v0.0.0-...-530b9ac Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KubeEndPoint is kubelet socket name
	KubeEndPoint = "kubelet.sock"
)
View Source
const (
	VendorPluginSocketPath string = cnitypes.DaemonBaseDir + "vendor-plugin/vendor-plugin.sock"
)

Variables

View Source
var (
	// SockDir is the default Kubelet device plugin socket directory
	SockDir = "/var/lib/kubelet/plugins_registry"
	// DeprecatedSockDir is the deprecated Kubelet device plugin socket directory
	DeprecatedSockDir = "/var/lib/kubelet/device-plugins"
)

Functions

func NewGrpcPlugin

func NewGrpcPlugin() *nfResources

Types

type DevicePlugin

type DevicePlugin interface {
	Start() error
}

type ExcludeConfig

type ExcludeConfig struct {
	ExcludeDevices []string `json:"exclude"`
}

ExcludeConfig contains excluded list of devices

type NadUtils

type NadUtils interface {
}

NadUtils is an interface for Network-Attachment-Definition utilities

type ResourceFactory

type ResourceFactory interface {
	GetResourceServer(ResourcePool) (ResourceServer, error)
	GetResourcePool(rc *ExcludeConfig) (ResourcePool, error)
}

ResourceFactory is an interface to get instances of ResourcePool and ResourceServer

type ResourcePool

type ResourcePool interface {
	// extended API for internal use
	GetResourceName() string
	GetResourcePrefix() string
	GetDevices() map[string]*pluginapi.Device // for ListAndWatch
	Probe() bool
	GetDeviceSpecs(deviceIDs []string) []*pluginapi.DeviceSpec
	GetEnvs(prefix string, deviceIDs []string) (map[string]string, error)
	GetMounts(deviceIDs []string) []*pluginapi.Mount
	StoreDeviceInfoFile(resourceNamePrefix string) error
	CleanDeviceInfoFile(resourceNamePrefix string) error
	GetCDIName() string
}

ResourcePool represents a generic resource entity

type ResourceServer

type ResourceServer interface {
	// Device manager API
	pluginapi.DevicePluginServer
	// grpc server related
	Start() error
	Stop() error
	// Init initializes resourcePool
	Init() error
	// Watch watches for socket file deletion and restart server if needed
	Watch()
}

ResourceServer is gRPC server implements K8s device plugin api

Jump to

Keyboard shortcuts

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