plugin

package
v0.0.0-...-600c98c Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name             = "ZonalDistribution"
	ZoneLabel        = "failure-domain.beta.kubernetes.io/zone"
	StatefulSetLabel = "statefulset.kubernetes.io/pod-name"
	VZDKey           = "VZD"
)
View Source
const PageSize = 100

Variables

This section is empty.

Functions

func BuildVolumeZonalDistribution

func BuildVolumeZonalDistribution(
	clientset kubernetes.Interface,
	sts *appsv1.StatefulSet,
) (map[Zone]map[uint]bool, error)

BuildVolumeZonalDistribution finds all PersistentVolumes created by the given StatefulSet and the AvaililityZones they were created in. The resulting data structure can be used to tell if a sts ordinal has volumes in a specific zone. The following would indicate that pod ordinals 0 and 1 both have a PV in zoneA. The pods for ordinals 0 and 1 may or may not exist.

map{
	  "zoneA": map{0: true, 1: true}
}

func ForAllPeristentVolumes

func ForAllPeristentVolumes(
	iface typedCoreV1.PersistentVolumeInterface,
	cb func(pv *corev1.PersistentVolume) error,
) error

ForAllPersistentVolumes runs cb on the paginated list of PVs, returning early in the case of an error.

func New

func New(configuration *runtime.Unknown, f framework.FrameworkHandle) (framework.Plugin, error)

func PodOrdinal

func PodOrdinal(name string) int

Types

type Node

type Node struct {
	Name string
	Zone Zone
}

func Nodes

func Nodes(infoMap map[string]*nodeinfo.NodeInfo) []Node

type ZonalDistributionPlugin

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

func (*ZonalDistributionPlugin) Filter

func (*ZonalDistributionPlugin) Name

func (p *ZonalDistributionPlugin) Name() string

func (*ZonalDistributionPlugin) PreFilter

type ZonalTopology

type ZonalTopology []Zone

func BuildZonalTopology

func BuildZonalTopology(nodes []Node, vzd map[Zone]map[uint]bool) ZonalTopology

BuildZonalTopology takes an existing distribution of a statefulset across nodes and zones and determines the ordinal to zone mapping. It defaults to alphabetical. For example an empty 3 node 3 zone cluster will return []{A, B, C}. Pod ordinals % 3 should be scheduled into the zone at that given index IE []{A, B, C}[0 % 3] == A, []{A, B, C}[1 % 3] == B It does it's best to determine what the order should be for existing distribution by "correcting" the alphabetical distribution.

func (ZonalTopology) IdealZone

func (n ZonalTopology) IdealZone(ordinal uint) Zone

type Zone

type Zone = string

Jump to

Keyboard shortcuts

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