controllers

package
v0.1.0-latest-stable Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NodeResourcesPrefix is the prefix used by controller for all node resources labels and annotations.
	NodeResourcesPrefix = "noderesources.dpu.nvidia.com/"

	// DPUDevicePluginConfigAnnotationKey is the annotation key on DPU objects that references
	// the name of the NodeSRIOVDevicePluginConfig CR to use for that DPU.
	DPUDevicePluginConfigAnnotationKey = NodeResourcesPrefix + "nodesriovdevicepluginconfig"

	// PodInputAnnotationKey is the annotation key on managed pods that holds the JSON input config
	// containing the per-node configuration (map of DPU serial -> config).
	PodInputAnnotationKey = NodeResourcesPrefix + "sriov-device-plugin-input"

	// PodObjectHashAnnotationKey is the annotation key on managed pods that holds the hash of
	// the desired pod object for change detection.
	PodObjectHashAnnotationKey = NodeResourcesPrefix + "pod-object-hash"

	// ManagedByLabelKey is the label key used to identify pods managed by this controller.
	ManagedByLabelKey = NodeResourcesPrefix + "managed-by"

	// ManagedByLabelValue is the label value for pods managed by this controller.
	ManagedByLabelValue = "nodesriovdeviceplugin-controller"

	// DefaultResourcePrefix is the default resource prefix for device plugin resources.
	DefaultResourcePrefix = "nvidia.com"

	// FailedPodBackoffBaseDelay is the base delay for failed pod backoff.
	FailedPodBackoffBaseDelay = 1 * time.Second

	// FailedPodBackoffMaxDelay is the maximum delay for failed pod backoff.
	FailedPodBackoffMaxDelay = 15 * time.Minute

	// BackoffGCInterval is the interval for backoff garbage collection.
	BackoffGCInterval = 1 * time.Minute
)

Variables

This section is empty.

Functions

func GetCacheOptions

func GetCacheOptions(namespace string, cacheSyncPeriod time.Duration, ownerConfigMapName string) cache.Options

GetCacheOptions returns the controller-runtime cache options used by this controller.

Keeping controller-runtime option in this package helps ensure production code and controller tests use the same client/cache behavior.

func GetClientOptions

func GetClientOptions() client.Options

GetClientOptions returns the controller-runtime client options used by this controller.

Keeping controller-runtime option in this package helps ensure production code and controller tests use the same client/cache behavior.

func SetupIndexers

func SetupIndexers(ctx context.Context, mgr ctrl.Manager) error

SetupIndexers initializes all field indexers required by the node SRIOV device plugin controllers.

Types

type DevicePluginConfig

type DevicePluginConfig struct {
	// Image is the container image for the SRIOV device plugin.
	Image string
	// InitImage is the container image for the init container.
	InitImage string
	// DefaultResourcePrefix is the default resource prefix for device plugin resources.
	DefaultResourcePrefix string
	// ImagePullSecrets is the list of image pull secrets for the device plugin pod.
	ImagePullSecrets []string
}

DevicePluginConfig holds the configuration for device plugin pods. It is passed via command-line flags from the DPFOperatorConfig.

type NodeReconciler

type NodeReconciler struct {
	client.Client
	Scheme             *runtime.Scheme
	Namespace          string
	OwnerConfigMapName string
	DevicePluginConfig DevicePluginConfig
	// FailedPodsBackoff is used to avoid hot-looping when pods fail immediately after creation.
	FailedPodsBackoff *flowcontrol.Backoff
}

NodeReconciler reconciles Node objects and manages per-node SRIOV device plugin pods.

func (*NodeReconciler) Reconcile

func (r *NodeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile handles the reconciliation logic for a Node.

func (*NodeReconciler) SetupWithManager

func (r *NodeReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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