Documentation
¶
Overview ¶
Package v1alpha1 implements a `Runtime`.
Index ¶
- func BootstrapEtcd(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func BootstrapKubernetes(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func CordonAndDrainNode(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func CreateEtcNetworkFiles(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func CreateOSReleaseFile(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func EnforceKSPPRequirements(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func Hosts() (err error)
- func Install(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func LabelNodeAsMaster(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func LeaveEtcd(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func LoadConfig(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func MountBPFFS(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func MountBootPartition(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func MountCgroups(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func MountEphermeralPartition(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func MountOverlayFilesystems(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func MountPseudoFilesystems(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func MountUserDisks(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func OSRelease() (err error)
- func Reboot(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func Recover(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func RemoveAllPods(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func ResetNetwork(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func ResetSystemDisk(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func ResolvConf() (err error)
- func SaveConfig(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func SetInitStatus(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func SetRLimit(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func SetUserEnvVars(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func SetupDiscoveryNetwork(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func SetupLogger(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func SetupSharedFilesystems(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func SetupSystemDirectory(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func SetupVarDirectory(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func Shutdown(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func StartAllServices(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func StartContainerd(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func StopAllServices(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func StopServicesForUpgrade(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func SyncNonVolatileStorageBuffers()
- func UnmountBootPartition(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func UnmountEphemeralPartition(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func UnmountOverlayFilesystems(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func UnmountPodMounts(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func UnmountSystemDiskBindMounts(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func UpdateBootloader(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func Upgrade(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func ValidateConfig(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func VerifyDiskAvailability(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func VerifyInstallation(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func WriteIMAPolicy(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func WriteRequiredSysctls(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func WriteRequiredSysctlsForContainer(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func WriteUserFiles(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- func WriteUserSysctls(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
- type ClusterState
- type Controller
- type Events
- type MachineState
- type PhaseList
- type Runtime
- type Sequencer
- func (*Sequencer) Boot(r runtime.Runtime) []runtime.Phase
- func (*Sequencer) Bootstrap(r runtime.Runtime) []runtime.Phase
- func (*Sequencer) Initialize(r runtime.Runtime) []runtime.Phase
- func (*Sequencer) Install(r runtime.Runtime) []runtime.Phase
- func (*Sequencer) Reboot(r runtime.Runtime) []runtime.Phase
- func (*Sequencer) Recover(r runtime.Runtime, in *machine.RecoverRequest) []runtime.Phase
- func (*Sequencer) Reset(r runtime.Runtime, in *machine.ResetRequest) []runtime.Phase
- func (*Sequencer) Shutdown(r runtime.Runtime) []runtime.Phase
- func (*Sequencer) Upgrade(r runtime.Runtime, in *machine.UpgradeRequest) []runtime.Phase
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BootstrapEtcd ¶
func BootstrapEtcd(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
BootstrapEtcd represents the task for bootstrapping etcd.
func BootstrapKubernetes ¶
func BootstrapKubernetes(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
BootstrapKubernetes represents the task for bootstrapping Kubernetes.
func CordonAndDrainNode ¶
func CordonAndDrainNode(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
CordonAndDrainNode represents the task for stop all containerd tasks in the k8s.io namespace.
func CreateEtcNetworkFiles ¶
func CreateEtcNetworkFiles(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
CreateEtcNetworkFiles represents the CreateEtcNetworkFiles task.
func CreateOSReleaseFile ¶
func CreateOSReleaseFile(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
CreateOSReleaseFile represents the CreateOSReleaseFile task.
func EnforceKSPPRequirements ¶
func EnforceKSPPRequirements(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
EnforceKSPPRequirements represents the EnforceKSPPRequirements task.
func Install ¶
func Install(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
Install mounts or installs the system partitions.
func LabelNodeAsMaster ¶
func LabelNodeAsMaster(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
LabelNodeAsMaster represents the LabelNodeAsMaster task.
func LeaveEtcd ¶
func LeaveEtcd(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
LeaveEtcd represents the task for removing a control plane node from etcd. nolint: gocyclo
func LoadConfig ¶
func LoadConfig(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
LoadConfig represents the LoadConfig task.
func MountBPFFS ¶
func MountBPFFS(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
MountBPFFS represents the MountBPFFS task.
func MountBootPartition ¶
func MountBootPartition(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
MountBootPartition mounts the boot partition.
func MountCgroups ¶
func MountCgroups(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
MountCgroups represents the MountCgroups task.
func MountEphermeralPartition ¶
func MountEphermeralPartition(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
MountEphermeralPartition mounts the ephemeral partition.
func MountOverlayFilesystems ¶
func MountOverlayFilesystems(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
MountOverlayFilesystems represents the MountOverlayFilesystems task.
func MountPseudoFilesystems ¶
func MountPseudoFilesystems(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
MountPseudoFilesystems represents the MountPseudoFilesystems task.
func MountUserDisks ¶
func MountUserDisks(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
MountUserDisks represents the MountUserDisks task.
func OSRelease ¶
func OSRelease() (err error)
OSRelease renders a valid /etc/os-release file and writes it to disk. The node's OS Image field is reported by the node from /etc/os-release.
func Reboot ¶
func Reboot(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
Reboot represents the Reboot task.
func Recover ¶
func Recover(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
Recover attempts to recover the control plane.
nolint: gocyclo
func RemoveAllPods ¶
func RemoveAllPods(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
RemoveAllPods represents the task for stopping all pods.
func ResetNetwork ¶
func ResetNetwork(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
ResetNetwork resets the network.
nolint: gocyclo
func ResetSystemDisk ¶
func ResetSystemDisk(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
ResetSystemDisk represents the task to reset the system disk.
func ResolvConf ¶
func ResolvConf() (err error)
ResolvConf creates a persistent and writable /etc/resolv.conf file.
func SaveConfig ¶
func SaveConfig(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
SaveConfig represents the SaveConfig task.
func SetInitStatus ¶
func SetInitStatus(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
SetInitStatus represents the task for setting the initialization status in etcd.
func SetRLimit ¶
func SetRLimit(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
SetRLimit represents the SetRLimit task.
func SetUserEnvVars ¶
func SetUserEnvVars(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
SetUserEnvVars represents the SetUserEnvVars task.
func SetupDiscoveryNetwork ¶
func SetupDiscoveryNetwork(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
SetupDiscoveryNetwork represents the task for setting up the initial network.
func SetupLogger ¶
func SetupLogger(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
SetupLogger represents the SetupLogger task.
func SetupSharedFilesystems ¶
func SetupSharedFilesystems(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
SetupSharedFilesystems represents the SetupSharedFilesystems task.
func SetupSystemDirectory ¶
func SetupSystemDirectory(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
SetupSystemDirectory represents the SetupSystemDirectory task.
func SetupVarDirectory ¶
func SetupVarDirectory(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
SetupVarDirectory represents the SetupVarDirectory task.
func Shutdown ¶
func Shutdown(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
Shutdown represents the Shutdown task.
func StartAllServices ¶
func StartAllServices(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
StartAllServices represents the task to start the system services.
func StartContainerd ¶
func StartContainerd(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
StartContainerd represents the task to start the system services.
func StopAllServices ¶
func StopAllServices(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
StopAllServices represents the StopAllServices task.
func StopServicesForUpgrade ¶
func StopServicesForUpgrade(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
StopServicesForUpgrade represents the StopServicesForUpgrade task.
func SyncNonVolatileStorageBuffers ¶
func SyncNonVolatileStorageBuffers()
SyncNonVolatileStorageBuffers invokes unix.Sync and waits up to 30 seconds for it to finish.
func UnmountBootPartition ¶
func UnmountBootPartition(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
UnmountBootPartition unmounts the boot partition.
func UnmountEphemeralPartition ¶
func UnmountEphemeralPartition(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
UnmountEphemeralPartition unmounts the ephemeral partition.
func UnmountOverlayFilesystems ¶
func UnmountOverlayFilesystems(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
UnmountOverlayFilesystems represents the UnmountOverlayFilesystems task.
func UnmountPodMounts ¶
func UnmountPodMounts(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
UnmountPodMounts represents the UnmountPodMounts task.
func UnmountSystemDiskBindMounts ¶
func UnmountSystemDiskBindMounts(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
UnmountSystemDiskBindMounts represents the UnmountSystemDiskBindMounts task.
func UpdateBootloader ¶
func UpdateBootloader(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
UpdateBootloader represents the UpdateBootloader task.
func Upgrade ¶
func Upgrade(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
Upgrade represents the task for performing an upgrade.
func ValidateConfig ¶
func ValidateConfig(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
ValidateConfig validates the config.
func VerifyDiskAvailability ¶
func VerifyDiskAvailability(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
VerifyDiskAvailability represents the task for verifying that the system disk is not in use.
func VerifyInstallation ¶
func VerifyInstallation(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
VerifyInstallation represents the VerifyInstallation task.
func WriteIMAPolicy ¶
func WriteIMAPolicy(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
WriteIMAPolicy represents the WriteIMAPolicy task.
func WriteRequiredSysctls ¶
func WriteRequiredSysctls(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
WriteRequiredSysctls represents the WriteRequiredSysctls task.
func WriteRequiredSysctlsForContainer ¶
func WriteRequiredSysctlsForContainer(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
WriteRequiredSysctlsForContainer represents the WriteRequiredSysctlsForContainer task.
func WriteUserFiles ¶
func WriteUserFiles(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
WriteUserFiles represents the WriteUserFiles task.
nolint: gocyclo
func WriteUserSysctls ¶
func WriteUserSysctls(seq runtime.Sequence, data interface{}) runtime.TaskExecutionFunc
WriteUserSysctls represents the WriteUserSysctls task.
Types ¶
type ClusterState ¶
type ClusterState struct {
// contains filtered or unexported fields
}
ClusterState represents the cluster's state.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller represents the controller responsible for managing the execution of sequences.
func NewController ¶
func NewController(b []byte) (*Controller, error)
NewController intializes and returns a controller.
func (*Controller) ListenForEvents ¶
func (c *Controller) ListenForEvents() error
ListenForEvents starts the event listener. The listener will trigger a shutdown in response to a SIGTERM signal and ACPI button/power event.
func (*Controller) Run ¶
func (c *Controller) Run(seq runtime.Sequence, data interface{}) error
Run executes all phases known to the controller in serial. `Controller` aborts immediately if any phase fails.
func (*Controller) Runtime ¶
func (c *Controller) Runtime() runtime.Runtime
Runtime implements the controller interface.
func (*Controller) Sequencer ¶
func (c *Controller) Sequencer() runtime.Sequencer
Sequencer implements the controller interface.
func (*Controller) TryLock ¶
func (c *Controller) TryLock() bool
TryLock attempts to set a lock that prevents multiple sequences from running at once. If currently locked, a value of true will be returned. If not currently locked, a value of false will be returned.
func (*Controller) Unlock ¶
func (c *Controller) Unlock() bool
Unlock removes the lock set by `TryLock`.
type Events ¶
Events represents the runtime event stream.
type MachineState ¶
type MachineState struct {
// contains filtered or unexported fields
}
MachineState represents the machine's state.
func (*MachineState) Close ¶
func (s *MachineState) Close() error
Close implements the machine state interface.
func (*MachineState) Disk ¶
func (s *MachineState) Disk() *probe.ProbedBlockDevice
Disk implements the machine state interface.
func (*MachineState) Installed ¶
func (s *MachineState) Installed() bool
Installed implements the machine state interface.
type PhaseList ¶
PhaseList represents a list of phases.
func (PhaseList) Append ¶
func (p PhaseList) Append(tasks ...runtime.TaskSetupFunc) PhaseList
Append appends a task to the phase list.
func (PhaseList) AppendWhen ¶
func (p PhaseList) AppendWhen(when bool, tasks ...runtime.TaskSetupFunc) PhaseList
AppendWhen appends a task to the phase list when `when` is `true`.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime implements the Runtime interface.
func NewRuntime ¶
func NewRuntime(c runtime.Configurator, s runtime.State, e runtime.EventStream) *Runtime
NewRuntime initializes and returns the v1alpha1 runtime.
func (*Runtime) Config ¶
func (r *Runtime) Config() runtime.Configurator
Config implements the Runtime interface.
func (*Runtime) Events ¶
func (r *Runtime) Events() runtime.EventStream
Events implements the Runtime interface.
type Sequencer ¶
type Sequencer struct{}
Sequencer implements the sequencer interface.
func (*Sequencer) Boot ¶
Boot is the boot sequence. This primary goal if this sequence is to apply user supplied settings and start the services for the specific machine type. This sequence should never be reached if an installation is not found.
func (*Sequencer) Bootstrap ¶
Bootstrap is the bootstrap sequence. This primary goal if this sequence is to bootstrap Etcd and Kubernetes.
func (*Sequencer) Initialize ¶
Initialize is the initialize sequence. The primary goals of this sequence is to load the config and enforce kernel security requirements.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State implements the state interface.
func (*State) Cluster ¶
func (s *State) Cluster() runtime.ClusterState
Cluster implements the state interface.
func (*State) Machine ¶
func (s *State) Machine() runtime.MachineState
Machine implements the state interface.