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

Documentation

Index

Constants

View Source
const (
	// InitPhase identifies the initialization phase that resets services
	// back to their original values on rollback
	InitPhase = "init"
	// FiniPhase identifies the finalization phase that commits
	// changes after a successful operation
	FiniPhase = "fini"
)

Variables

This section is empty.

Functions

func NewRestart

func NewRestart(
	params libfsm.ExecutorParams,
	operator libbasephase.LocalClusterGetter,
	operation ops.SiteOperation,
	apps appGetter,
	backend storage.Backend,
	packages pack.PackageService,
	localPackages update.LocalPackageService,
	logger log.FieldLogger,
) (libfsm.PhaseExecutor, error)

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

func NewUpdateConfig

func NewUpdateConfig(
	params libfsm.ExecutorParams,
	operator operator,
	operation ops.SiteOperation,
	apps appGetter,
	packages, hostPackages packageService,
	logger log.FieldLogger,
) (libfsm.PhaseExecutor, error)

NewUpdateConfig returns a new executor to update runtime configuration on the specified node

Types

type Final

type Final struct {
	log.FieldLogger
	// contains filtered or unexported fields
}

Final implements the last step for the cluster configuration update operation. On the happy path, it will remove the temporary DNS services. During rollback, it removes the active DNS services which will be recreated by the planet agent service after the container reverts to the previous configuration

func NewFinal

func NewFinal(params fsm.ExecutorParams, client corev1.CoreV1Interface, logger log.FieldLogger) (*Final, error)

NewFinal returns a new instance of the last configuration step

func (*Final) Execute

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

Execute renames the new DNS services so they persist and removes the old services

func (*Final) PostCheck

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

PostCheck is no-op for this phase

func (*Final) PreCheck

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

PreCheck is no-op for this phase

func (*Final) Rollback

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

Rollback is a no-op for this phase

type Init

type Init struct {
	log.FieldLogger
	// contains filtered or unexported fields
}

Init implements the init step for the cluster configuration upgrade operation

func NewInit

func NewInit(params fsm.ExecutorParams, client corev1.CoreV1Interface, logger log.FieldLogger) (*Init, error)

NewInit returns a new init step implementation

func (*Init) Execute

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

Execute renames the existing DNS services to keep them available for nodes that have not been upgraded to the new service subnet so the Pods scheduled on these nodes can still resolve cluster addresses using the old DNS service

func (*Init) PostCheck

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

PostCheck is no-op for this phase

func (*Init) PreCheck

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

PreCheck is no-op for this phase

func (*Init) Rollback

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

Rollback resets the services to their original values

type Services

type Services struct {
	log.FieldLogger
	// contains filtered or unexported fields
}

Services implements the services step for the cluster configuration upgrade operation. On the happy path, its job is to recreate the services of type clusterIP with the address from the new service CIDR. During rollback, it will remove the temporary DNS services created as part of the configuration update

func NewServices

func NewServices(params fsm.ExecutorParams, client corev1.CoreV1Interface, logger log.FieldLogger) (*Services, error)

NewServices returns a new services step implementation

func (*Services) Execute

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

Execute resets the clusterIP for all the cluster services of type ClusterIP except services it does not need to handle/manage (eg kubernetes api server service and DNS/headless services)

func (*Services) PostCheck

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

PostCheck is no-op for this phase

func (*Services) PreCheck

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

PreCheck is no-op for this phase

func (*Services) Rollback

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

Rollback removes the temporary DNS services created in the new service subnet

Jump to

Keyboard shortcuts

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