clusterruntime

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CRILabel is key for get container runtime interface type.
	CRILabel = "cluster.alpha.sealer.io/container-runtime-type"
	// CRTLabel is key for get cluster runtime type.
	CRTLabel = "cluster.alpha.sealer.io/cluster-runtime-type"

	RegistryConfigMapName     = "sealer-registry"
	RegistryConfigMapDataName = "registry"
)
View Source
const (
	ExtraOptionSkipWhenWorkspaceNotExists = "SkipWhenWorkspaceNotExists"
)

Variables

This section is empty.

Functions

func CheckNodeSSH added in v0.10.0

func CheckNodeSSH(infraDriver infradriver.InfraDriver, clientHosts []net.IP) ([]net.IP, error)

func GetClusterConfPath added in v0.9.2

func GetClusterConfPath(labels map[string]string) string

func LoadPluginsFromFile

func LoadPluginsFromFile(pluginPath string) ([]v1.Plugin, error)

LoadPluginsFromFile load plugin config files from $rootfs/plugins dir.

func LoadToRegistry added in v0.9.2

func LoadToRegistry(infraDriver infradriver.InfraDriver, distributor imagedistributor.Distributor) error

LoadToRegistry just load container image to local registry

func Register

func Register(name HookType, factory HookFunc)

Register different hook type with its HookFunc to hookFactories

Types

type HookConfig

type HookConfig struct {
	// Name defines hook names, will run hooks in alphabetical order.
	Name string `json:"name,omitempty"`
	//Type defines different hook type, currently only have "SHELL","HOSTNAME".
	Type HookType `json:"type,omitempty"`
	// Data real hooks data will be applied at install process.
	Data string `json:"data,omitempty"`
	// Phase defines when to run hooks.
	Phase Phase `json:"Phase,omitempty"`
	// Scope defines which roles of node will be applied with hook Data
	Scope Scope `json:"scope,omitempty"`
}

HookConfig tell us how to configure hooks for cluster

type HookConfigList

type HookConfigList []HookConfig

func (HookConfigList) Len

func (r HookConfigList) Len() int

func (HookConfigList) Less

func (r HookConfigList) Less(i, j int) bool

func (HookConfigList) Swap

func (r HookConfigList) Swap(i, j int)

type HookFunc

type HookFunc func(data string, onHosts []net.IP, driver infradriver.InfraDriver, extraOpts map[string]bool) error

func NewShellHook

func NewShellHook() HookFunc

type HookType

type HookType string
const (
	ShellHook HookType = "SHELL"
)

type InstallInfo added in v0.9.2

type InstallInfo struct {
	ContainerRuntimeType string
	ClusterRuntimeType   string
}

func GetClusterInstallInfo added in v0.9.2

func GetClusterInstallInfo(imageLabels map[string]string, criConfig v2.ContainerRuntimeConfig) InstallInfo

type Installer

type Installer struct {
	RuntimeConfig
	// contains filtered or unexported fields
}

func NewInstaller

func NewInstaller(infraDriver infradriver.InfraDriver, runtimeConfig RuntimeConfig, installInfo InstallInfo) (*Installer, error)

func (*Installer) GetCurrentDriver

func (i *Installer) GetCurrentDriver() (registry.Driver, runtime.Driver, error)

func (*Installer) Install

func (i *Installer) Install() error

func (*Installer) Rollback added in v0.9.3

func (i *Installer) Rollback() error

func (*Installer) ScaleDown

func (i *Installer) ScaleDown(mastersToDelete, workersToDelete []net.IP) (registry.Driver, runtime.Driver, error)

func (*Installer) ScaleUp

func (i *Installer) ScaleUp(newMasters, newWorkers []net.IP) (registry.Driver, runtime.Driver, error)

func (*Installer) UnInstall

func (i *Installer) UnInstall() error

func (*Installer) Upgrade added in v0.9.2

func (i *Installer) Upgrade() error

type Phase

type Phase string
const (
	//PreInstallCluster on master0
	PreInstallCluster Phase = "pre-install"
	//PostInstallCluster on master0
	PostInstallCluster Phase = "post-install"
	//PreUnInstallCluster on master0
	PreUnInstallCluster Phase = "pre-uninstall"
	//PostUnInstallCluster on master0
	PostUnInstallCluster Phase = "post-uninstall"
	//PreScaleUpCluster on master0
	PreScaleUpCluster Phase = "pre-scaleup"
	//PostScaleUpCluster on master0
	PostScaleUpCluster Phase = "post-scaleup"
	//UpgradeCluster on master0
	UpgradeCluster Phase = "upgrade"
	//RollbackCluster on master0
	RollbackCluster Phase = "rollback"

	//PreInitHost on role
	PreInitHost Phase = "pre-init-host"
	//PostInitHost on role
	PostInitHost Phase = "post-init-host"
	//PreCleanHost on role
	PreCleanHost Phase = "pre-clean-host"
	//PostCleanHost on role
	PostCleanHost Phase = "post-clean-host"
	//UpgradeHost on role
	UpgradeHost Phase = "upgrade-host"
)

type RuntimeConfig

type RuntimeConfig struct {
	Distributor            imagedistributor.Distributor
	ContainerRuntimeConfig v2.ContainerRuntimeConfig
	KubeadmConfig          kubeadm.KubeadmConfig
	Plugins                []v1.Plugin
}

RuntimeConfig for Installer

type Scope

type Scope string

Jump to

Keyboard shortcuts

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