dra

package
v1.26.7 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerInfo

type ContainerInfo struct {
	// The Annotations for the container
	Annotations []kubecontainer.Annotation
}

ContainerInfo contains information required by the runtime to consume prepared resources.

type Manager

type Manager interface {
	// PrepareResources prepares resources for a container in a pod.
	// It communicates with the DRA resource plugin to prepare resources and
	// returns resource info to trigger CDI injection by the runtime.
	PrepareResources(pod *v1.Pod, container *v1.Container) (*ContainerInfo, error)

	// UnprepareResources calls NodeUnprepareResource GRPC from DRA plugin to unprepare pod resources
	UnprepareResources(pod *v1.Pod) error

	// PodMightNeedToUnprepareResources returns true if the pod with the given UID
	// might need to unprepare resources.
	PodMightNeedToUnprepareResources(UID types.UID) bool
}

Manager manages all the DRA resource plugins running on a node.

type ManagerImpl

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

ManagerImpl is the structure in charge of managing DRA resource Plugins.

func NewManagerImpl

func NewManagerImpl(kubeClient clientset.Interface) (*ManagerImpl, error)

NewManagerImpl creates a new manager.

func (*ManagerImpl) PodMightNeedToUnprepareResources

func (m *ManagerImpl) PodMightNeedToUnprepareResources(UID types.UID) bool

PodMightNeedToUnprepareResources returns true if the pod might need to unprepare resources

func (*ManagerImpl) PrepareResources

func (m *ManagerImpl) PrepareResources(pod *v1.Pod, container *v1.Container) (*ContainerInfo, error)

PrepareResources calls plugin NodePrepareResource from the registered DRA resource plugins.

func (*ManagerImpl) UnprepareResources

func (m *ManagerImpl) UnprepareResources(pod *v1.Pod) error

UnprepareResources calls a plugin's NodeUnprepareResource API for each resource claim owned by a pod. This function is idempotent and may be called multiple times against the same pod. As such, calls to the underlying NodeUnprepareResource API are skipped for claims that have already been successfully unprepared.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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