kubernetesk8s.io/kubernetes/pkg/scheduler/plugins/examples Index | Files

package examples

import "k8s.io/kubernetes/pkg/scheduler/plugins/examples"

Index

Types

type MultipointCommunicatingPlugin

type MultipointCommunicatingPlugin struct{}

MultipointCommunicatingPlugin is an example of a plugin that implements two extension points. It communicates through pluginContext with another function.

func NewMultipointCommunicatingPlugin

func NewMultipointCommunicatingPlugin() *MultipointCommunicatingPlugin

NewMultipointCommunicatingPlugin initializes a new plugin and returns it.

func (MultipointCommunicatingPlugin) Name

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

func (MultipointCommunicatingPlugin) Prebind

func (mc MultipointCommunicatingPlugin) Prebind(ps plugins.PluginSet, pod *v1.Pod, nodeName string) (bool, error)

Prebind is the functions invoked by the framework at "prebind" extension point.

func (MultipointCommunicatingPlugin) Reserve

func (mc MultipointCommunicatingPlugin) Reserve(ps plugins.PluginSet, pod *v1.Pod, nodeName string) error

Reserve is the functions invoked by the framework at "reserve" extension point.

type StatefulMultipointExample

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

StatefulMultipointExample is an example plugin that is executed at multiple extension points. This plugin is stateful. It receives arguments at initialization (NewMultipointPlugin) and changes its state when it is executed.

func NewStatefulMultipointExample

func NewStatefulMultipointExample(initState ...interface{}) *StatefulMultipointExample

NewStatefulMultipointExample initializes a new plugin and returns it.

func (*StatefulMultipointExample) Name

func (mp *StatefulMultipointExample) Name() string

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

func (*StatefulMultipointExample) Prebind

func (mp *StatefulMultipointExample) Prebind(ps plugins.PluginSet, pod *v1.Pod, nodeName string) (bool, error)

Prebind is the functions invoked by the framework at "prebind" extension point.

func (*StatefulMultipointExample) Reserve

func (mp *StatefulMultipointExample) Reserve(ps plugins.PluginSet, pod *v1.Pod, nodeName string) error

Reserve is the functions invoked by the framework at "reserve" extension point.

type StatelessPrebindExample

type StatelessPrebindExample struct{}

StatelessPrebindExample is an example of a simple plugin that has no state and implements only one hook for prebind.

func NewStatelessPrebindExample

func NewStatelessPrebindExample() *StatelessPrebindExample

NewStatelessPrebindExample initializes a new plugin and returns it.

func (StatelessPrebindExample) Name

func (sr StatelessPrebindExample) Name() string

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

func (StatelessPrebindExample) Prebind

func (sr StatelessPrebindExample) Prebind(ps plugins.PluginSet, pod *v1.Pod, nodeName string) (bool, error)

Prebind is the functions invoked by the framework at "prebind" extension point.

Source Files

multipoint.go prebind.go stateful.go

Version
v1.14.1
Published
Apr 5, 2019
Platform
js/wasm
Imports
4 packages
Last checked
32 seconds ago

Tools for package owners.