dra

package
v1.27.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClaimInfo added in v1.27.0

type ClaimInfo struct {
	sync.RWMutex
	state.ClaimInfoState
	// contains filtered or unexported fields
}

ClaimInfo holds information required to prepare and unprepare a resource claim.

type ContainerInfo

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

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

type Manager

type Manager interface {
	// PrepareResources prepares resources for a pod.
	// It communicates with the DRA resource plugin to prepare resources.
	PrepareResources(pod *v1.Pod) error

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

	// GetResources gets a ContainerInfo object from the claimInfo cache.
	// This information is used by the caller to update a container config.
	GetResources(pod *v1.Pod, container *v1.Container) (*ContainerInfo, error)

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

	// GetContainerClaimInfos gets Container ClaimInfo objects
	GetContainerClaimInfos(pod *v1.Pod, container *v1.Container) ([]*ClaimInfo, error)
}

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, stateFileDirectory string) (*ManagerImpl, error)

NewManagerImpl creates a new manager.

func (*ManagerImpl) GetContainerClaimInfos added in v1.27.0

func (m *ManagerImpl) GetContainerClaimInfos(pod *v1.Pod, container *v1.Container) ([]*ClaimInfo, error)

GetCongtainerClaimInfos gets Container's ClaimInfo

func (*ManagerImpl) GetResources added in v1.27.0

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

GetResources gets a ContainerInfo object from the claimInfo cache. This information is used by the caller to update a container config.

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) error

PrepareResources attempts to prepare all of the required resource plugin resources for the input container, issue an NodePrepareResource rpc request for each new resource requirement, process their responses and update the cached containerResources on success.

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