strategy

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MasterNodeLabelKey = "node-role.kubernetes.io/master"
	NodeRoleLabelKey   = "kubernetes.io/role"

	SchedulerTolerationAnnotation = "scheduler.alpha.kubernetes.io/tolerations"
)
View Source
const (
	MasterlessTaintKey = "CriticalAddonsOnly"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MasterlessTurndownStrategy

type MasterlessTurndownStrategy struct {
	// contains filtered or unexported fields
}

MasterlessTurndownStrategy is a TurndownStrategy implementation used in managed kubernetes where the master control plane is not available as a node to the cluster. When the turndown schedule occurs, a new node pool with a single "small" node is created. Taints are added to this node to only allow specific pods to be scheduled there. We update the turndown deployment such that the turndown pod is allowed to schedule on the singleton node. Once the pod is moved to the new node, it will start back up and resume scaledown. This is done by cordoning all nodes in the cluster (other than our new small node), and then reducing the node pool sizes to 0.

func (*MasterlessTurndownStrategy) CreateOrGetHostNode

func (ktdm *MasterlessTurndownStrategy) CreateOrGetHostNode() (*v1.Node, error)

This method will locate or create a node, apply a specific taint and label, and return the updated kubernetes Node instance.

func (*MasterlessTurndownStrategy) IsReversible

func (mts *MasterlessTurndownStrategy) IsReversible() bool

Masterless strategy is currrently non-reversible. Need to determine whether there is value in reprovisioning every turndown and deleting on scale up.

func (*MasterlessTurndownStrategy) ReverseHostNode

func (mts *MasterlessTurndownStrategy) ReverseHostNode() error

func (*MasterlessTurndownStrategy) TaintKey

func (mts *MasterlessTurndownStrategy) TaintKey() string

func (*MasterlessTurndownStrategy) UpdateDNS

func (mts *MasterlessTurndownStrategy) UpdateDNS() error

type StandardTurndownStrategy

type StandardTurndownStrategy struct {
	// contains filtered or unexported fields
}

func (*StandardTurndownStrategy) CreateOrGetHostNode

func (ktdm *StandardTurndownStrategy) CreateOrGetHostNode() (*v1.Node, error)

This method will locate or create a node, apply a specific taint and label, and return the updated kubernetes Node instance.

func (*StandardTurndownStrategy) IsReversible

func (mts *StandardTurndownStrategy) IsReversible() bool

On scale up, reverse master node labels and turndown deployment selector

func (*StandardTurndownStrategy) ReverseHostNode

func (sts *StandardTurndownStrategy) ReverseHostNode() error

func (*StandardTurndownStrategy) TaintKey

func (mts *StandardTurndownStrategy) TaintKey() string

func (*StandardTurndownStrategy) UpdateDNS

func (sts *StandardTurndownStrategy) UpdateDNS() error

type TurndownStrategy

type TurndownStrategy interface {
	// TaintKey returns the key used to taint the target host node.
	TaintKey() string

	// CreateOrGetHostNode either create a new node or gets an existing node containing a turndown
	// label specific to our turndown deployment.
	CreateOrGetHostNode() (*v1.Node, error)

	// UpdateDNS will make adjustments to dns (if necessary) to allow the turndown deployment to continue
	// to use dns names for communication.
	UpdateDNS() error

	// IsReversible returns a bool set to true if the target host node updates can be reversed on scale up.
	IsReversible() bool

	// ReverseHostNode will back out of any annotation or labeling applied by the strategy.
	ReverseHostNode() error
}

Turndown Strategy to use for environment preparation

func NewMasterlessTurndownStrategy

func NewMasterlessTurndownStrategy(client kubernetes.Interface, provider provider.TurndownProvider, npLabels map[string]string) TurndownStrategy

Creates a new MasterlessTurndownStrategy instance

func NewStandardTurndownStrategy

func NewStandardTurndownStrategy(client kubernetes.Interface, provider provider.TurndownProvider) TurndownStrategy

Jump to

Keyboard shortcuts

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