podstate

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

Overview

This folder holds a sample plugin implementation based on the number of terminating and nominated Pods on a Node.

Maturity Level

  • 💡 Sample (for demonstrating and inspiring purpose)
  • 👶 Alpha (used in companies for pilot projects)
  • 👦 Beta (used in companies and developed actively)
  • 👨 Stable (used in companies for production workloads)

Pod State Plugin

This is a score plugin that takes terminating and nominated Pods into accounts in the following manner:

  • the nodes that have more terminating Pods will get a higher score as those terminating Pods would be physically removed eventually from nodes
  • the nodes that have more nominated Pods (which carry .status.nominatedNodeName) will get a lower score as the nominated nodes are supposed to accommodate some preemptor pod in a future scheduling cycle.

Example config:

apiVersion: kubescheduler.config.k8s.io/v1beta2
kind: KubeSchedulerConfiguration
leaderElection:
  leaderElect: false
clientConnection:
  kubeconfig: "REPLACE_ME_WITH_KUBE_CONFIG_PATH"
profiles:
- schedulerName: default-scheduler
  plugins:
    score:
      enabled:
      - name: PodState

Documentation

Index

Constants

View Source
const Name = "PodState"

Name is the name of the plugin used in the Registry and configurations.

Variables

This section is empty.

Functions

func New

New initializes a new plugin and returns it.

Types

type PodState

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

func (*PodState) Name

func (ps *PodState) Name() string

func (*PodState) NormalizeScore

func (ps *PodState) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status

func (*PodState) Score

func (ps *PodState) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)

Score invoked at the score extension point.

func (*PodState) ScoreExtensions

func (ps *PodState) ScoreExtensions() framework.ScoreExtensions

ScoreExtensions of the Score plugin.

Jump to

Keyboard shortcuts

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