Documentation
¶
Index ¶
- Constants
- func SetupDrainIndices(ctx context.Context, mgr ctrl.Manager) error
- type ClusterPolicyReconciler
- type ContentImageVerifier
- type ControllerOpts
- type DRAReconciler
- type DefaultContentImageVerifier
- type DefaultLogsRetriever
- type DevicePluginReconciler
- type GPUFirmwareUpdateReconciler
- type GPURecoveryPlanReconciler
- type ImageFile
- type ImageVerifyRequest
- type KMMReconciler
- type LogsRetriever
- type MiscReconciler
- type SubControllerInterface
- type XpuManagerReconciler
- type XpumDeviceRefreshReconciler
Constants ¶
const ( FirmwareTypeGFX = "GFX" FirmwareTypeGFXDATA = "GFX_DATA" FirmwareTypeGFXCODEDATA = "GFX_CODE_DATA" FirmwareTypeGFXPSCBIN = "GFX_PSCBIN" FirmwareTypeAMC = "AMC" FirmwareTypeFANTABLE = "FAN_TABLE" FirmwareTypeVRCONFIG = "VR_CONFIG" FirmwareTypeOPROMCODE = "OPROM_CODE" FirmwareTypeOPROMDATA = "OPROM_DATA" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClusterPolicyReconciler ¶
type ClusterPolicyReconciler struct {
client.Client
APIReader client.Reader
Scheme *runtime.Scheme
Opts ControllerOpts
}
ClusterPolicyReconciler reconciles a ClusterPolicy object
func (*ClusterPolicyReconciler) Reconcile ¶
func (r *ClusterPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Main Reconcile function for ClusterPolicy. Individual sub-controllers will be called from here to handle their respective resources, and any errors they return will be aggregated into the ClusterPolicy status.
func (*ClusterPolicyReconciler) SetupWithManager ¶
func (r *ClusterPolicyReconciler) SetupWithManager(mgr ctrl.Manager, opts ControllerOpts) error
SetupWithManager sets up the controller with the Manager.
type ContentImageVerifier ¶
type ContentImageVerifier interface {
VerifyImage(ctx context.Context, req ImageVerifyRequest) error
}
ContentImageVerifier checks whether an image is reachable and, when checksums are declared, verifies each file's SHA256 against the image contents.
type ControllerOpts ¶
type DRAReconciler ¶
type DRAReconciler struct {
client.Client
Scheme *runtime.Scheme
Opts ControllerOpts
}
func (*DRAReconciler) Reconcile ¶
func (r *DRAReconciler) Reconcile(ctx context.Context, cp *v1alpha.ClusterPolicy) (ctrl.Result, error)
type DefaultContentImageVerifier ¶
type DefaultContentImageVerifier struct {
// contains filtered or unexported fields
}
DefaultContentImageVerifier implements ContentImageVerifier using the OCI registry API.
func (*DefaultContentImageVerifier) VerifyImage ¶ added in v0.4.0
func (v *DefaultContentImageVerifier) VerifyImage(ctx context.Context, req ImageVerifyRequest) error
VerifyImage checks one image against the registry. With no Files it confirms only that the reference parses, authenticates and resolves. With Files it additionally streams the merged filesystem and checks each named file exists, verifying SHA256 where declared.
type DefaultLogsRetriever ¶
type DefaultLogsRetriever struct {
Clientset *kubernetes.Clientset
}
func (*DefaultLogsRetriever) RetrieveLogsForPodContainer ¶
type DevicePluginReconciler ¶
type DevicePluginReconciler struct {
client.Client
Scheme *runtime.Scheme
Opts ControllerOpts
}
func (*DevicePluginReconciler) Reconcile ¶
func (r *DevicePluginReconciler) Reconcile(ctx context.Context, cp *v1alpha.ClusterPolicy) (ctrl.Result, error)
type GPUFirmwareUpdateReconciler ¶
type GPUFirmwareUpdateReconciler struct {
client.Client
Scheme *runtime.Scheme
Opts ControllerOpts
// contains filtered or unexported fields
}
GPUFirmwareUpdateReconciler reconciles a GPUFirmwareUpdate object
func (*GPUFirmwareUpdateReconciler) Reconcile ¶
func (r *GPUFirmwareUpdateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
func (*GPUFirmwareUpdateReconciler) SetupWithManager ¶
func (r *GPUFirmwareUpdateReconciler) SetupWithManager(mgr ctrl.Manager, copts ControllerOpts) error
SetupWithManager sets up the controller with the Manager.
type GPURecoveryPlanReconciler ¶ added in v0.4.0
type GPURecoveryPlanReconciler struct {
client.Client
Scheme *runtime.Scheme
Opts ControllerOpts
// APIReader reads straight from the API server, bypassing the manager cache. Only the plan
// itself is read through it, see getPlan.
APIReader client.Reader
// contains filtered or unexported fields
}
func (*GPURecoveryPlanReconciler) Reconcile ¶ added in v0.4.0
func (r *GPURecoveryPlanReconciler) Reconcile(ctx context.Context, req ctrl.Request) (retRes ctrl.Result, retErr error)
Reconcile is the main reconciliation loop for GPURecoveryPlan.
The loop is triggered by a change to a GPURecoveryPlan (an admin adding an approval, or the operator's own status write), by a recovery Job the plan owns reaching a new state, or by a ResourceSlice event routed through resourceSliceToPlans.
The phases run in a fixed order, each reading what the one before it wrote: detection mirrors the tainted GPUs into status.events, approvals send the approved ones into a node drain, the drain phase creates the recovery Job for every node that has come clear, and the Job sync reports what those Jobs did. status.state is derived once, at the end, from the event states all of them have settled on.
func (*GPURecoveryPlanReconciler) SetupWithManager ¶ added in v0.4.0
func (r *GPURecoveryPlanReconciler) SetupWithManager(mgr ctrl.Manager, opts ControllerOpts) error
SetupWithManager sets up the controller with the Manager.
type ImageFile ¶ added in v0.4.0
type ImageFile struct {
// Name is the file's path in the image's merged filesystem, e.g. "/fwupdate/gfx.bin".
// A leading "/" or "./" is optional.
Name string
// Checksum is the expected SHA256 as "sha256:<64 hex characters>". Empty means the file's
// existence is checked but its contents are not.
Checksum string
}
ImageFile is a file the verifier expects to find in the image. It is deliberately not an API type: the verifier only ever needs a name and an optional checksum, so callers convert from whatever their CRD happens to call those fields.
type ImageVerifyRequest ¶ added in v0.4.0
type ImageVerifyRequest struct {
// Image is the reference to check.
Image string
// PullSecret names a dockerconfigjson Secret in the operator namespace, or "" to use the
// ambient keychain.
PullSecret string
// InsecureSkipTLSVerify disables registry certificate validation.
InsecureSkipTLSVerify bool
// Files, when non-empty must exist in the image, and are SHA256-verified wherever a checksum is declared.
// If no files are declared, only the image reference is checked for reachability and authentication.
Files []ImageFile
}
ImageVerifyRequest describes one image to check. Callers assemble it from wherever they keep their image reference and pull settings, so a caller holding several images in unrelated fields can ask for a different depth of check for each.
type KMMReconciler ¶ added in v0.4.0
type KMMReconciler struct {
client.Client
Scheme *runtime.Scheme
Opts ControllerOpts
}
KMMReconciler manages a KMM Module CR for out-of-tree kernel module loading. It only configures the moduleLoader section — DP/DRA lifecycle remains with the native controllers.
func (*KMMReconciler) Reconcile ¶ added in v0.4.0
func (r *KMMReconciler) Reconcile(ctx context.Context, cp *v1alpha.ClusterPolicy) (ctrl.Result, error)
type LogsRetriever ¶
type MiscReconciler ¶
type MiscReconciler struct {
client.Client
APIReader client.Reader
Scheme *runtime.Scheme
Opts ControllerOpts
CrdNames []string
}
func (*MiscReconciler) Reconcile ¶
func (r *MiscReconciler) Reconcile(ctx context.Context, cp *v1alpha.ClusterPolicy) (ctrl.Result, error)
type SubControllerInterface ¶
type XpuManagerReconciler ¶
type XpuManagerReconciler struct {
client.Client
Scheme *runtime.Scheme
Opts ControllerOpts
}
func (*XpuManagerReconciler) Reconcile ¶
func (r *XpuManagerReconciler) Reconcile(ctx context.Context, cp *v1alpha.ClusterPolicy) (ctrl.Result, error)
type XpumDeviceRefreshReconciler ¶ added in v0.4.0
type XpumDeviceRefreshReconciler struct {
client.Client
Scheme *runtime.Scheme
Opts ControllerOpts
// contains filtered or unexported fields
}
func (*XpumDeviceRefreshReconciler) Reconcile ¶ added in v0.4.0
func (r *XpumDeviceRefreshReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile checks one node's xpum pods against the GPUs the node currently has, and replaces a pod that cannot reach one of them.
func (*XpumDeviceRefreshReconciler) SetupWithManager ¶ added in v0.4.0
func (r *XpumDeviceRefreshReconciler) SetupWithManager(mgr ctrl.Manager, opts ControllerOpts) error
SetupWithManager registers the controller with the Manager.
There is no For() object: requests are node names rather than objects, and both watches map into that keyspace. It is a top-level controller rather than a ClusterPolicy sub-reconciler on purpose — ResourceSlice churn is frequent, and fanning it into ClusterPolicy would re-run the device plugin, DRA and misc reconcilers and diff three DaemonSets every time a GPU's taints changed.
The ClusterPolicy is read on every pass but not watched, so a mode change takes effect on the next slice or pod event for a node rather than immediately. Nothing durable depends on the mode, so there is nothing for the change to act on retroactively.
Source Files
¶
- clusterpolicy_controller.go
- contentimage_verifier.go
- controller_utils.go
- deviceplugin_controller.go
- dra_controller.go
- drain.go
- gpufirmwareupdate_controller.go
- gpurecoveryplan_const.go
- gpurecoveryplan_controller.go
- gpurecoveryplan_helpers.go
- gpurecoveryplan_imageverific.go
- kmm_controller.go
- misc_controller.go
- openshift.go
- xpum_device_refresh.go
- xpumanager_controller.go