plugins

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterWithKubelet

func RegisterWithKubelet(ctx context.Context, socketName, resourceName, addr string) error

func RegisterWithRestartHandler

func RegisterWithRestartHandler(
	ctx context.Context,
	restart func() error,
	socketPath string,
	log *zerolog.Logger,
	errCh chan<- error) (func(), error)

RegisterWithRestartHandler watches for the kubelet socket file and re-registers the plugin with the kubelet during a restart. See https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#handling-kubelet-restarts

Types

type Device

type Device struct {
	ID     string
	Health DeviceHealth
}

Device represents a device managed by this plugin.

type DeviceHealth

type DeviceHealth string
const (
	Healthy   DeviceHealth = v1beta1.Healthy
	Unhealthy DeviceHealth = v1beta1.Unhealthy
)

func (DeviceHealth) String

func (h DeviceHealth) String() string

type DeviceState

type DeviceState struct {
	LastSeenTimestamp int64
	*Device
}

DeviceState maintains the last seen of a device at a given timestamp.

type Server

type Server struct {
	GRPC *grpc.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(socketPath string) *Server

func (*Server) GRPCReady

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

func (*Server) GRPCServe

func (s *Server) GRPCServe(ctx context.Context, errCh chan<- error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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