zone

package
v0.0.0-...-778623d Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromSourceRegionZone

func FromSourceRegionZone(ctx context.Context, m Mapper, kubeCli kubernetes.Interface, sourceRegion string, sourceZones ...string) ([]string, error)

FromSourceRegionZone gets the zones from the given region and sourceZones It will return a minimum of 1 and a maximum of zones equal to the length of sourceZones If no zones are found it will return an error. Depending on the length of the slice returned, the blockstorage providers will decide if a regional volume or a zonal volume should be created.

func GetReadySchedulableNodes

func GetReadySchedulableNodes(cli kubernetes.Interface) ([]corev1.Node, error)

GetReadySchedulableNodes addresses the common use case of getting nodes you can do work on. 1) Needs to be schedulable. 2) Needs to be ready. Derived from "k8s.io/kubernetes/test/e2e/framework/node" TODO: check for taints as well

func NodeZonesAndRegion

func NodeZonesAndRegion(ctx context.Context, cli kubernetes.Interface) (map[string]struct{}, string, error)

NodeZonesAndRegion returns cloud provider failure-domain region and zones as reported by K8s

func SanitizeAvailableZones

func SanitizeAvailableZones(availableZones map[string]struct{}, validZoneNames []string) map[string]struct{}

SanitizeAvailableZones validates and updates a map of zones against a list of valid zone names

Types

type Mapper

type Mapper interface {
	FromRegion(ctx context.Context, region string) ([]string, error)
}

Mapper interface indicates provider that supports FromRegion mapping to list of zones

Jump to

Keyboard shortcuts

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