Documentation
¶
Index ¶
Constants ¶
const ( CheckpointAPIGroup = "checkpoint.dra.kubelet.k8s.io" CheckpointKind = "DRACheckpoint" CheckpointAPIVersion = CheckpointAPIGroup + "/v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶ added in v1.31.0
type Checkpoint struct {
// Data is a JSON serialized checkpoint data
Data string
// Checksum is a checksum of Data
Checksum uint32
}
Checkpoint represents a structure to store DRA checkpoint data
func NewCheckpoint ¶ added in v1.31.0
func NewCheckpoint(data ClaimInfoStateList) (*Checkpoint, error)
NewCheckpoint creates a new checkpoint from a list of claim info states
func (*Checkpoint) GetClaimInfoStateList ¶ added in v1.31.0
func (cp *Checkpoint) GetClaimInfoStateList() (ClaimInfoStateList, error)
GetClaimInfoStateList returns list of claim info states from checkpoint
func (*Checkpoint) MarshalCheckpoint ¶ added in v1.31.0
func (cp *Checkpoint) MarshalCheckpoint() ([]byte, error)
MarshalCheckpoint marshals checkpoint to JSON
func (*Checkpoint) UnmarshalCheckpoint ¶ added in v1.31.0
func (cp *Checkpoint) UnmarshalCheckpoint(blob []byte) error
UnmarshalCheckpoint unmarshals checkpoint from JSON and verifies its data checksum
func (*Checkpoint) VerifyChecksum ¶ added in v1.31.0
func (cp *Checkpoint) VerifyChecksum() error
VerifyChecksum verifies that current checksum of checkpointed Data is valid
type CheckpointData ¶ added in v1.31.0
type CheckpointData struct {
metav1.TypeMeta
ClaimInfoStateList ClaimInfoStateList
}
type Checkpointer ¶ added in v1.31.0
type Checkpointer interface {
GetOrCreate() (*Checkpoint, error)
Store(*Checkpoint) error
}
func NewCheckpointer ¶ added in v1.31.0
func NewCheckpointer(stateDir, checkpointName string) (Checkpointer, error)
NewCheckpointer creates new checkpointer for keeping track of claim info with checkpoint backend
type ClaimInfoState ¶
type ClaimInfoState struct {
// ClaimUID is the UID of a resource claim
ClaimUID types.UID
// ClaimName is the name of a resource claim
ClaimName string
// Namespace is a claim namespace
Namespace string
// PodUIDs is a set of pod UIDs that reference a resource
PodUIDs sets.Set[string]
// DriverState contains information about all drivers which have allocation
// results in the claim, even if they don't provide devices for their results.
DriverState map[string]DriverState
}
+k8s:deepcopy-gen=true
func (*ClaimInfoState) DeepCopy ¶ added in v1.31.0
func (in *ClaimInfoState) DeepCopy() *ClaimInfoState
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClaimInfoState.
func (*ClaimInfoState) DeepCopyInto ¶ added in v1.31.0
func (in *ClaimInfoState) DeepCopyInto(out *ClaimInfoState)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClaimInfoStateList ¶
type ClaimInfoStateList []ClaimInfoState
type Device ¶ added in v1.31.0
type Device struct {
PoolName string
DeviceName string
RequestNames []string
CDIDeviceIDs []string
}
Device is how a DRA driver described an allocated device in a claim to kubelet. RequestName, ShareID, and CDI device IDs are optional. +k8s:deepcopy-gen=true
func (*Device) DeepCopy ¶ added in v1.31.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device.
func (*Device) DeepCopyInto ¶ added in v1.31.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DeviceHealth ¶ added in v1.34.0
type DeviceHealth struct {
// PoolName is the name of the pool where the device is allocated.
PoolName string
// DeviceName is the name of the device.
// The full identifier is '<driver name>/<pool name>/<device name>' across the system.
DeviceName string
// Health is the health status of the device.
// Statuses: "Healthy", "Unhealthy", "Unknown".
Health DeviceHealthStatus
// LastUpdated keeps track of the last health status update of this device.
LastUpdated time.Time
// HealthCheckTimeout is the timeout for the health check of the device.
// Zero value means use the default timeout (DefaultHealthTimeout).
// This ensures backward compatibility with existing data.
HealthCheckTimeout time.Duration
}
DeviceHealth is used to store health information of a device.
type DeviceHealthStatus ¶ added in v1.34.0
type DeviceHealthStatus string
const ( // DeviceHealthStatusHealthy represents a healthy device. DeviceHealthStatusHealthy DeviceHealthStatus = "Healthy" // DeviceHealthStatusUnhealthy represents an unhealthy device. DeviceHealthStatusUnhealthy DeviceHealthStatus = "Unhealthy" // DeviceHealthStatusUnknown represents a device with unknown health status. DeviceHealthStatusUnknown DeviceHealthStatus = "Unknown" )
type DevicesHealthMap ¶ added in v1.34.0
type DevicesHealthMap map[string]DriverHealthState
DevicesHealthMap is a map between driver names and the list of the device's health.
type DriverHealthState ¶ added in v1.34.0
type DriverHealthState struct {
// Devices maps a device's unique key ("<pool>/<device>") to its health state.
Devices map[string]DeviceHealth
}
DriverHealthState is used to store health information of all devices of a driver.
type DriverState ¶ added in v1.31.0
type DriverState struct {
Devices []Device
}
DriverState is used to store per-device claim info state in a checkpoint +k8s:deepcopy-gen=true
func (*DriverState) DeepCopy ¶ added in v1.31.0
func (in *DriverState) DeepCopy() *DriverState
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriverState.
func (*DriverState) DeepCopyInto ¶ added in v1.31.0
func (in *DriverState) DeepCopyInto(out *DriverState)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.