cluster

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutomaticUpgrade

func AutomaticUpgrade(ctx context.Context, localEnv, updateEnv *localenv.LocalEnvironment) (err error)

AutomaticUpgrade starts automatic upgrade process

func InitOperationPlan

func InitOperationPlan(
	ctx context.Context,
	localEnv, updateEnv *localenv.LocalEnvironment,
	clusterEnv *localenv.ClusterEnvironment,
	opKey ops.SiteOperationKey,
	leader *storage.Server,
	userConfig UserConfig,
) (*storage.OperationPlan, error)

InitOperationPlan will initialize operation plan for an operation

func New

func New(ctx context.Context, config Config) (*update.Updater, error)

New returns new updater for the specified configuration

func NewOperationPlan

func NewOperationPlan(config PlanConfig) (*storage.OperationPlan, error)

NewOperationPlan generates a new plan for the provided operation

func NumParallel

func NumParallel() int

NumParallel sets number of parallel phases we should run that scales based on the number of the CPU cores on the node generating the plan

func ShutdownClusterAgents

func ShutdownClusterAgents(ctx context.Context, remote rpc.AgentRepository) error

ShutdownClusterAgents submits a shutdown request to all agents

Types

type Config

type Config struct {
	update.Config
	// HostLocalBackend is the host-local backend that stores bootstrap configuration
	// like DNS, logins etc.
	HostLocalBackend storage.LocalBackend
	// Packages is the local package service
	Packages pack.PackageService
	// ClusterPackages is the package service that talks to cluster API
	ClusterPackages pack.PackageService
	// HostLocalPackages is the host-local package service that contains package
	// metadata used for updates
	HostLocalPackages update.LocalPackageService
	// Apps is the cluster apps service
	Apps app.Applications
	// Client is the cluster Kubernetes client
	Client *kubernetes.Clientset
	// Users is the cluster identity service
	Users users.Identity
	// Spec is used to retrieve a phase executor, allows
	// plugging different phase executors during tests
	Spec fsm.FSMSpecFunc
}

Config is the FSM configuration

type PlanConfig

type PlanConfig struct {
	Backend    storage.Backend
	Packages   pack.PackageService
	Apps       app.Applications
	DNSConfig  storage.DNSConfig
	Operator   ops.Operator
	Operation  *storage.SiteOperation
	Client     *kubernetes.Clientset
	Leader     *storage.Server
	UserConfig UserConfig
}

PlanConfig defines the configuration for creating a new operation plan

type UserConfig

type UserConfig struct {
	ParallelWorkers int
	SkipWorkers     bool
}

UserConfig holds configuration parameters provided by the user triggering the update operation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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