Documentation ¶
Index ¶
- Constants
- func BuildVolumeZonalDistribution(clientset kubernetes.Interface, sts *appsv1.StatefulSet) (map[Zone]map[uint]bool, error)
- func ForAllPeristentVolumes(iface typedCoreV1.PersistentVolumeInterface, ...) error
- func New(configuration *runtime.Unknown, f framework.FrameworkHandle) (framework.Plugin, error)
- func PodOrdinal(name string) int
- type Node
- type ZonalDistributionPlugin
- type ZonalTopology
- type Zone
Constants ¶
const ( Name = "ZonalDistribution" ZoneLabel = "failure-domain.beta.kubernetes.io/zone" StatefulSetLabel = "statefulset.kubernetes.io/pod-name" VZDKey = "VZD" )
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 PodOrdinal ¶
Types ¶
type ZonalDistributionPlugin ¶
type ZonalDistributionPlugin struct {
// contains filtered or unexported fields
}
func (*ZonalDistributionPlugin) Filter ¶
func (p *ZonalDistributionPlugin) Filter(pc *framework.PluginContext, pod *corev1.Pod, nodeName string) *framework.Status
func (*ZonalDistributionPlugin) Name ¶
func (p *ZonalDistributionPlugin) Name() string
func (*ZonalDistributionPlugin) PreFilter ¶
func (p *ZonalDistributionPlugin) PreFilter(pc *framework.PluginContext, pod *corev1.Pod) *framework.Status
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