package podtopologyspread
import "k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
Index ¶
- Constants
- func New(args *runtime.Unknown, h framework.FrameworkHandle) (framework.Plugin, error)
- type Args
- type PodTopologySpread
- func (pl *PodTopologySpread) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *nodeinfo.NodeInfo) *framework.Status
- func (pl *PodTopologySpread) BuildArgs() interface{}
- func (pl *PodTopologySpread) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *nodeinfo.NodeInfo) *framework.Status
- func (pl *PodTopologySpread) Name() string
- func (pl *PodTopologySpread) NormalizeScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status
- func (pl *PodTopologySpread) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status
- func (pl *PodTopologySpread) PreFilterExtensions() framework.PreFilterExtensions
- func (pl *PodTopologySpread) PreScore( ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, filteredNodes []*v1.Node, ) *framework.Status
- func (pl *PodTopologySpread) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podToRemove *v1.Pod, nodeInfo *nodeinfo.NodeInfo) *framework.Status
- func (pl *PodTopologySpread) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
- func (pl *PodTopologySpread) ScoreExtensions() framework.ScoreExtensions
Constants ¶
const ( // ErrReasonConstraintsNotMatch is used for PodTopologySpread filter error. ErrReasonConstraintsNotMatch = "node(s) didn't match pod topology spread constraints" )
const ( // Name is the name of the plugin used in the plugin registry and configurations. Name = "PodTopologySpread" )
Functions ¶
func New ¶
New initializes a new plugin and returns it.
Types ¶
type Args ¶
type Args struct { // DefaultConstraints defines topology spread constraints to be applied to // pods that don't define any in `pod.spec.topologySpreadConstraints`. // `topologySpreadConstraint.labelSelectors` must be empty, as they are // deduced the pods' membership to Services, Replication Controllers, Replica // Sets or Stateful Sets. // Empty by default. // +optional // +listType=atomic DefaultConstraints []v1.TopologySpreadConstraint `json:"defaultConstraints"` }
Args holds the arguments to configure the plugin.
type PodTopologySpread ¶
type PodTopologySpread struct { Args // contains filtered or unexported fields }
PodTopologySpread is a plugin that ensures pod's topologySpreadConstraints is satisfied.
func (*PodTopologySpread) AddPod ¶
func (pl *PodTopologySpread) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *nodeinfo.NodeInfo) *framework.Status
AddPod from pre-computed data in cycleState.
func (*PodTopologySpread) BuildArgs ¶
func (pl *PodTopologySpread) BuildArgs() interface{}
BuildArgs returns the arguments used to build the plugin.
func (*PodTopologySpread) Filter ¶
func (pl *PodTopologySpread) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *nodeinfo.NodeInfo) *framework.Status
Filter invoked at the filter extension point.
func (*PodTopologySpread) Name ¶
func (pl *PodTopologySpread) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*PodTopologySpread) NormalizeScore ¶
func (pl *PodTopologySpread) NormalizeScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status
NormalizeScore invoked after scoring all nodes.
func (*PodTopologySpread) PreFilter ¶
func (pl *PodTopologySpread) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status
PreFilter invoked at the prefilter extension point.
func (*PodTopologySpread) PreFilterExtensions ¶
func (pl *PodTopologySpread) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns prefilter extensions, pod add and remove.
func (*PodTopologySpread) PreScore ¶
func (pl *PodTopologySpread) PreScore( ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, filteredNodes []*v1.Node, ) *framework.Status
PreScore builds and writes cycle state used by Score and NormalizeScore.
func (*PodTopologySpread) RemovePod ¶
func (pl *PodTopologySpread) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podToRemove *v1.Pod, nodeInfo *nodeinfo.NodeInfo) *framework.Status
RemovePod from pre-computed data in cycleState.
func (*PodTopologySpread) Score ¶
func (pl *PodTopologySpread) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the Score extension point. The "score" returned in this function is the matching number of pods on the `nodeName`, it is normalized later.
func (*PodTopologySpread) ScoreExtensions ¶
func (pl *PodTopologySpread) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
Source Files ¶
common.go filtering.go plugin.go scoring.go
- Version
- v1.18.14
- Published
- Dec 18, 2020
- Platform
- linux/amd64
- Imports
- 21 packages
- Last checked
- 6 minutes ago –
Tools for package owners.