kubernetesupgrade

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2018 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const MasterPoolName = "master"

MasterPoolName pool name

View Source
const MasterVMNamePrefix = "k8s-master-"

MasterVMNamePrefix is the prefix for all master VM names for Kubernetes clusters

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentPoolTopology

type AgentPoolTopology struct {
	Identifier       *string
	Name             *string
	AgentVMs         *[]compute.VirtualMachine
	UpgradedAgentVMs *[]compute.VirtualMachine
}

AgentPoolTopology contains agent VMs in a single pool

type ClusterTopology

type ClusterTopology struct {
	DataModel      *api.ContainerService
	SubscriptionID string
	Location       string
	ResourceGroup  string
	NameSuffix     string

	AgentPoolsToUpgrade map[string]bool
	AgentPools          map[string]*AgentPoolTopology

	MasterVMs         *[]compute.VirtualMachine
	UpgradedMasterVMs *[]compute.VirtualMachine
}

ClusterTopology contains resources of the cluster the upgrade operation is targeting

type Kubernetes16upgrader added in v0.6.0

type Kubernetes16upgrader struct {
	Upgrader
}

Kubernetes16upgrader upgrades a Kubernetes 1.5 cluster to 1.6

type Kubernetes17upgrader added in v0.6.0

type Kubernetes17upgrader struct {
	Upgrader
}

Kubernetes17upgrader upgrades a Kubernetes 1.6 cluster to 1.7

type Kubernetes18upgrader added in v0.9.0

type Kubernetes18upgrader struct {
	Upgrader
}

Kubernetes18upgrader upgrades a Kubernetes 1.7.x cluster to 1.8.x

type UpgradeAgentNode

type UpgradeAgentNode struct {
	Translator *i18n.Translator

	TemplateMap             map[string]interface{}
	ParametersMap           map[string]interface{}
	UpgradeContainerService *api.ContainerService
	SubscriptionID          string
	ResourceGroup           string
	Client                  armhelpers.ACSEngineClient
	// contains filtered or unexported fields
}

UpgradeAgentNode upgrades a Kubernetes 1.5 agent node to 1.6

func (*UpgradeAgentNode) CreateNode

func (kan *UpgradeAgentNode) CreateNode(poolName string, agentNo int) error

CreateNode creates a new master/agent node with the targeted version of Kubernetes

func (*UpgradeAgentNode) DeleteNode

func (kan *UpgradeAgentNode) DeleteNode(vmName *string, drain bool) error

DeleteNode takes state/resources of the master/agent node from ListNodeResources backs up/preserves state as needed by a specific version of Kubernetes and then deletes the node The 'drain' flag is used to invoke 'cordon and drain' flow.

func (*UpgradeAgentNode) Validate

func (kan *UpgradeAgentNode) Validate(vmName *string) error

Validate will verify that agent node has been upgraded as expected.

type UpgradeCluster

type UpgradeCluster struct {
	Translator *i18n.Translator
	Logger     *logrus.Entry
	ClusterTopology
	Client      armhelpers.ACSEngineClient
	StepTimeout *time.Duration
}

UpgradeCluster upgrades a cluster with Orchestrator version X.X to version Y.Y. Right now upgrades are supported for Kubernetes cluster only.

func (*UpgradeCluster) UpgradeCluster

func (uc *UpgradeCluster) UpgradeCluster(subscriptionID uuid.UUID, kubeConfig, resourceGroup string,
	cs *api.ContainerService, nameSuffix string, agentPoolsToUpgrade []string, acsengineVersion string) error

UpgradeCluster runs the workflow to upgrade a Kubernetes cluster.

type UpgradeMasterNode

type UpgradeMasterNode struct {
	Translator *i18n.Translator

	TemplateMap             map[string]interface{}
	ParametersMap           map[string]interface{}
	UpgradeContainerService *api.ContainerService
	SubscriptionID          string
	ResourceGroup           string
	Client                  armhelpers.ACSEngineClient
	// contains filtered or unexported fields
}

UpgradeMasterNode upgrades a Kubernetes 1.5 master node to 1.6

func (*UpgradeMasterNode) CreateNode

func (kmn *UpgradeMasterNode) CreateNode(poolName string, masterNo int) error

CreateNode creates a new master/agent node with the targeted version of Kubernetes

func (*UpgradeMasterNode) DeleteNode

func (kmn *UpgradeMasterNode) DeleteNode(vmName *string, drain bool) error

DeleteNode takes state/resources of the master/agent node from ListNodeResources backs up/preserves state as needed by a specific version of Kubernetes and then deletes the node. The 'drain' flag is not used for deleting master nodes.

func (*UpgradeMasterNode) Validate

func (kmn *UpgradeMasterNode) Validate(vmName *string) error

Validate will verify the that master node has been upgraded as expected.

type UpgradeNode

type UpgradeNode interface {
	// DeleteNode takes state/resources of the master/agent node from ListNodeResources
	// backs up/preserves state as needed by a specific version of Kubernetes and then deletes
	// the node.
	// the second argument is a flag to invoke 'cordon and drain' flow.
	DeleteNode(*string, bool) error

	// CreateNode creates a new master/agent node with the targeted version of Kubernetes
	CreateNode(string, int) error

	// Validate will verify the that master/agent node has been upgraded as expected.
	Validate(*string) error
}

UpgradeNode drives work flow of deleting and replacing a master or agent node to a specified target version of Kubernetes

type UpgradeWorkFlow

type UpgradeWorkFlow interface {
	// upgrade masters
	// upgrade agent nodes
	RunUpgrade() error

	Validate() error
}

UpgradeWorkFlow outlines various individual high level steps that need to be run (one or more times) in the upgrade workflow.

type Upgrader added in v0.6.0

type Upgrader struct {
	Translator *i18n.Translator

	ClusterTopology
	Client armhelpers.ACSEngineClient

	ACSEngineVersion string
	// contains filtered or unexported fields
}

Upgrader holds information on upgrading an ACS cluster

func (*Upgrader) Init added in v0.6.0

func (ku *Upgrader) Init(translator *i18n.Translator, logger *logrus.Entry, clusterTopology ClusterTopology, client armhelpers.ACSEngineClient, kubeConfig string, stepTimeout *time.Duration, acsEngineVersion string)

Init initializes an upgrader struct

func (*Upgrader) RunUpgrade added in v0.6.0

func (ku *Upgrader) RunUpgrade() error

RunUpgrade runs the upgrade pipeline

func (*Upgrader) Validate added in v0.6.0

func (ku *Upgrader) Validate() error

Validate will run validation post upgrade

Jump to

Keyboard shortcuts

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