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

Documentation

Index

Constants

View Source
const (
	// CoreDNSResourceName defines the name common for coredns resources
	CoreDNSResourceName = "gravity:coredns"
)

Variables

This section is empty.

Functions

func NeedMigrateRoles

func NeedMigrateRoles(roles []teleservices.Role) bool

NeedMigrateRoles returns true if the provided cluster roles need to be migrated to a new format

func NewGarbageCollectPhase

func NewGarbageCollectPhase(p fsm.ExecutorParams, remote fsm.Remote, logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewGarbageCollectPhase returns a new executor for the garbage collection phase

func NewPhaseCoreDNS

func NewPhaseCoreDNS(p fsm.ExecutorParams, operator ops.Operator, client *kubernetes.Clientset, logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewPhaseCoreDNS creates an upgrade phase to add coredns rbac permissions The normal upgrade sequence is to Rolling update planet, then to update our RBAC settings in the RBAC app However, CoreDNS within planet needs these settings to function, so these settings specifically need to be created before the rolling restart of planet

func NewPhaseDrain

func NewPhaseDrain(p fsm.ExecutorParams, client *kubeapi.Clientset, logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewPhaseDrain returns a new executor for draining a node

func NewPhaseElectionChange

func NewPhaseElectionChange(
	p fsm.ExecutorParams,
	operator ops.Operator,
	remote fsm.Remote,
	logger logrus.FieldLogger,
) (fsm.PhaseExecutor, error)

NewPhaseElectionChange is a phase for modifying cluster elections during upgrades

func NewPhaseEndpoints

func NewPhaseEndpoints(p fsm.ExecutorParams, client *kubeapi.Clientset, logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewPhaseEndpoints returns a new executor for waiting for endpoints

func NewPhaseKubeletPermissions

func NewPhaseKubeletPermissions(p fsm.ExecutorParams, client *kubeapi.Clientset, logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewPhaseKubeletPermissions returns a new executor for bootstrapping additional kubelet permissions

func NewPhaseMigrateLinks(plan storage.OperationPlan, backend storage.Backend, logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewPhaseMigrateLinks returns a new links migration executor

func NewPhaseMigrateRoles

func NewPhaseMigrateRoles(plan storage.OperationPlan, backend storage.Backend, logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewPhaseMigrateRoles returns a new roles migration executor

func NewPhaseNodeHealth

func NewPhaseNodeHealth(logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewPhaseNodeHealth creates an upgrade phase to check whether the node is healthy

func NewPhaseTaint

func NewPhaseTaint(p fsm.ExecutorParams, client *kubeapi.Clientset, logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewPhaseTaint returns a new executor for adding a taint to a node

func NewPhaseUncordon

func NewPhaseUncordon(p fsm.ExecutorParams, client *kubeapi.Clientset, logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewPhaseUncordon returns a new executor for uncordoning a node

func NewPhaseUntaint

func NewPhaseUntaint(p fsm.ExecutorParams, client *kubeapi.Clientset, logger log.FieldLogger) (fsm.PhaseExecutor, error)

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

func NewPhaseUpdateLabels

func NewPhaseUpdateLabels(plan storage.OperationPlan, client *kubernetes.Clientset, logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewPhaseUpdateLabels updates labels during an upgrade

func NewPhaseUpgradeEtcd

func NewPhaseUpgradeEtcd(phase storage.OperationPhase, logger log.FieldLogger) (fsm.PhaseExecutor, error)

func NewPhaseUpgradeEtcdBackup

func NewPhaseUpgradeEtcdBackup(logger log.FieldLogger) (fsm.PhaseExecutor, error)

func NewPhaseUpgradeEtcdRestart

func NewPhaseUpgradeEtcdRestart(phase storage.OperationPhase, logger log.FieldLogger) (fsm.PhaseExecutor, error)

func NewPhaseUpgradeEtcdRestore

func NewPhaseUpgradeEtcdRestore(phase storage.OperationPhase, logger log.FieldLogger) (fsm.PhaseExecutor, error)

func NewPhaseUpgradeEtcdShutdown

func NewPhaseUpgradeEtcdShutdown(phase storage.OperationPhase, client *kubeapi.Clientset, logger log.FieldLogger) (fsm.PhaseExecutor, error)

NewPhaseUpgradeEtcdShutdown creates a phase for shutting down etcd across the cluster 4. Shutdown etcd (all servers) // API outage starts

func NewPhaseUpgradeGravitySiteRestart

func NewPhaseUpgradeGravitySiteRestart(phase storage.OperationPhase, client *kubeapi.Clientset, logger log.FieldLogger) (fsm.PhaseExecutor, error)

func NewUpdatePhaseApp

func NewUpdatePhaseApp(
	p fsm.ExecutorParams,
	operator ops.Operator,
	apps app.Applications,
	client *kubernetes.Clientset,
	logger log.FieldLogger,
) (fsm.PhaseExecutor, error)

NewUpdatePhaseApp returns a new app phase executor

func NewUpdatePhaseBeforeApp

func NewUpdatePhaseBeforeApp(
	p fsm.ExecutorParams,
	apps app.Applications,
	client *kubernetes.Clientset,
	logger log.FieldLogger,
) (fsm.PhaseExecutor, error)

NewUpdatePhaseBeforeApp returns a new executor for running application pre-update hook

func NewUpdatePhaseBootstrap

func NewUpdatePhaseBootstrap(
	p fsm.ExecutorParams,
	operator ops.Operator,
	backend, localBackend storage.Backend, hostLocalBackend storage.LocalBackend,
	localPackages, packages pack.PackageService,
	remote fsm.Remote,
	logger log.FieldLogger,
) (fsm.PhaseExecutor, error)

NewUpdatePhaseBootstrap creates a new bootstrap phase executor

func NewUpdatePhaseChecks

func NewUpdatePhaseChecks(
	p fsm.ExecutorParams,
	operator ops.Operator,
	apps app.Applications,
	remote rpc.AgentRepository,
	logger log.FieldLogger,
) (fsm.PhaseExecutor, error)

NewUpdatePhaseChecks creates a new preflight checks phase executor

func NewUpdatePhaseConfig

func NewUpdatePhaseConfig(
	p fsm.ExecutorParams,
	operator ops.Operator,
	packages pack.PackageService,
	localPackages pack.PackageService,
	remote fsm.Remote,
	logger log.FieldLogger,
) (fsm.PhaseExecutor, error)

NewUpdatePhaseConfig returns executor that pulls local configuration packages

func NewUpdatePhaseInit

func NewUpdatePhaseInit(
	p fsm.ExecutorParams,
	operator ops.Operator,
	apps app.Applications,
	backend, localBackend storage.Backend,
	packages pack.PackageService,
	users users.Identity,
	client *kubernetes.Clientset,
	logger log.FieldLogger,
) (fsm.PhaseExecutor, error)

NewUpdatePhaseInit creates a new update init phase executor

func NewUpdatePhaseSELinux

func NewUpdatePhaseSELinux(
	p fsm.ExecutorParams,
	operator ops.Operator,
	apps app.Applications,
	logger log.FieldLogger,
) (fsm.PhaseExecutor, error)

NewUpdatePhaseSELinux creates a new phase to configure SELinux on a node

func NewUpdatePhaseSystem

func NewUpdatePhaseSystem(
	p fsm.ExecutorParams,
	remote fsm.Remote,
	backend storage.Backend,
	packages pack.PackageService,
	localPackages update.LocalPackageService,
	logger log.FieldLogger,
) (fsm.PhaseExecutor, error)

NewUpdatePhaseSystem returns a new node update phase executor

Types

type PhaseUpgradeEtcd

type PhaseUpgradeEtcd struct {
	log.FieldLogger
	Server storage.Server
}

PhaseUpgradeEtcd upgrades etcd specifically on the leader

func (*PhaseUpgradeEtcd) Execute

func (p *PhaseUpgradeEtcd) Execute(ctx context.Context) error

Execute upgrades the leader Upgrade etcd by changing the launch version and data directory Launch the temporary etcd cluster to restore the database

func (*PhaseUpgradeEtcd) PostCheck

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

func (*PhaseUpgradeEtcd) PreCheck

func (*PhaseUpgradeEtcd) Rollback

func (p *PhaseUpgradeEtcd) Rollback(ctx context.Context) error

type PhaseUpgradeEtcdBackup

type PhaseUpgradeEtcdBackup struct {
	log.FieldLogger
}

PhaseUpgradeEtcdBackup backs up etcd data on all servers

func (*PhaseUpgradeEtcdBackup) Execute

func (p *PhaseUpgradeEtcdBackup) Execute(ctx context.Context) error

func (*PhaseUpgradeEtcdBackup) PostCheck

func (*PhaseUpgradeEtcdBackup) PreCheck

func (*PhaseUpgradeEtcdBackup) Rollback

type PhaseUpgradeEtcdRestart

type PhaseUpgradeEtcdRestart struct {
	log.FieldLogger
	Server storage.Server
	Master storage.Server
}

PhaseUpgradeEtcdRestart disables the etcd-upgrade service, and starts the etcd service

func (*PhaseUpgradeEtcdRestart) Execute

func (p *PhaseUpgradeEtcdRestart) Execute(ctx context.Context) error

func (*PhaseUpgradeEtcdRestart) PostCheck

func (*PhaseUpgradeEtcdRestart) PreCheck

func (*PhaseUpgradeEtcdRestart) Rollback

func (p *PhaseUpgradeEtcdRestart) Rollback(ctx context.Context) error

type PhaseUpgradeEtcdRestore

type PhaseUpgradeEtcdRestore struct {
	log.FieldLogger
	Server storage.Server
}

PhaseUpgradeEtcdRestore restores etcd data from backup, if it was wiped by the upgrade stage

func (*PhaseUpgradeEtcdRestore) Execute

func (p *PhaseUpgradeEtcdRestore) Execute(ctx context.Context) error

Execute restores the etcd data from backup 7. Restore the /registry (kubernetes) data to etcd, including automatic migration to v3 datastore for kubernetes 10. Restart etcd on the correct ports on first node // API outage ends

func (*PhaseUpgradeEtcdRestore) PostCheck

func (*PhaseUpgradeEtcdRestore) PreCheck

func (p *PhaseUpgradeEtcdRestore) PreCheck(ctx context.Context) error

func (*PhaseUpgradeEtcdRestore) Rollback

func (p *PhaseUpgradeEtcdRestore) Rollback(ctx context.Context) error

type PhaseUpgradeEtcdShutdown

type PhaseUpgradeEtcdShutdown struct {
	log.FieldLogger
	Client *kubeapi.Clientset
	// contains filtered or unexported fields
}

PhaseUpgradeEtcdShutdown shuts down etcd across the cluster

func (*PhaseUpgradeEtcdShutdown) Execute

func (*PhaseUpgradeEtcdShutdown) PostCheck

func (*PhaseUpgradeEtcdShutdown) PreCheck

func (p *PhaseUpgradeEtcdShutdown) PreCheck(ctx context.Context) error

func (*PhaseUpgradeEtcdShutdown) Rollback

func (p *PhaseUpgradeEtcdShutdown) Rollback(ctx context.Context) error

type PhaseUpgradeGravitySiteRestart

type PhaseUpgradeGravitySiteRestart struct {
	log.FieldLogger
	Client *kubeapi.Clientset
}

PhaseUpgradeGravitySiteRestart restarts gravity-site pod

func (*PhaseUpgradeGravitySiteRestart) Execute

func (*PhaseUpgradeGravitySiteRestart) PostCheck

func (*PhaseUpgradeGravitySiteRestart) PreCheck

func (*PhaseUpgradeGravitySiteRestart) Rollback

Jump to

Keyboard shortcuts

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