v1alpha1

package
v0.5.0-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2020 License: MPL-2.0 Imports: 55 Imported by: 0

Documentation

Overview

Package v1alpha1 implements a `Runtime`.

Index

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 Hosts

func Hosts() (err error)

Hosts creates a persistent and writable /etc/hosts file.

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.

See http://man7.org/linux/man-pages/man2/reboot.2.html.

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

type Events struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

Events represents the runtime event stream.

func NewEvents

func NewEvents(n int) *Events

NewEvents initializes and returns the v1alpha1 runtime event stream.

func (*Events) Publish

func (e *Events) Publish(msg proto.Message)

Publish implements the Events interface.

func (*Events) Watch

func (e *Events) Watch(f runtime.WatchFunc)

Watch implements the Events interface.

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

Disk implements the machine state interface.

func (*MachineState) Installed

func (s *MachineState) Installed() bool

Installed implements the machine state interface.

type PhaseList

type PhaseList []runtime.Phase

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

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.

func (*Runtime) SetConfig

func (r *Runtime) SetConfig(b []byte) error

SetConfig implements the Runtime interface.

func (*Runtime) State

func (r *Runtime) State() runtime.State

State implements the Runtime interface.

type Sequencer

type Sequencer struct{}

Sequencer implements the sequencer interface.

func NewSequencer

func NewSequencer() *Sequencer

NewSequencer intializes and returns a sequencer.

func (*Sequencer) Boot

func (*Sequencer) Boot(r runtime.Runtime) []runtime.Phase

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

func (*Sequencer) Bootstrap(r runtime.Runtime) []runtime.Phase

Bootstrap is the bootstrap sequence. This primary goal if this sequence is to bootstrap Etcd and Kubernetes.

func (*Sequencer) Initialize

func (*Sequencer) Initialize(r runtime.Runtime) []runtime.Phase

Initialize is the initialize sequence. The primary goals of this sequence is to load the config and enforce kernel security requirements.

func (*Sequencer) Install

func (*Sequencer) Install(r runtime.Runtime) []runtime.Phase

Install is the install sequence.

func (*Sequencer) Reboot

func (*Sequencer) Reboot(r runtime.Runtime) []runtime.Phase

Reboot is the reboot sequence.

func (*Sequencer) Recover

Recover is the recover sequence.

func (*Sequencer) Reset

Reset is the reset sequence.

func (*Sequencer) Shutdown

func (*Sequencer) Shutdown(r runtime.Runtime) []runtime.Phase

Shutdown is the shutdown sequence.

func (*Sequencer) Upgrade

Upgrade is the upgrade sequence.

type State

type State struct {
	// contains filtered or unexported fields
}

State implements the state interface.

func NewState

func NewState() (s *State, err error)

NewState initializes and returns the v1alpha1 state.

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.

func (*State) Platform

func (s *State) Platform() runtime.Platform

Platform implements the state interface.

Directories

Path Synopsis
aws
gcp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL