update

package
v0.0.0-...-0755659 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2019 License: Apache-2.0 Imports: 59 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 ExecutePhase

func ExecutePhase(ctx context.Context, config FSMConfig, params fsm.Params, skipVersionCheck bool) error

ExecutePhase executes the specified phase

func GetOperationPlan

func GetOperationPlan(b storage.Backend) (*storage.OperationPlan, error)

GetOperationPlan returns an up-to-date operation plan

func InitOperationPlan

func InitOperationPlan(
	ctx context.Context,
	updateEnv *localenv.LocalEnvironment,
	clusterEnv *localenv.ClusterEnvironment) (*storage.OperationPlan, error)

InitOperationPlan will initialize operation plan for an operation

func NewFSM

func NewFSM(ctx context.Context, c FSMConfig) (*fsm.FSM, error)

NewFSM returns a new FSM instance

func NewGarbageCollectPhase

func NewGarbageCollectPhase(plan storage.OperationPlan, phase storage.OperationPhase, remote fsm.Remote) (*phaseGC, error)

NewGarbageCollectPhase returns a new executor for the garbage collection phase

func NewOperationPlan

NewOperationPlan generates a new plan for the provided operation

func NewPhaseCoreDNS

func NewPhaseCoreDNS(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*updatePhaseCoreDNS, 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(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*phaseDrain, error)

NewPhaseDrain returns a new executor for draining a node

func NewPhaseElectionChange

func NewPhaseElectionChange(
	plan storage.OperationPlan,
	phase storage.OperationPhase,
	remote fsm.Remote,
	operator ops.Operator,
) (*phaseElectionChange, error)

NewPhaseElectionChange is a phase for modifying cluster elections during upgrades

func NewPhaseEndpoints

func NewPhaseEndpoints(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*phaseEndpoints, error)

NewPhaseEndpoints returns a new executor for waiting for endpoints

func NewPhaseKubeletPermissions

func NewPhaseKubeletPermissions(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*phaseKubeletPermissions, error)

NewPhaseKubeletPermissions returns a new executor for bootstrapping additional kubelet permissions

func NewPhaseMigrateLinks(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*phaseMigrateLinks, error)

NewPhaseMigrateLinks returns a new links migration executor

func NewPhaseMigrateRoles

func NewPhaseMigrateRoles(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*phaseMigrateRoles, error)

NewPhaseMigrateRoles returns a new roles migration executor

func NewPhaseTaint

func NewPhaseTaint(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*phaseTaint, error)

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

func NewPhaseUncordon

func NewPhaseUncordon(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*phaseUncordon, error)

NewPhaseUncordon returns a new executor for uncordoning a node

func NewPhaseUntaint

func NewPhaseUntaint(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*phaseUntaint, error)

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

func NewPhaseUpdateLabels

func NewPhaseUpdateLabels(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*phaseUpdateLabels, error)

NewPhaseUpdateLabels updates labels during an upgrade

func NewPhaseUpgradeEtcdBackup

func NewPhaseUpgradeEtcdBackup(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (fsm.PhaseExecutor, error)

func NewPhaseUpgradeEtcdRestart

func NewPhaseUpgradeEtcdRestart(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (fsm.PhaseExecutor, error)

func NewPhaseUpgradeEtcdRestore

func NewPhaseUpgradeEtcdRestore(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (fsm.PhaseExecutor, error)

func NewPhaseUpgradeEtcdShutdown

func NewPhaseUpgradeEtcdShutdown(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (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(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (fsm.PhaseExecutor, error)

func NewUpdateEngine

func NewUpdateEngine(c FSMConfig) (*fsmUpdateEngine, error)

NewUpdateEngine returns a new FSM instance

func NewUpdatePhaseApp

func NewUpdatePhaseApp(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*updatePhaseApp, error)

NewUpdatePhaseApp returns a new app phase executor

func NewUpdatePhaseBeforeApp

func NewUpdatePhaseBeforeApp(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*updatePhaseBeforeApp, error)

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

func NewUpdatePhaseBootstrap

func NewUpdatePhaseBootstrap(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase, remote fsm.Remote) (fsm.PhaseExecutor, error)

NewUpdatePhaseBootstrap creates a new bootstrap phase executor

func NewUpdatePhaseChecks

func NewUpdatePhaseChecks(
	c FSMConfig,
	plan storage.OperationPlan,
	phase storage.OperationPhase,
	remote fsm.AgentRepository,
) (*updatePhaseChecks, error)

NewUpdatePhaseChecks creates a new preflight checks phase executor

func NewUpdatePhaseConfig

func NewUpdatePhaseConfig(c FSMConfig, p fsm.ExecutorParams, remote fsm.Remote) (*updatePhaseConfig, error)

NewUpdatePhaseConfig returns executor that pulls local configuration packages

func NewUpdatePhaseInit

func NewUpdatePhaseInit(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase) (*updatePhaseInit, error)

NewUpdatePhaseInit creates a new update init phase executor

func NewUpdatePhaseSystem

func NewUpdatePhaseSystem(c FSMConfig, plan storage.OperationPlan, phase storage.OperationPhase, remote fsm.Remote) (*updatePhaseSystem, error)

NewUpdatePhaseNode returns a new node update phase executor

func RollbackPhase

func RollbackPhase(ctx context.Context, config FSMConfig, params fsm.Params, skipVersionCheck bool) error

RollbackPhase rolls back the specified phase, allows fallback to recovery fsm in case etcd is down

func ShutdownClusterAgents

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

ShutdownClusterAgents fetches all nodes in a cluster and submits a shutdown request

func SyncOperationPlan

func SyncOperationPlan(src storage.Backend, dst storage.Backend) error

SyncOperationPlan will synchronize the operation plan from source backend to the destination

func SyncOperationPlanToCluster

func SyncOperationPlanToCluster(ctx context.Context, plan storage.OperationPlan, clientCreds credentials.TransportCredentials) error

SyncOperationPlanToCluster runs gravity plan --sync on each cluster member, to force syncronization from etcd to the local store

Types

type FSMConfig

type FSMConfig struct {
	// Backend is the cluster etcd backend
	Backend storage.Backend
	// LocalBackend is used as a redundant local storage for cases when etcd goes down
	LocalBackend storage.Backend
	// HostLocalBackend is the host-local backend that stores bootstrap configuration
	// like DNS, logins etc.
	HostLocalBackend storage.Backend
	// 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 pack.PackageService
	// Apps is the cluster apps service
	Apps app.Applications
	// Client is the cluster Kubernetes client
	Client *kubernetes.Clientset
	// Operator is the local cluster operator
	Operator ops.Operator
	// 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
	// Remote allows to create RPC clients
	Remote fsm.AgentRepository
}

FSMConfig is the fsm configuration

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
}

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
}

PhaseUpgradeRestore 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