clusterruntime

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtraOptionSkipWhenWorkspaceNotExists = "SkipWhenWorkspaceNotExists"
)

Variables

This section is empty.

Functions

func GetAppLaunchCmdsByNames

func GetAppLaunchCmdsByNames(appNames []string, apps []version.VersionedApplication) []string

func GetImageDefaultLaunchCmds

func GetImageDefaultLaunchCmds(extension v12.ImageExtension) []string

func LoadPluginsFromFile

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

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

func Register

func Register(name HookType, factory HookFunc)

Register different hook type with its HookFunc to hookFactories

Types

type AppInstaller

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

func NewAppInstaller

func NewAppInstaller(infraDriver infradriver.InfraDriver, distributor imagedistributor.Distributor, extension v12.ImageExtension) AppInstaller

func (*AppInstaller) Install

func (i *AppInstaller) Install(master0 net.IP, cmds []string) error

func (AppInstaller) Launch

func (i AppInstaller) Launch(master0 net.IP, launchCmds []string) error

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 Installer

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

func NewInstaller

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

func (*Installer) GetCurrentDriver

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

func (*Installer) Install

func (i *Installer) Install() 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

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"

	//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"
)

type RuntimeConfig

type RuntimeConfig struct {
	ImageEngine            imageengine.Interface
	Distributor            imagedistributor.Distributor
	ContainerRuntimeConfig containerruntime.Config
	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