podspread

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationPodSpreadRate = "wao.bitmedia.co.jp/podspread-rate"
)

Variables

View Source
var (
	Name = "PodSpread"

	ReasonInvalidAnnotation         = "invalid annotation"
	ReasonEmptyNodeName             = "node not found"
	ReasonNotControlledByReplicaSet = "the pod is not controlled by any ReplicaSet"
	ReasonK8sClient                 = "skip this plugin as k8s client got error"
	ReasonSchedulingSession         = "skip this plugin as SchedulingSession update failed"
)

Functions

func New

New initializes a new plugin and returns it.

Types

type PodSpread

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

func (*PodSpread) Name

func (*PodSpread) Name() string

Name returns name of the plugin. It is used in logs, etc.

func (*PodSpread) PreFilter

func (pl *PodSpread) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod) (*framework.PreFilterResult, *framework.Status)

PreFilter invoked at the prefilter extension point.

func (*PodSpread) PreFilterExtensions

func (pl *PodSpread) PreFilterExtensions() framework.PreFilterExtensions

PreFilterExtensions do not exist for this plugin.

type SchedulingSession

type SchedulingSession struct {
	TotalReplicas int
	Redunduncy    int
	DeployedNodes map[string]int
	TotalDeployed int
	SpreadMode    SpreadMode
	SpreadInfo    SpreadInfo
}

type SpreadInfo

type SpreadInfo map[string]map[string]bool

SpreadInfo holds area info.

area1:           # nodes has "area1" label (zone or region)
  node11: true   # node11 is a control plane node
  node12: false  # node12 is a worker node
area2:
  node21: false

func (SpreadInfo) GetAreasOnlyControlPlane

func (s SpreadInfo) GetAreasOnlyControlPlane() []string

GetAreasOnlyControlPlane returns areas no worker nodes. These areas should be excluded from scheduling.

func (SpreadInfo) GetNodeArea

func (s SpreadInfo) GetNodeArea(node string) (area string, isControlPlane bool)

type SpreadMode

type SpreadMode string
const (
	SpreadModeRegion SpreadMode = "SpreadModeRegion"
	SpreadModeZone   SpreadMode = "SpreadModeZone"
	SpreadModeNode   SpreadMode = "SpreadModeNode"
)

Jump to

Keyboard shortcuts

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