Documentation
¶
Overview ¶
+kubebuilder:object:generate=true +groupName=nvidia.com
Index ¶
- Constants
- Variables
- func AddToScheme(s *runtime.Scheme) error
- func IsPodSnapshotContentFailed(c *PodSnapshotContent) bool
- func IsPodSnapshotContentSucceeded(c *PodSnapshotContent) bool
- func IsPodSnapshotFailed(s *PodSnapshot) bool
- func IsPodSnapshotSucceeded(s *PodSnapshot) bool
- func IsSnapshotJobCompleted(j *SnapshotJob) bool
- func IsSnapshotJobFailed(j *SnapshotJob) bool
- func IsSnapshotJobTerminal(j *SnapshotJob) bool
- type CheckpointSource
- type CheckpointSourceDevices
- type CheckpointSourceNode
- type CheckpointSourcePod
- type NvidiaCheckpointSource
- type NvidiaCheckpointSourceInstance
- type PodReference
- type PodSnapshot
- type PodSnapshotContent
- type PodSnapshotContentList
- type PodSnapshotContentSource
- type PodSnapshotContentSpec
- type PodSnapshotContentStatus
- type PodSnapshotList
- type PodSnapshotReference
- type PodSnapshotSource
- type PodSnapshotSpec
- type PodSnapshotStatus
- type PodSnapshotTemplate
- type PodSnapshotTemplateMetadata
- type SnapshotJob
- type SnapshotJobList
- type SnapshotJobSpec
- type SnapshotJobStatus
Constants ¶
const ( // CaptureEligibleLabel is the gate-applied promotion label: the node agent's pre-bind gate // adds it only after the source pod passes validation. The agent's source-pod capture // informer keys on it so only gate-validated pods drive the capture path. CaptureEligibleLabel = "nvidia.com/snapshot-capture-eligible" // SnapshotNodeLabel mirrors PodSnapshotContent.spec.source.nodeName onto the // object so the per-node agent's cache can label-select work for its node. SnapshotNodeLabel = "nvidia.com/snapshot-node" CheckpointVolumeName = "checkpoint-storage" )
Snapshot control-plane labels and storage vocabulary shared by the operator and node agent. Workload Pod contract constants live in api/podcontract.
const ( // PodSnapshotConditionReady is True when capture and binding completed and the // artifact is usable for restore. PodSnapshotConditionReady = "Ready" // PodSnapshotConditionFailed is True when capture or binding failed terminally. PodSnapshotConditionFailed = "Failed" )
PodSnapshot and PodSnapshotContent status condition types. Both objects share this vocabulary; the operator and node agent set them via meta.SetStatusCondition.
const ( KindPodSnapshot = "PodSnapshot" KindPodSnapshotContent = "PodSnapshotContent" KindPodSnapshotContentList = "PodSnapshotContentList" )
Kind names, for callers that set TypeMeta explicitly when building objects.
const ( // SnapshotJobConditionRunning is True when the source pod is running and ready // (readiness probe passed). SnapshotJobConditionRunning = "Running" // SnapshotJobConditionCaptured is True when the CRIU dump of the target // container is complete (PodSnapshot Ready=True). SnapshotJobConditionCaptured = "Captured" // SnapshotJobConditionCompleted is True when the checkpoint artifact is // durably captured (PodSnapshot Ready=True) AND the source Job has // finished. The checkpoint terminates the target container (its exit is // expected and never required to be zero), but every other container must // run to completion and exit 0 before cleanup: deleting the Job earlier // would kill helper containers (e.g. a GMS saver writing weight artifacts // concurrently with the dump) mid-work. SnapshotJobConditionCompleted = "Completed" // SnapshotJobConditionFailed is True on terminal failure. The batch/v1 Job is // preserved for status and debugging; Kubernetes controls failed pod retention. SnapshotJobConditionFailed = "Failed" )
SnapshotJob condition types. The controller sets these via meta.SetStatusCondition.
const ( // Running ReasonPodPending = "PodPending" ReasonPodReady = "PodReady" // Captured ReasonCaptureInProgress = "CaptureInProgress" ReasonCaptureCompleted = "CaptureCompleted" // Completed. WaitingForPodCompletion covers the window where the capture // artifact is Ready but the source pod's other containers (helpers such as // a GMS saver) are still running. JobCompleted means the source Job // finished with every non-target container exiting 0; the target // container's own exit is expected to be the checkpoint's kill. ReasonWaitingForPodCompletion = "WaitingForPodCompletion" ReasonJobCompleted = "JobCompleted" // Failed=False. ReasonNoFailure means no failure has been observed // (metav1.Condition requires a non-empty reason, so the condition cannot // be present without one). All four conditions are present from the first // status write and are only updated afterwards (status/reason/message), // never removed, so consumers can always distinguish "known False" from // "not yet evaluated". ReasonNoFailure = "NoFailure" // Failed=True ReasonCaptureFailed = "CaptureFailed" ReasonPodSnapshotFailed = "PodSnapshotFailed" ReasonJobFailed = "JobFailed" ReasonDeadlineExceeded = "DeadlineExceeded" // ReasonSourceCompletedWithoutCapture means the BatchJob reported Complete=True, // but the authoritative PodSnapshotContent remained nonterminal after the source // pod exited. There is no observed capture error; the required capture result is // missing after the source exited. ReasonSourceCompletedWithoutCapture = "SourceCompletedWithoutCapture" ReasonPodSnapshotNameConflict = "PodSnapshotNameConflict" // ReasonPodSnapshotDeleted means a previously recorded PodSnapshot no // longer exists. SnapshotJob is one-shot, so the capture is not recreated. ReasonPodSnapshotDeleted = "PodSnapshotDeleted" // ReasonJobNameConflict means the deterministic Job name is held by a // foreign object or by a different Job UID than the one already recorded. ReasonJobNameConflict = "JobNameConflict" ReasonJobDeleted = "JobDeleted" // ReasonInvalidSpec covers spec-level validation failures caught before // building the source Job, for objects that bypassed CEL admission. ReasonInvalidSpec = "InvalidSpec" )
SnapshotJob condition reasons.
const SnapshotJobOwnerLabel = "nvidia.com/snapshot-job"
SnapshotJobOwnerLabel maps a produced PodSnapshot back to the SnapshotJob that created it. The PodSnapshot deliberately carries no ownerReference (artifacts must outlive the SnapshotJob), so this label is the lookup key controllers use instead of an owner-based watch.
const SnapshotJobOwnerUIDLabel = "nvidia.com/snapshot-job-uid"
SnapshotJobOwnerUIDLabel binds SnapshotJob-created resources to one concrete SnapshotJob incarnation. It is stamped into the source Job's immutable pod template and onto the produced PodSnapshot; the name label alone is insufficient because names can be reused.
Variables ¶
var GroupVersion = SchemeGroupVersion
GroupVersion is an alias for SchemeGroupVersion, used by callers that build typed objects (e.g. the operator setting APIVersion on a PodSnapshotContent).
var SchemeGroupVersion = schema.GroupVersion{Group: "nvidia.com", Version: "v1alpha1"}
Functions ¶
func AddToScheme ¶
func IsPodSnapshotContentFailed ¶
func IsPodSnapshotContentFailed(c *PodSnapshotContent) bool
IsPodSnapshotContentFailed reports whether the PodSnapshotContent's Failed condition is True.
func IsPodSnapshotContentSucceeded ¶
func IsPodSnapshotContentSucceeded(c *PodSnapshotContent) bool
IsPodSnapshotContentSucceeded reports whether the PodSnapshotContent's Ready condition is True.
func IsPodSnapshotFailed ¶
func IsPodSnapshotFailed(s *PodSnapshot) bool
IsPodSnapshotFailed reports whether the PodSnapshot's Failed condition is True.
func IsPodSnapshotSucceeded ¶
func IsPodSnapshotSucceeded(s *PodSnapshot) bool
IsPodSnapshotSucceeded reports whether the PodSnapshot's Ready condition is True.
func IsSnapshotJobCompleted ¶
func IsSnapshotJobCompleted(j *SnapshotJob) bool
IsSnapshotJobCompleted reports whether the SnapshotJob's Completed condition is True.
func IsSnapshotJobFailed ¶
func IsSnapshotJobFailed(j *SnapshotJob) bool
IsSnapshotJobFailed reports whether the SnapshotJob's Failed condition is True.
func IsSnapshotJobTerminal ¶
func IsSnapshotJobTerminal(j *SnapshotJob) bool
IsSnapshotJobTerminal reports whether the SnapshotJob has reached a terminal state (Completed=True or Failed=True). Completed objects may still reconcile to retry source Job cleanup.
Types ¶
type CheckpointSource ¶ added in v0.2.0
type CheckpointSource struct {
// Devices records the devices the capture could see, grouped by vendor.
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Devices *CheckpointSourceDevices `json:"devices,omitempty"`
// Node records the machine the checkpoint was captured on.
// +optional
Node *CheckpointSourceNode `json:"node,omitempty"`
// Pod records the container the checkpoint was captured from.
// +optional
Pod *CheckpointSourcePod `json:"pod,omitempty"`
}
CheckpointSource publishes what a checkpoint was captured on, so someone preparing a restore target can see it without reading the artifact. It is projected from the checkpoint manifest and never read back: the restore compatibility gates compare the manifest, not this status.
Every field is optional. A value the agent could not read is absent rather than empty, and an artifact captured before a value was recorded publishes without it.
func (*CheckpointSource) DeepCopy ¶ added in v0.2.0
func (in *CheckpointSource) DeepCopy() *CheckpointSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheckpointSource.
func (*CheckpointSource) DeepCopyInto ¶ added in v0.2.0
func (in *CheckpointSource) DeepCopyInto(out *CheckpointSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CheckpointSourceDevices ¶ added in v0.2.0
type CheckpointSourceDevices struct {
// Nvidia records the NVIDIA GPUs the capture could see.
// +optional
Nvidia *NvidiaCheckpointSource `json:"nvidia,omitempty"`
}
CheckpointSourceDevices groups source device details under one property per vendor, so each vendor's payload stays typed and validated and several can be present at once without a discriminator. A vendor this CRD has not heard of yet is preserved rather than pruned, so a newer agent's values survive an older installed CRD.
func (*CheckpointSourceDevices) DeepCopy ¶ added in v0.2.0
func (in *CheckpointSourceDevices) DeepCopy() *CheckpointSourceDevices
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheckpointSourceDevices.
func (*CheckpointSourceDevices) DeepCopyInto ¶ added in v0.2.0
func (in *CheckpointSourceDevices) DeepCopyInto(out *CheckpointSourceDevices)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CheckpointSourceNode ¶ added in v0.2.0
type CheckpointSourceNode struct {
// Name is the node the source pod ran on.
// +optional
Name string `json:"name,omitempty"`
// Architecture is the node's CPU architecture, as GOARCH spells it.
// +optional
Architecture string `json:"architecture,omitempty"`
// KernelVersion is the node's kernel release.
// +optional
KernelVersion string `json:"kernelVersion,omitempty"`
}
CheckpointSourceNode is the machine a checkpoint was captured on.
func (*CheckpointSourceNode) DeepCopy ¶ added in v0.2.0
func (in *CheckpointSourceNode) DeepCopy() *CheckpointSourceNode
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheckpointSourceNode.
func (*CheckpointSourceNode) DeepCopyInto ¶ added in v0.2.0
func (in *CheckpointSourceNode) DeepCopyInto(out *CheckpointSourceNode)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CheckpointSourcePod ¶ added in v0.2.0
type CheckpointSourcePod struct {
// Image is the container image reference the capture ran.
// +optional
Image string `json:"image,omitempty"`
// ImageDigest identifies which build of the container image the capture
// ran, which a mutable tag does not.
// +optional
ImageDigest string `json:"imageDigest,omitempty"`
// Memory is the container's memory limit, absent if it had none.
// +optional
Memory string `json:"memory,omitempty"`
// CPU is the container's CPU limit, absent if it had none.
// +optional
CPU string `json:"cpu,omitempty"`
}
CheckpointSourcePod is the container a checkpoint was captured from, and what it was given to run in.
func (*CheckpointSourcePod) DeepCopy ¶ added in v0.2.0
func (in *CheckpointSourcePod) DeepCopy() *CheckpointSourcePod
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheckpointSourcePod.
func (*CheckpointSourcePod) DeepCopyInto ¶ added in v0.2.0
func (in *CheckpointSourcePod) DeepCopyInto(out *CheckpointSourcePod)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NvidiaCheckpointSource ¶ added in v0.2.0
type NvidiaCheckpointSource struct {
// DriverVersion is the NVIDIA driver the capture ran against.
// +optional
DriverVersion string `json:"driverVersion,omitempty"`
// Instances lists one entry per GPU the captured container could see, so
// the count is the length of this list.
// +optional
Instances []NvidiaCheckpointSourceInstance `json:"instances,omitempty"`
}
NvidiaCheckpointSource is what the capture saw of the node's NVIDIA GPUs. The field names are the ones the NVIDIA DRA driver publishes on a ResourceSlice, so the same GPU reads the same way in both places.
func (*NvidiaCheckpointSource) DeepCopy ¶ added in v0.2.0
func (in *NvidiaCheckpointSource) DeepCopy() *NvidiaCheckpointSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NvidiaCheckpointSource.
func (*NvidiaCheckpointSource) DeepCopyInto ¶ added in v0.2.0
func (in *NvidiaCheckpointSource) DeepCopyInto(out *NvidiaCheckpointSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NvidiaCheckpointSourceInstance ¶ added in v0.2.0
type NvidiaCheckpointSourceInstance struct {
// ProductName is the GPU model, as nvidia-smi reports it.
// +optional
ProductName string `json:"productName,omitempty"`
}
NvidiaCheckpointSourceInstance is one GPU. UUIDs are deliberately left out: they identify a physical card rather than describe what a restore target has to match.
func (*NvidiaCheckpointSourceInstance) DeepCopy ¶ added in v0.2.0
func (in *NvidiaCheckpointSourceInstance) DeepCopy() *NvidiaCheckpointSourceInstance
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NvidiaCheckpointSourceInstance.
func (*NvidiaCheckpointSourceInstance) DeepCopyInto ¶ added in v0.2.0
func (in *NvidiaCheckpointSourceInstance) DeepCopyInto(out *NvidiaCheckpointSourceInstance)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodReference ¶
type PodReference struct {
// Name of the source pod.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
// UID of the source pod, recorded so the node agent dumps that specific
// pod and not a same-named recreation.
// +optional
UID types.UID `json:"uid,omitempty"`
// Containers narrows the capture to these containers of the source pod. The
// node agent reads this instead of the source pod's target-container
// annotation. v1alpha1 supports exactly one container; the cap is lifted when
// the runtime supports multi-container capture.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=1
// +kubebuilder:validation:items:MinLength=1
// +kubebuilder:validation:items:MaxLength=63
// +kubebuilder:validation:items:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
Containers []string `json:"containers"`
}
PodReference names a pod in the same namespace as the referencing PodSnapshot.
func (*PodReference) DeepCopy ¶
func (in *PodReference) DeepCopy() *PodReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodReference.
func (*PodReference) DeepCopyInto ¶
func (in *PodReference) DeepCopyInto(out *PodReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodSnapshot ¶
type PodSnapshot struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec is immutable"
Spec PodSnapshotSpec `json:"spec,omitempty"`
Status PodSnapshotStatus `json:"status,omitempty"`
}
PodSnapshot is the Schema for the snapshots API. It is the namespaced binding for a captured container checkpoint and is consumed by restore paths.
No conversion: this type exists only in v1alpha1 (no other API version), so it is not part of any conversion scheme.
func (*PodSnapshot) DeepCopy ¶
func (in *PodSnapshot) DeepCopy() *PodSnapshot
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshot.
func (*PodSnapshot) DeepCopyInto ¶
func (in *PodSnapshot) DeepCopyInto(out *PodSnapshot)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PodSnapshot) DeepCopyObject ¶
func (in *PodSnapshot) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PodSnapshotContent ¶
type PodSnapshotContent struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec is immutable"
Spec PodSnapshotContentSpec `json:"spec,omitempty"`
Status PodSnapshotContentStatus `json:"status,omitempty"`
}
PodSnapshotContent is the Schema for the snapshotcontents API. It is the cluster-scoped artifact-of-record for a captured container checkpoint.
No conversion: this type exists only in v1alpha1 (no other API version), so it is not part of any conversion scheme.
func (*PodSnapshotContent) DeepCopy ¶
func (in *PodSnapshotContent) DeepCopy() *PodSnapshotContent
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotContent.
func (*PodSnapshotContent) DeepCopyInto ¶
func (in *PodSnapshotContent) DeepCopyInto(out *PodSnapshotContent)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PodSnapshotContent) DeepCopyObject ¶
func (in *PodSnapshotContent) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PodSnapshotContentList ¶
type PodSnapshotContentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []PodSnapshotContent `json:"items"`
}
PodSnapshotContentList contains a list of PodSnapshotContent.
func (*PodSnapshotContentList) DeepCopy ¶
func (in *PodSnapshotContentList) DeepCopy() *PodSnapshotContentList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotContentList.
func (*PodSnapshotContentList) DeepCopyInto ¶
func (in *PodSnapshotContentList) DeepCopyInto(out *PodSnapshotContentList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PodSnapshotContentList) DeepCopyObject ¶
func (in *PodSnapshotContentList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PodSnapshotContentSource ¶
type PodSnapshotContentSource struct {
// PodRef identifies the pod to dump. Its UID guards against dumping a
// same-named recreation of the pod.
// +kubebuilder:validation:Required
PodRef PodReference `json:"podRef"`
// NodeName is the node the source pod runs on, denormalized from the live
// pod so it travels with PodRef as one immutable unit and selects the node
// agent that performs the dump.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
NodeName string `json:"nodeName"`
}
PodSnapshotContentSource is the immutable source descriptor: what to dump (PodRef) and where it runs (NodeName).
func (*PodSnapshotContentSource) DeepCopy ¶
func (in *PodSnapshotContentSource) DeepCopy() *PodSnapshotContentSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotContentSource.
func (*PodSnapshotContentSource) DeepCopyInto ¶
func (in *PodSnapshotContentSource) DeepCopyInto(out *PodSnapshotContentSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodSnapshotContentSpec ¶
type PodSnapshotContentSpec struct {
// PodSnapshotRef is the back-pointer to the bound PodSnapshot. It may span
// namespaces because PodSnapshotContent is cluster-scoped.
// +kubebuilder:validation:Required
PodSnapshotRef PodSnapshotReference `json:"snapshotRef"`
// Source describes what to capture: the source pod and the node it runs on.
// +kubebuilder:validation:Required
Source PodSnapshotContentSource `json:"source"`
}
PodSnapshotContentSpec defines the desired state of PodSnapshotContent. It is populated by the PodSnapshotReconciler (operator) at creation time and is immutable thereafter.
func (*PodSnapshotContentSpec) DeepCopy ¶
func (in *PodSnapshotContentSpec) DeepCopy() *PodSnapshotContentSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotContentSpec.
func (*PodSnapshotContentSpec) DeepCopyInto ¶
func (in *PodSnapshotContentSpec) DeepCopyInto(out *PodSnapshotContentSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodSnapshotContentStatus ¶
type PodSnapshotContentStatus struct {
// Conditions reflect the latest observations of the PodSnapshotContent's state.
// Standard types are Ready and Failed.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// Source publishes what the checkpoint was captured on, written when the
// capture goes Ready.
// +optional
Source *CheckpointSource `json:"source,omitempty"`
}
PodSnapshotContentStatus defines the observed state of PodSnapshotContent.
func (*PodSnapshotContentStatus) DeepCopy ¶
func (in *PodSnapshotContentStatus) DeepCopy() *PodSnapshotContentStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotContentStatus.
func (*PodSnapshotContentStatus) DeepCopyInto ¶
func (in *PodSnapshotContentStatus) DeepCopyInto(out *PodSnapshotContentStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodSnapshotList ¶
type PodSnapshotList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []PodSnapshot `json:"items"`
}
PodSnapshotList contains a list of PodSnapshot.
func (*PodSnapshotList) DeepCopy ¶
func (in *PodSnapshotList) DeepCopy() *PodSnapshotList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotList.
func (*PodSnapshotList) DeepCopyInto ¶
func (in *PodSnapshotList) DeepCopyInto(out *PodSnapshotList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PodSnapshotList) DeepCopyObject ¶
func (in *PodSnapshotList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PodSnapshotReference ¶
type PodSnapshotReference struct {
// Namespace of the referenced PodSnapshot.
// +kubebuilder:validation:Required
Namespace string `json:"namespace"`
// Name of the referenced PodSnapshot.
// +kubebuilder:validation:Required
Name string `json:"name"`
// UID of the referenced PodSnapshot, recorded at binding time to detect a
// stale reference after a delete and recreate.
// +optional
UID types.UID `json:"uid,omitempty"`
}
PodSnapshotReference is a cross-namespace reference to a PodSnapshot.
func (*PodSnapshotReference) DeepCopy ¶
func (in *PodSnapshotReference) DeepCopy() *PodSnapshotReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotReference.
func (*PodSnapshotReference) DeepCopyInto ¶
func (in *PodSnapshotReference) DeepCopyInto(out *PodSnapshotReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodSnapshotSource ¶
type PodSnapshotSource struct {
// PodRef references the pod, in the PodSnapshot's namespace, that is captured.
// The operator prepares the pod (control volume, checkpoint storage mount)
// before creating the PodSnapshot. The capture target container is carried on
// PodRef.Containers, not a pod annotation.
// +kubebuilder:validation:Required
PodRef PodReference `json:"podRef"`
}
PodSnapshotSource identifies the workload captured by a PodSnapshot.
func (*PodSnapshotSource) DeepCopy ¶
func (in *PodSnapshotSource) DeepCopy() *PodSnapshotSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotSource.
func (*PodSnapshotSource) DeepCopyInto ¶
func (in *PodSnapshotSource) DeepCopyInto(out *PodSnapshotSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodSnapshotSpec ¶
type PodSnapshotSpec struct {
// Source identifies the captured workload. It is a struct (rather than an
// inlined reference) so future source variants can be added additively.
// +kubebuilder:validation:Required
Source PodSnapshotSource `json:"source"`
}
PodSnapshotSpec defines the desired state of PodSnapshot.
func (*PodSnapshotSpec) DeepCopy ¶
func (in *PodSnapshotSpec) DeepCopy() *PodSnapshotSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotSpec.
func (*PodSnapshotSpec) DeepCopyInto ¶
func (in *PodSnapshotSpec) DeepCopyInto(out *PodSnapshotSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodSnapshotStatus ¶
type PodSnapshotStatus struct {
// BoundPodSnapshotContentName is the name of the cluster-scoped PodSnapshotContent
// this PodSnapshot is bound to. It is nil until the agent has created the
// content and recorded the binding.
// +optional
BoundPodSnapshotContentName *string `json:"boundSnapshotContentName,omitempty"`
// Conditions reflect the latest observations of the PodSnapshot's state.
// Standard types are Ready and Failed.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
PodSnapshotStatus defines the observed state of PodSnapshot.
func (*PodSnapshotStatus) DeepCopy ¶
func (in *PodSnapshotStatus) DeepCopy() *PodSnapshotStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotStatus.
func (*PodSnapshotStatus) DeepCopyInto ¶
func (in *PodSnapshotStatus) DeepCopyInto(out *PodSnapshotStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodSnapshotTemplate ¶
type PodSnapshotTemplate struct {
// Metadata contains labels and annotations copied to the generated
// PodSnapshot. SnapshotJob ownership labels are reserved for the controller
// and cannot be supplied here.
// +optional
Metadata *PodSnapshotTemplateMetadata `json:"metadata,omitempty"`
// TargetContainers names the container(s) to checkpoint with CRIU. The pod
// may contain any number of additional containers (helpers, sidecars, etc.)
// — this field controls only the CRIU dump target.
//
// v1alpha1: exactly one target is required. The plural form and nested
// placement here is intentional: future versions will support per-container
// config (e.g. per-container quiesceProbe) by extending this list to objects.
//
// Defaults to ["main"]. Each entry must be a valid DNS label
// (1-63 chars, ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$).
// +optional
// +kubebuilder:default={"main"}
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=1
// +kubebuilder:validation:items:MinLength=1
// +kubebuilder:validation:items:MaxLength=63
// +kubebuilder:validation:items:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
TargetContainers []string `json:"targetContainers,omitempty"`
}
PodSnapshotTemplate mirrors the PodSnapshot fields the user controls. The controller fills in identity, ownership, and spec.source automatically. +kubebuilder:validation:XValidation:rule="!has(self.metadata) || !has(self.metadata.labels) || !('nvidia.com/snapshot-job' in self.metadata.labels)",message="metadata.labels must not set controller-owned label nvidia.com/snapshot-job" +kubebuilder:validation:XValidation:rule="!has(self.metadata) || !has(self.metadata.labels) || !('nvidia.com/snapshot-job-uid' in self.metadata.labels)",message="metadata.labels must not set controller-owned label nvidia.com/snapshot-job-uid"
func (*PodSnapshotTemplate) DeepCopy ¶
func (in *PodSnapshotTemplate) DeepCopy() *PodSnapshotTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotTemplate.
func (*PodSnapshotTemplate) DeepCopyInto ¶
func (in *PodSnapshotTemplate) DeepCopyInto(out *PodSnapshotTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodSnapshotTemplateMetadata ¶
type PodSnapshotTemplateMetadata struct {
// Labels are copied to the generated PodSnapshot.
// +optional
// +kubebuilder:validation:MaxProperties=4096
Labels map[string]string `json:"labels,omitempty"`
// Annotations are copied to the generated PodSnapshot.
// +optional
// +kubebuilder:validation:MaxProperties=4096
Annotations map[string]string `json:"annotations,omitempty"`
}
PodSnapshotTemplateMetadata is the caller-owned metadata propagated to a SnapshotJob's generated PodSnapshot. It intentionally exposes only labels and annotations; identity and ownership remain controller-owned. The SnapshotJob spec is immutable, so metadata rejected by the controller as InvalidSpec requires deleting and recreating the SnapshotJob. +kubebuilder:validation:XValidation:rule="!has(self.labels) || self.labels.all(k, !format.qualifiedName().validate(k).hasValue())",message="metadata.labels keys must be valid Kubernetes qualified names" +kubebuilder:validation:XValidation:rule="!has(self.labels) || self.labels.all(k, size(self.labels[k]) <= 63)",message="metadata.labels values must be no more than 63 characters" +kubebuilder:validation:XValidation:rule="!has(self.annotations) || self.annotations.all(k, !format.qualifiedName().validate(k).hasValue())",message="metadata.annotations keys must be valid Kubernetes qualified names"
func (*PodSnapshotTemplateMetadata) DeepCopy ¶
func (in *PodSnapshotTemplateMetadata) DeepCopy() *PodSnapshotTemplateMetadata
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSnapshotTemplateMetadata.
func (*PodSnapshotTemplateMetadata) DeepCopyInto ¶
func (in *PodSnapshotTemplateMetadata) DeepCopyInto(out *PodSnapshotTemplateMetadata)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SnapshotJob ¶
type SnapshotJob struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec is immutable"
Spec SnapshotJobSpec `json:"spec"`
Status SnapshotJobStatus `json:"status,omitempty"`
}
SnapshotJob is the Schema for the snapshotjobs API. It fuses running a checkpoint-ready workload pod and capturing it into a PodSnapshot into one declarative, capture-only object. SnapshotJob has zero awareness of any specific consumer (Dynamo, GMS, or otherwise).
No conversion: this type exists only in v1alpha1 (no other API version), so it is not part of any conversion scheme.
func (*SnapshotJob) DeepCopy ¶
func (in *SnapshotJob) DeepCopy() *SnapshotJob
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapshotJob.
func (*SnapshotJob) DeepCopyInto ¶
func (in *SnapshotJob) DeepCopyInto(out *SnapshotJob)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SnapshotJob) DeepCopyObject ¶
func (in *SnapshotJob) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type SnapshotJobList ¶
type SnapshotJobList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []SnapshotJob `json:"items"`
}
SnapshotJobList contains a list of SnapshotJob.
func (*SnapshotJobList) DeepCopy ¶
func (in *SnapshotJobList) DeepCopy() *SnapshotJobList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapshotJobList.
func (*SnapshotJobList) DeepCopyInto ¶
func (in *SnapshotJobList) DeepCopyInto(out *SnapshotJobList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SnapshotJobList) DeepCopyObject ¶
func (in *SnapshotJobList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type SnapshotJobSpec ¶
type SnapshotJobSpec struct {
// PodTemplate defines the workload to run and capture. The controller injects
// the snapshot contract (control volume, readiness probe, seccomp, sidecar
// opt-outs) before creating the batch/v1 Job. Everything else — image,
// command, GPU resources, sidecars, DRA claims, shared memory — is the
// caller's responsibility.
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="!has(self.metadata) || !has(self.metadata.annotations) || !('nvidia.com/snapshot-multi-gpu' in self.metadata.annotations) || self.metadata.annotations['nvidia.com/snapshot-multi-gpu'].trim() in ['enabled', 'disabled']",message="annotation nvidia.com/snapshot-multi-gpu must be enabled or disabled"
PodTemplate corev1.PodTemplateSpec `json:"podTemplate"`
// ActiveDeadlineSeconds bounds the total time allowed for pod scheduling,
// quiesce, and dump. Applied verbatim to the batch/v1 Job.
// +optional
// +kubebuilder:default=3600
// +kubebuilder:validation:Minimum=1
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
// PodSnapshotTemplate defines the properties of the PodSnapshot produced by
// this job. The controller fills in spec.source from the pod it creates.
// +kubebuilder:validation:Required
PodSnapshotTemplate PodSnapshotTemplate `json:"podSnapshotTemplate"`
}
SnapshotJobSpec defines the desired state of SnapshotJob.
func (*SnapshotJobSpec) DeepCopy ¶
func (in *SnapshotJobSpec) DeepCopy() *SnapshotJobSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapshotJobSpec.
func (*SnapshotJobSpec) DeepCopyInto ¶
func (in *SnapshotJobSpec) DeepCopyInto(out *SnapshotJobSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SnapshotJobStatus ¶
type SnapshotJobStatus struct {
// SourceJobUID identifies the one source batch/v1 Job incarnation accepted
// for this one-shot SnapshotJob. Once set, a missing Job or a same-name Job
// with another UID is terminal and must never cause the workload to run again.
// +optional
SourceJobUID types.UID `json:"sourceJobUID,omitempty"`
// PodSnapshotName is the name of the PodSnapshot produced by this job. Set
// when the PodSnapshot is created. Distinguishes "never created" (empty)
// from "created but missing" (set, not found).
// +optional
PodSnapshotName string `json:"podSnapshotName,omitempty"`
// PodSnapshotUID identifies the one PodSnapshot incarnation accepted for
// this one-shot capture. Once set, a missing PodSnapshot or a same-name
// object with another UID is terminal and must never start another capture.
// +optional
PodSnapshotUID types.UID `json:"podSnapshotUID,omitempty"`
// StartedAt is when the controller first observed the source pod Ready
// (job.status.ready > 0), not the pod's own Ready transition time — it can
// lag the pod's actual transition by up to one reconcile interval.
// +optional
StartedAt *metav1.Time `json:"startedAt,omitempty"`
// CompletedAt is when a terminal condition (Completed or Failed) was set.
// +optional
CompletedAt *metav1.Time `json:"completedAt,omitempty"`
// Conditions reflect the current state of the SnapshotJob. Types: Running,
// Captured, Completed, Failed.
// +optional
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
SnapshotJobStatus defines the observed state of SnapshotJob.
func (*SnapshotJobStatus) DeepCopy ¶
func (in *SnapshotJobStatus) DeepCopy() *SnapshotJobStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapshotJobStatus.
func (*SnapshotJobStatus) DeepCopyInto ¶
func (in *SnapshotJobStatus) DeepCopyInto(out *SnapshotJobStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.