phases

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

Documentation

Index

Constants

View Source
const (
	// UpdateConfig defines the phase to update runtime configuration package
	UpdateConfig = "update-config"
	// RestartContainer defines the phase to restart runtime container to make the
	// configuration package effective
	RestartContainer = "restart"
	// Elections defines the phase to control election / leadership on
	// a set of nodes
	Elections = "elections"
	// Taint defines the phase to add a taint to a node
	Taint = "taint"
	// Custom defines the phase that runs custom tasks before the node accepts
	// generic workloads during upgrade
	Custom = "custom"
	// Untaint defines the phase to remove the previously added taint from a node
	Untaint = "untaint"
	// Drain defines the phase to drain a node
	Drain = "drain"
	// Uncordon defines the phase to uncordon a node
	Uncordon = "uncordon"
	// Endpoints defines the phase to wait for endpoints on a node to be become active
	Endpoints = "endpoints"
)

Variables

This section is empty.

Functions

func NewDrain

func NewDrain(params libfsm.ExecutorParams, client *kubeapi.Clientset, logger log.FieldLogger) (libfsm.PhaseExecutor, error)

NewDrain returns a new executor for draining a node

func NewElections

func NewElections(params libfsm.ExecutorParams, operator LocalClusterGetter, logger logrus.FieldLogger) (libfsm.PhaseExecutor, error)

NewElections implements the phase to manage election changes in cluster to support failover as the environment variables are updated

func NewEndpoints

func NewEndpoints(params libfsm.ExecutorParams, client *kubeapi.Clientset, logger log.FieldLogger) (libfsm.PhaseExecutor, error)

NewEndpoints returns a new executor for waiting for cluster controller endpoints to become active

func NewTaint

func NewTaint(params libfsm.ExecutorParams, client *kubeapi.Clientset, logger log.FieldLogger) (libfsm.PhaseExecutor, error)

NewTaint returns an executor for adding a taint to a node

func NewUncordon

func NewUncordon(params libfsm.ExecutorParams, client *kubeapi.Clientset, logger log.FieldLogger) (libfsm.PhaseExecutor, error)

NewUncordon returns a new executor for uncordoning a node

func NewUntaint

func NewUntaint(params libfsm.ExecutorParams, client *kubeapi.Clientset, logger log.FieldLogger) (libfsm.PhaseExecutor, error)

NewUntaint returns a new executor for removing a taint from a node

Types

type LocalClusterGetter

type LocalClusterGetter interface {
	// GetLocalSite returns the data record for the local cluster
	GetLocalSite(context.Context) (*ops.Site, error)
}

LocalClusterGetter fetches data on local cluster

type Restart

type Restart struct {
	// FieldLogger specifies the logger for the phase
	log.FieldLogger
	// WaitStatusOnRollback specifies whether the step blocks waiting for healthy status
	// when rolling back
	WaitStatusOnRollback bool
	// contains filtered or unexported fields
}

func NewRestart

func NewRestart(
	params libfsm.ExecutorParams,
	operator LocalClusterGetter,
	operationID string,
	apps appGetter,
	backend storage.Backend,
	packages pack.PackageService,
	localPackages update.LocalPackageService,
	logger log.FieldLogger,
) (*Restart, error)

NewRestart returns a new executor to restart the runtime container to apply the environment variables update

func (*Restart) Execute

func (r *Restart) Execute(ctx context.Context) error

Execute restarts the runtime container with the new configuration package

func (*Restart) PostCheck

func (*Restart) PostCheck(context.Context) error

PostCheck is a no-op

func (*Restart) PreCheck

func (*Restart) PreCheck(context.Context) error

PreCheck is a no-op

func (*Restart) Rollback

func (r *Restart) Rollback(ctx context.Context) error

Rollback reverses the update and restarts the container with the old configuration package

Jump to

Keyboard shortcuts

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