Documentation
¶
Index ¶
- type AnsibleWorkload
- type Boot
- type Builder
- type CPU
- type CronJob
- type DeviceConfiguration
- type DeviceConfigurationMessage
- type DeviceProfile
- type Disk
- type EnrolementInfo
- type EnrolmentInfoFeatures
- type EventInfo
- type EventType
- type Future
- type Gpu
- type HardwareInfo
- type HardwareProfileConfiguration
- type HearbeatStatus
- type Heartbeat
- type HeartbeatConfiguration
- type HostDevice
- type Interface
- type IoPerf
- type Job
- func (j *Job) Cron() *CronJob
- func (j *Job) CurrentState() JobState
- func (j *Job) ID() string
- func (j *Job) IsMarkedForDeletion() bool
- func (j *Job) MarkForDeletion()
- func (j *Job) Retry() *RetryJob
- func (j *Job) SetCurrentState(currentState JobState)
- func (j *Job) SetTargetState(state JobState) error
- func (j *Job) ShouldRestart() bool
- func (j *Job) String() string
- func (j *Job) TargetState() JobState
- func (j *Job) Workload() Workload
- type JobState
- type Memory
- type Message
- type MessageKind
- type Mount
- type Option
- type OsInformation
- type Pair
- type PodWorkload
- type ProfileCondition
- type RegistrationInfo
- type RegistrationResponse
- type Result
- type RetryJob
- type Scope
- type Status
- type SystemVendor
- type UpgradeStatus
- type Workload
- type WorkloadKind
- type WorkloadProfile
- type WorkloadStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnsibleWorkload ¶
type AnsibleWorkload struct {
Playbook string
}
AnsibleWorkload represents ansible workload.
func (AnsibleWorkload) Hash ¶
func (a AnsibleWorkload) Hash() string
func (AnsibleWorkload) Kind ¶
func (a AnsibleWorkload) Kind() WorkloadKind
func (AnsibleWorkload) String ¶
func (a AnsibleWorkload) String() string
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func (*Builder) WithConstantRetry ¶
type CronJob ¶
type CronJob struct {
// contains filtered or unexported fields
}
func (*CronJob) CanReconcile ¶
func (*CronJob) ComputeNext ¶
func (cj *CronJob) ComputeNext()
type DeviceConfiguration ¶
type DeviceConfiguration struct { // Heartbeat configuration Heartbeat HeartbeatConfiguration // List of user defined mounts Mounts []Mount // Os information OsInformation OsInformation Profiles map[string]map[string]string }
func (DeviceConfiguration) Hash ¶
func (d DeviceConfiguration) Hash() string
func (DeviceConfiguration) String ¶
func (d DeviceConfiguration) String() string
type DeviceConfigurationMessage ¶
type DeviceConfigurationMessage struct { // configuration Configuration DeviceConfiguration // Device identifier DeviceID string // Version Version string // list of workloads Workloads []Workload // Defines the interval in seconds between the attempts to evaluate the workloads status and restart those that failed // Minimum: > 0 WorkloadsMonitoringInterval time.Duration }
func (DeviceConfigurationMessage) Hash ¶
func (m DeviceConfigurationMessage) Hash() string
func (DeviceConfigurationMessage) String ¶
func (m DeviceConfigurationMessage) String() string
type DeviceProfile ¶
type DeviceProfile struct { // Name is the name of the profile Name string // Conditions holds profile's conditions. Conditions []ProfileCondition }
DeviceProfile specify all the conditions of a profile:
```yaml state:
- perfomance:
- low: cpu<25%
- medium: cpu>25%
``` In this example the profile is _perfomance_ and the conditions are _low_ and _medium_. Each condition's expression is evaluated using Variables. The expression is only evaluated when all the variables need it by the expression are present in the variable map.
type Disk ¶
type Disk struct { // bootable Bootable bool // by-id is the World Wide Number of the device which guaranteed to be unique for every storage device ByID string // by-path is the shortest physical path to the device ByPath string // drive type DriveType string // hctl Hctl string // Determine the disk's unique identifier which is the by-id field if it exists and fallback to the by-path field otherwise ID string // io perf IoPerf *IoPerf // Whether the disk appears to be an installation media or not IsInstallationMedia bool // model Model string // name Name string // path Path string // serial Serial string // size bytes SizeBytes int64 // smart Smart string // vendor Vendor string // wwn Wwn string }
type EnrolementInfo ¶
type EnrolementInfo struct { // features Features EnrolmentInfoFeatures // target namespace TargetNamespace string }
type EnrolmentInfoFeatures ¶
type EnrolmentInfoFeatures struct { // hardware Hardware HardwareInfo // model name ModelName string }
type Future ¶
type Future[T any] struct { CancelFunc context.CancelFunc // contains filtered or unexported fields }
type Gpu ¶
type Gpu struct { // Device address (for example "0000:00:02.0") Address string // ID of the device (for example "3ea0") DeviceID string // Product name of the device (for example "UHD Graphics 620 (Whiskey Lake)") Name string // The name of the device vendor (for example "Intel Corporation") Vendor string // ID of the vendor (for example "8086") VendorID string }
type HardwareInfo ¶
type HardwareInfo struct { Boot Boot CPU CPU Disks []Disk Gpus []Gpu HostDevices []HostDevice Hostname string Interfaces []Interface Memory Memory Mounts []Mount SystemVendor SystemVendor }
type HearbeatStatus ¶
type HearbeatStatus int
const ( Up HearbeatStatus = iota Degraded )
func (HearbeatStatus) String ¶
func (hs HearbeatStatus) String() string
type Heartbeat ¶
type Heartbeat struct { // Events produced by device worker. Events []*EventInfo // hardware Hardware *HardwareInfo // status // Enum: [up degraded] Status HearbeatStatus // upgrade Upgrade *UpgradeStatus // version Version string // workloads Workloads []*WorkloadStatus }
type HeartbeatConfiguration ¶
type HeartbeatConfiguration struct { HardwareProfile HardwareProfileConfiguration // period in seconds Period time.Duration }
func (HeartbeatConfiguration) String ¶
func (h HeartbeatConfiguration) String() string
type HostDevice ¶
type Interface ¶
type Interface struct { // biosdevname Biosdevname string // client id ClientID string // flags Flags []string // has carrier HasCarrier bool // ipv4 addresses IPV4Addresses []string // ipv6 addresses IPV6Addresses []string // mac address MacAddress string // mtu Mtu int64 // name Name string // product Product string // speed mbps SpeedMbps int64 // vendor Vendor string }
type IoPerf ¶
type IoPerf struct { // 99th percentile of fsync duration in milliseconds SyncDuration int64 }
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
func (*Job) CurrentState ¶
func (*Job) IsMarkedForDeletion ¶
func (*Job) MarkForDeletion ¶
func (j *Job) MarkForDeletion()
func (*Job) SetCurrentState ¶
func (*Job) SetTargetState ¶
func (*Job) ShouldRestart ¶
func (*Job) TargetState ¶
type JobState ¶
type JobState int
const ( // ReadyState indicates that the task ready to be deloyed ReadyState JobState = iota // RunningState indicates that the task is running RunningState // StoppedState indicates that the task has been stopped without error StoppedState // DegradedState indicates that the task is an degrated state like a pod with containers stopped. DegradedState // ExitedState indicates that the task has been stopped with an error ExitedState // ErrorState indicates that deploying of the task has resulted in error. ErrorState // UnknownState indicates that the task is in an unknown state UnknownState // InactiveState indicates that the task is in an inactive state. InactiveState )
type Message ¶
type Message struct { Kind MessageKind Payload interface{} }
type MessageKind ¶
type MessageKind int
const ( WorkloadConfigurationMessage MessageKind = iota ProfileConfigurationMessage )
type OsInformation ¶
type PodWorkload ¶
type PodWorkload struct { Name string WKind WorkloadKind // Namespace of the workload Namespace string // cron spec CronSpec string // Rootless is true if workload is to be executed in podman rootless Rootless bool // Annotations Annotations map[string]string // secrets Secrets map[string]string // configmaps Configmaps []string // image registries auth file ImageRegistryAuth string // Workload labels Labels map[string]string WorkloadProfiles []WorkloadProfile // specification Specification string }
PodWorkload represents the workload in form of a pod.
func (PodWorkload) Cron ¶
func (p PodWorkload) Cron() string
func (PodWorkload) Hash ¶
func (p PodWorkload) Hash() string
func (PodWorkload) ID ¶
func (p PodWorkload) ID() string
func (PodWorkload) IsRootless ¶
func (p PodWorkload) IsRootless() bool
func (PodWorkload) Kind ¶
func (p PodWorkload) Kind() WorkloadKind
func (PodWorkload) Profiles ¶
func (p PodWorkload) Profiles() []WorkloadProfile
func (PodWorkload) String ¶
func (p PodWorkload) String() string
type ProfileCondition ¶
type ProfileCondition struct { // Name is the name of the condition Name string // requiredVariables holds the name of variables required to evaluate the expression RequiredVariables []string // Expression is the expression's interpreter for the condition Expression *interpreter.Interpreter }
type RegistrationInfo ¶
type RegistrationInfo struct { // Certificate Signing Request to be signed by flotta-operator CA CertificateRequest string // hardware info Hardware HardwareInfo }
type RegistrationResponse ¶
type RegistrationResponse struct {
SignedCSR []byte
}
type RetryJob ¶
type RetryJob struct {
// contains filtered or unexported fields
}
func (*RetryJob) CanReconcile ¶
func (*RetryJob) ComputeNext ¶
func (rj *RetryJob) ComputeNext()
type SystemVendor ¶
type UpgradeStatus ¶
type Workload ¶
type Workload interface { ID() string Kind() WorkloadKind String() string Hash() string Cron() string IsRootless() bool Profiles() []WorkloadProfile }
type WorkloadKind ¶
type WorkloadKind string
const ( PodKind WorkloadKind = "pod" AnsibleKind WorkloadKind = "ansible" K8SKind WorkloadKind = "k8s" )
type WorkloadProfile ¶
Click to show internal directories.
Click to hide internal directories.