Documentation ¶
Index ¶
- Variables
- type Backup
- type ConfigureK0s
- type Connect
- type DaemonReload
- type DefaultK0sVersion
- type DetectOS
- type Disconnect
- type DownloadBinaries
- type DownloadK0s
- type GatherFacts
- type GatherK0sFacts
- type GenericPhase
- func (p *GenericPhase) DryMsg(host fmt.Stringer, msg string)
- func (p *GenericPhase) DryMsgf(host fmt.Stringer, msg string, args ...any)
- func (p *GenericPhase) GetConfig() *v1beta1.Cluster
- func (p *GenericPhase) IsWet() bool
- func (p *GenericPhase) Prepare(c *v1beta1.Cluster) error
- func (p *GenericPhase) SetManager(m *Manager)
- func (p *GenericPhase) Wet(host fmt.Stringer, msg string, funcs ...errorfunc) error
- type GetKubeconfig
- type InitializeK0s
- type InstallBinaries
- type InstallControllers
- type InstallWorkers
- type Lock
- type Manager
- type Phase
- type Phases
- type PrepareArm
- type PrepareHosts
- type Reinstall
- type ResetControllers
- type ResetLeader
- type ResetWorkers
- type Restore
- type RunHooks
- type Unlock
- type UpgradeControllers
- type UpgradeWorkers
- type UploadFiles
- type UploadK0s
- type ValidateEtcdMembers
- type ValidateFacts
- type ValidateHosts
Constants ¶
This section is empty.
Variables ¶
var Colorize = aurora.NewAurora(false)
Colorize is an instance of "aurora", used to colorize the output
var Force bool
Force is used by various phases to attempt a forced installation
var NoWait bool
NoWait is used by various phases to decide if node ready state should be waited for or not
Functions ¶
This section is empty.
Types ¶
type Backup ¶ added in v0.8.5
type Backup struct { GenericPhase // contains filtered or unexported fields }
Backup connect to one of the controllers and takes a backup
type ConfigureK0s ¶
type ConfigureK0s struct { GenericPhase // contains filtered or unexported fields }
ConfigureK0s writes the k0s configuration to host k0s config dir
func (*ConfigureK0s) DryRun ¶ added in v0.17.0
func (p *ConfigureK0s) DryRun() error
DryRun prints the actions that would be taken
func (*ConfigureK0s) Prepare ¶ added in v0.13.0
func (p *ConfigureK0s) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*ConfigureK0s) ShouldRun ¶ added in v0.17.0
func (p *ConfigureK0s) ShouldRun() bool
ShouldRun is true when there are controllers to configure
type DaemonReload ¶ added in v0.17.6
type DaemonReload struct {
GenericPhase
}
DaemonReload phase runs `systemctl daemon-reload` or equivalent on all hosts.
func (*DaemonReload) ShouldRun ¶ added in v0.17.6
func (p *DaemonReload) ShouldRun() bool
ShouldRun is true when there are controllers that needs to be reset
func (*DaemonReload) Title ¶ added in v0.17.6
func (p *DaemonReload) Title() string
Title for the phase
type DefaultK0sVersion ¶ added in v0.17.0
type DefaultK0sVersion struct {
GenericPhase
}
func (*DefaultK0sVersion) Run ¶ added in v0.17.0
func (p *DefaultK0sVersion) Run() error
func (*DefaultK0sVersion) ShouldRun ¶ added in v0.17.0
func (p *DefaultK0sVersion) ShouldRun() bool
func (*DefaultK0sVersion) Title ¶ added in v0.17.0
func (p *DefaultK0sVersion) Title() string
type Disconnect ¶
type Disconnect struct {
GenericPhase
}
Disconnect disconnects from the hosts
func (*Disconnect) DryRun ¶ added in v0.17.0
func (p *Disconnect) DryRun() error
DryRun cleans up the temporary k0s binary from the hosts
type DownloadBinaries ¶
type DownloadBinaries struct { GenericPhase // contains filtered or unexported fields }
DownloadBinaries downloads k0s binaries to localohost temp files
func (*DownloadBinaries) Prepare ¶
func (p *DownloadBinaries) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*DownloadBinaries) ShouldRun ¶
func (p *DownloadBinaries) ShouldRun() bool
ShouldRun is true when the phase should be run
type DownloadK0s ¶
type DownloadK0s struct { GenericPhase // contains filtered or unexported fields }
DownloadK0s performs k0s online download on the hosts
func (*DownloadK0s) Prepare ¶
func (p *DownloadK0s) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*DownloadK0s) ShouldRun ¶
func (p *DownloadK0s) ShouldRun() bool
ShouldRun is true when the phase should be run
type GatherFacts ¶
type GatherFacts struct { GenericPhase SkipMachineIDs bool }
GatherFacts gathers information about hosts, such as if k0s is already up and running
type GatherK0sFacts ¶
type GatherK0sFacts struct { GenericPhase // contains filtered or unexported fields }
GatherK0sFacts gathers information about hosts, such as if k0s is already up and running
func (*GatherK0sFacts) Prepare ¶ added in v0.17.0
func (p *GatherK0sFacts) Prepare(config *v1beta1.Cluster) error
Prepare finds hosts with k0s installed
func (*GatherK0sFacts) ShouldRun ¶ added in v0.17.0
func (p *GatherK0sFacts) ShouldRun() bool
ShouldRun is true when there are hosts that need to be connected
type GenericPhase ¶
type GenericPhase struct { analytics.Phase Config *v1beta1.Cluster // contains filtered or unexported fields }
GenericPhase is a basic phase which gets a config via prepare, sets it into p.Config
func (*GenericPhase) DryMsg ¶ added in v0.17.0
func (p *GenericPhase) DryMsg(host fmt.Stringer, msg string)
DryMsg is a shorthand for manager.DryMsg
func (*GenericPhase) DryMsgf ¶ added in v0.17.0
func (p *GenericPhase) DryMsgf(host fmt.Stringer, msg string, args ...any)
DryMsgf is a shorthand for manager.DryMsg + fmt.Sprintf
func (*GenericPhase) GetConfig ¶
func (p *GenericPhase) GetConfig() *v1beta1.Cluster
GetConfig is an accessor to phase Config
func (*GenericPhase) IsWet ¶ added in v0.17.0
func (p *GenericPhase) IsWet() bool
IsWet returns true if manager is in dry-run mode
func (*GenericPhase) Prepare ¶
func (p *GenericPhase) Prepare(c *v1beta1.Cluster) error
Prepare the phase
func (*GenericPhase) SetManager ¶ added in v0.15.0
func (p *GenericPhase) SetManager(m *Manager)
SetManager adds a reference to the phase manager
type GetKubeconfig ¶
type GetKubeconfig struct { GenericPhase APIAddress string }
GetKubeconfig is a phase to get and dump the admin kubeconfig
func (*GetKubeconfig) DryRun ¶ added in v0.17.0
func (p *GetKubeconfig) DryRun() error
type InitializeK0s ¶
type InitializeK0s struct { GenericPhase // contains filtered or unexported fields }
InitializeK0s sets up the "initial" k0s controller
func (*InitializeK0s) CleanUp ¶ added in v0.10.0
func (p *InitializeK0s) CleanUp()
CleanUp cleans up the environment override file
func (*InitializeK0s) Prepare ¶
func (p *InitializeK0s) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*InitializeK0s) ShouldRun ¶
func (p *InitializeK0s) ShouldRun() bool
ShouldRun is true when there is a leader host
type InstallBinaries ¶ added in v0.15.1
type InstallBinaries struct { GenericPhase // contains filtered or unexported fields }
InstallBinaries installs the k0s binaries from the temp location of UploadBinaries or InstallBinaries
func (*InstallBinaries) CleanUp ¶ added in v0.15.1
func (p *InstallBinaries) CleanUp()
func (*InstallBinaries) DryRun ¶ added in v0.17.0
func (p *InstallBinaries) DryRun() error
DryRun reports what would happen if Run is called.
func (*InstallBinaries) Prepare ¶ added in v0.15.1
func (p *InstallBinaries) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*InstallBinaries) ShouldRun ¶ added in v0.15.1
func (p *InstallBinaries) ShouldRun() bool
ShouldRun is true when the phase should be run
func (*InstallBinaries) Title ¶ added in v0.15.1
func (p *InstallBinaries) Title() string
Title for the phase
type InstallControllers ¶
type InstallControllers struct { GenericPhase // contains filtered or unexported fields }
InstallControllers installs k0s controllers and joins them to the cluster
func (*InstallControllers) After ¶ added in v0.17.0
func (p *InstallControllers) After() error
func (*InstallControllers) CleanUp ¶ added in v0.10.0
func (p *InstallControllers) CleanUp()
CleanUp cleans up the environment override files on hosts
func (*InstallControllers) Prepare ¶
func (p *InstallControllers) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*InstallControllers) ShouldRun ¶
func (p *InstallControllers) ShouldRun() bool
ShouldRun is true when there are controllers
type InstallWorkers ¶
type InstallWorkers struct { GenericPhase // contains filtered or unexported fields }
InstallWorkers installs k0s on worker hosts and joins them to the cluster
func (*InstallWorkers) After ¶ added in v0.17.0
func (p *InstallWorkers) After() error
func (*InstallWorkers) CleanUp ¶ added in v0.10.0
func (p *InstallWorkers) CleanUp()
CleanUp attempts to clean up any changes after a failed install
func (*InstallWorkers) Prepare ¶
func (p *InstallWorkers) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*InstallWorkers) ShouldRun ¶
func (p *InstallWorkers) ShouldRun() bool
ShouldRun is true when there are workers
type Lock ¶ added in v0.13.0
type Lock struct { GenericPhase // contains filtered or unexported fields }
Lock acquires an exclusive k0sctl lock on hosts
func (*Lock) CleanUp ¶ added in v0.15.5
func (p *Lock) CleanUp()
CleanUp calls Cancel to release the lock
func (*Lock) UnlockPhase ¶ added in v0.19.1
UnlockPhase returns an unlock phase for this lock phase
type Manager ¶
type Manager struct { Config *v1beta1.Cluster Concurrency int ConcurrentUploads int DryRun bool // contains filtered or unexported fields }
Manager executes phases to construct the cluster
func NewManager ¶ added in v0.16.0
NewManager creates a new Manager
type Phases ¶ added in v0.19.1
type Phases []Phase
Phases is a slice of Phases
func (Phases) Index ¶ added in v0.19.1
Index returns the index of the first occurrence matching the given phase title or -1 if not found
func (*Phases) InsertAfter ¶ added in v0.19.1
InsertAfter inserts a phase after the first occurrence of a phase with the given title
func (*Phases) InsertBefore ¶ added in v0.19.1
InsertBefore inserts a phase before the first occurrence of a phase with the given title
type PrepareArm ¶ added in v0.10.0
type PrepareArm struct { GenericPhase // contains filtered or unexported fields }
PrepareArm implements a phase which fixes arm quirks
func (*PrepareArm) Prepare ¶ added in v0.10.0
func (p *PrepareArm) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*PrepareArm) ShouldRun ¶ added in v0.10.0
func (p *PrepareArm) ShouldRun() bool
ShouldRun is true when there are arm controllers
type PrepareHosts ¶
type PrepareHosts struct {
GenericPhase
}
PrepareHosts installs required packages and so on on the hosts.
type Reinstall ¶ added in v0.19.0
type Reinstall struct { GenericPhase // contains filtered or unexported fields }
type ResetControllers ¶ added in v0.15.0
type ResetControllers struct { GenericPhase NoDrain bool NoDelete bool NoLeave bool // contains filtered or unexported fields }
ResetControllers phase removes controllers marked for reset from the kubernetes and etcd clusters and resets k0s on the host
func (*ResetControllers) Prepare ¶ added in v0.15.0
func (p *ResetControllers) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*ResetControllers) Run ¶ added in v0.15.0
func (p *ResetControllers) Run() error
Run the phase
func (*ResetControllers) ShouldRun ¶ added in v0.15.0
func (p *ResetControllers) ShouldRun() bool
ShouldRun is true when there are controllers that needs to be reset
func (*ResetControllers) Title ¶ added in v0.15.0
func (p *ResetControllers) Title() string
Title for the phase
type ResetLeader ¶ added in v0.15.0
type ResetLeader struct { GenericPhase // contains filtered or unexported fields }
ResetLeader phase removes the leader from the cluster and thus destroys the cluster
func (*ResetLeader) Prepare ¶ added in v0.15.0
func (p *ResetLeader) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*ResetLeader) Title ¶ added in v0.15.0
func (p *ResetLeader) Title() string
Title for the phase
type ResetWorkers ¶ added in v0.15.0
type ResetWorkers struct { GenericPhase NoDrain bool NoDelete bool // contains filtered or unexported fields }
ResetControllers phase removes workers marked for reset from the kubernetes cluster and resets k0s on the host
func (*ResetWorkers) Prepare ¶ added in v0.15.0
func (p *ResetWorkers) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*ResetWorkers) ShouldRun ¶ added in v0.15.0
func (p *ResetWorkers) ShouldRun() bool
ShouldRun is true when there are workers that needs to be reset
func (*ResetWorkers) Title ¶ added in v0.15.0
func (p *ResetWorkers) Title() string
Title for the phase
type Restore ¶ added in v0.8.5
type Restore struct { GenericPhase RestoreFrom string // contains filtered or unexported fields }
type RunHooks ¶ added in v0.9.0
type RunHooks struct { GenericPhase Action string Stage string // contains filtered or unexported fields }
RunHooks phase runs a set of hooks configured for the host
type Unlock ¶ added in v0.13.0
type Unlock struct { GenericPhase Cancel func() }
Unlock acquires an exclusive k0sctl lock on hosts
type UpgradeControllers ¶ added in v0.5.0
type UpgradeControllers struct { GenericPhase // contains filtered or unexported fields }
UpgradeControllers upgrades the controllers one-by-one
func (*UpgradeControllers) CleanUp ¶ added in v0.10.0
func (p *UpgradeControllers) CleanUp()
CleanUp cleans up the environment override files on hosts
func (*UpgradeControllers) Prepare ¶ added in v0.5.0
func (p *UpgradeControllers) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*UpgradeControllers) Run ¶ added in v0.5.0
func (p *UpgradeControllers) Run() error
Run the phase
func (*UpgradeControllers) ShouldRun ¶ added in v0.5.0
func (p *UpgradeControllers) ShouldRun() bool
ShouldRun is true when there are controllers that needs to be upgraded
func (*UpgradeControllers) Title ¶ added in v0.5.0
func (p *UpgradeControllers) Title() string
Title for the phase
type UpgradeWorkers ¶ added in v0.5.0
type UpgradeWorkers struct { GenericPhase NoDrain bool // contains filtered or unexported fields }
UpgradeWorkers upgrades workers in batches
func (*UpgradeWorkers) CleanUp ¶ added in v0.10.0
func (p *UpgradeWorkers) CleanUp()
CleanUp cleans up the environment override files on hosts
func (*UpgradeWorkers) Prepare ¶ added in v0.5.0
func (p *UpgradeWorkers) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*UpgradeWorkers) ShouldRun ¶ added in v0.5.0
func (p *UpgradeWorkers) ShouldRun() bool
ShouldRun is true when there are workers that needs to be upgraded
func (*UpgradeWorkers) Title ¶ added in v0.5.0
func (p *UpgradeWorkers) Title() string
Title for the phase
type UploadFiles ¶ added in v0.6.0
type UploadFiles struct { GenericPhase // contains filtered or unexported fields }
UploadFiles implements a phase which upload files to hosts
func (*UploadFiles) Prepare ¶ added in v0.6.0
func (p *UploadFiles) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*UploadFiles) ShouldRun ¶ added in v0.6.0
func (p *UploadFiles) ShouldRun() bool
ShouldRun is true when there are workers
func (*UploadFiles) Title ¶ added in v0.6.0
func (p *UploadFiles) Title() string
Title for the phase
type UploadK0s ¶ added in v0.17.0
type UploadK0s struct { GenericPhase // contains filtered or unexported fields }
UploadK0s uploads k0s binaries from localhost to target
type ValidateEtcdMembers ¶ added in v0.19.1
type ValidateEtcdMembers struct { GenericPhase // contains filtered or unexported fields }
ValidateEtcdMembers checks for existing etcd members with the same IP as a new controller
func (*ValidateEtcdMembers) Prepare ¶ added in v0.19.1
func (p *ValidateEtcdMembers) Prepare(config *v1beta1.Cluster) error
Prepare the phase
func (*ValidateEtcdMembers) Run ¶ added in v0.19.1
func (p *ValidateEtcdMembers) Run() error
Run the phase
func (*ValidateEtcdMembers) ShouldRun ¶ added in v0.19.1
func (p *ValidateEtcdMembers) ShouldRun() bool
ShouldRun is true when there are new controllers and etcd
func (*ValidateEtcdMembers) Title ¶ added in v0.19.1
func (p *ValidateEtcdMembers) Title() string
Title for the phase
type ValidateFacts ¶ added in v0.5.0
type ValidateFacts struct { GenericPhase SkipDowngradeCheck bool }
ValidateFacts performs remote OS detection
func (*ValidateFacts) Title ¶ added in v0.5.0
func (p *ValidateFacts) Title() string
Title for the phase
type ValidateHosts ¶
type ValidateHosts struct { GenericPhase // contains filtered or unexported fields }
ValidateHosts performs remote OS detection
Source Files ¶
- arm_prepare.go
- backup.go
- configure_k0s.go
- connect.go
- daemon_reload.go
- default_k0s_version.go
- detect_os.go
- disconnect.go
- download_binaries.go
- download_k0s.go
- gather_facts.go
- gather_k0s_facts.go
- generic_phase.go
- get_kubeconfig.go
- initialize_k0s.go
- install_binaries.go
- install_controllers.go
- install_workers.go
- lock.go
- manager.go
- prepare_hosts.go
- reinstall.go
- reset_controllers.go
- reset_leader.go
- reset_workers.go
- restore.go
- runhooks.go
- unlock.go
- upgrade_controllers.go
- upgrade_workers.go
- upload_k0s.go
- uploadfiles.go
- validate_etcd_members.go
- validate_facts.go
- validate_hosts.go