kubernetesupgrade

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: MIT Imports: 21 Imported by: 14

Documentation

Overview

Package kubernetesupgrade allows upgrading of Kubernetes clusters.

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.

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 AgentPoolScaleSet

type AgentPoolScaleSet struct {
	Name         string
	Sku          compute.Sku
	Location     string
	VMsToUpgrade []AgentPoolScaleSetVM
}

AgentPoolScaleSet contains necessary data required to upgrade a VMSS

type AgentPoolScaleSetVM

type AgentPoolScaleSetVM struct {
	Name       string
	InstanceID string
}

AgentPoolScaleSetVM represents a VM in a VMSS

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

	AgentPoolScaleSetsToUpgrade []AgentPoolScaleSet

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

ClusterTopology contains resources of the cluster the upgrade operation is targeting

type Kubernetes16upgrader

type Kubernetes16upgrader struct {
	Upgrader
}

Kubernetes16upgrader upgrades a Kubernetes 1.5 cluster to 1.6

type Kubernetes17upgrader

type Kubernetes17upgrader struct {
	Upgrader
}

Kubernetes17upgrader upgrades a Kubernetes 1.6 cluster to 1.7

type Kubernetes18upgrader

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.AKSEngineClient
	// contains filtered or unexported fields
}

UpgradeAgentNode upgrades a Kubernetes 1.5 agent node to 1.6

func (*UpgradeAgentNode) CreateNode

func (kan *UpgradeAgentNode) CreateNode(ctx context.Context, 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.AKSEngineClient
	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, az armhelpers.AKSEngineClient, 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.AKSEngineClient
	// contains filtered or unexported fields
}

UpgradeMasterNode upgrades a Kubernetes 1.5 master node to 1.6

func (*UpgradeMasterNode) CreateNode

func (kmn *UpgradeMasterNode) CreateNode(ctx context.Context, 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(context.Context, 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

type Upgrader struct {
	Translator *i18n.Translator

	ClusterTopology
	Client armhelpers.AKSEngineClient

	AKSEngineVersion string
	// contains filtered or unexported fields
}

Upgrader holds information on upgrading an AKS cluster

func (*Upgrader) Init

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

Init initializes an upgrader struct

func (*Upgrader) RunUpgrade

func (ku *Upgrader) RunUpgrade() error

RunUpgrade runs the upgrade pipeline

func (*Upgrader) Validate

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