rollingupdate

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: 16 Imported by: 0

Documentation

Overview

This file implements a rolling update FSM

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMachine

func NewMachine(ctx context.Context, config Config) (*fsm.FSM, error)

NewMachine creates an operation FSM that implements a rolling update strategy

func RuntimeConfigUpdates

func RuntimeConfigUpdates(
	manifest schema.Manifest,
	operator ConfigPackageRotator,
	operationKey ops.SiteOperationKey,
	servers []storage.Server,
) (updates []storage.UpdateServer, err error)

RuntimeConfigUpdates computes the runtime configuration updates for the specified list of servers

func RuntimeConfigUpdatesWithSecrets

func RuntimeConfigUpdatesWithSecrets(
	manifest schema.Manifest,
	operator ConfigPackageRotator,
	operationKey ops.SiteOperationKey,
	servers []storage.Server,
) (updates []storage.UpdateServer, err error)

RuntimeConfigUpdatesWithSecrets computes the runtime configuration updates for the specified list of servers. The result includes updates for the secrets packages.

Types

type Builder

type Builder struct {
	// App specifies the cluster application
	App loc.Locator
	// CustomUpdate optionally specifies the custom phase
	CustomUpdate *storage.OperationPhase
}

Builder builds an operation plan

func (Builder) Config

func (r Builder) Config(rootText string, servers []storage.UpdateServer) *builder.Phase

Config creates a new phase to update runtime container configuration

func (Builder) Masters

func (r Builder) Masters(servers []storage.UpdateServer, rootText, nodeTextFormat string) *builder.Phase

Masters returns a new phase to execute a rolling update of the specified list of master servers

func (Builder) Nodes

func (r Builder) Nodes(servers []storage.UpdateServer, master storage.Server, rootText, nodeTextFormat string) *builder.Phase

Nodes returns a new phase to execute a rolling update of the specified list of regular servers

type Config

type Config struct {
	update.Config
	// Dispatcher specifies optional phase dispatcher.
	// If unspecified, default dispatcher is used.
	//
	// Implementations that reimplement certain steps or implement new steps
	// can set this field and use an instance of the default dispatcher as a fallback
	Dispatcher
	// HostLocalPackages specifies the package service on local host
	HostLocalPackages update.LocalPackageService
	// Apps is the cluster application service
	Apps app.Applications
	// ClusterPackages specifies the cluster package service
	ClusterPackages pack.PackageService
	// Client specifies the optional kubernetes client
	Client *kubernetes.Clientset
}

Config describes configuration for executing a rolling update operation

type ConfigPackageRotator

type ConfigPackageRotator interface {
	RotatePlanetConfig(ops.RotatePlanetConfigRequest) (*ops.RotatePackageResponse, error)
	RotateSecrets(ops.RotateSecretsRequest) (*ops.RotatePackageResponse, error)
}

ConfigPackageRotator defines the subset of Operator for updating package configuration

type Dispatcher

type Dispatcher interface {
	// Dispatch returns an executor for the given parameters and the specified remote
	Dispatch(Config, fsm.ExecutorParams, fsm.Remote, log.FieldLogger) (fsm.PhaseExecutor, error)
}

Dispatcher routes the set of execution parameters to a specific operation phase

func NewDefaultDispatcher

func NewDefaultDispatcher() Dispatcher

NewDefaultDispatcher returns a new instance of the default phase dispatcher

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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