volumebinding

package
v1.19.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: Apache-2.0 Imports: 11 Imported by: 11

Documentation

Index

Constants

View Source
const (
	// DefaultBindTimeoutSeconds defines the default bind timeout in seconds
	DefaultBindTimeoutSeconds = 600
)
View Source
const Name = "VolumeBinding"

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

Variables

This section is empty.

Functions

func New added in v1.18.0

New initializes a new plugin and returns it.

Types

type VolumeBinding

type VolumeBinding struct {
	Binder scheduling.SchedulerVolumeBinder
}

VolumeBinding is a plugin that binds pod volumes in scheduling. In the Filter phase, pod binding cache is created for the pod and used in Reserve and PreBind phases. Pod binding cache will be cleared at Unreserve and PostBind extension points. However, if pod fails before the Reserve phase and is deleted from the apiserver later, its pod binding cache cannot be cleared at plugin extension points. We register an event handler to clear pod binding cache when the pod is deleted to prevent memory leaking.

func (*VolumeBinding) Filter

func (pl *VolumeBinding) Filter(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status

Filter invoked at the filter extension point. It evaluates if a pod can fit due to the volumes it requests, for both bound and unbound PVCs.

For PVCs that are bound, then it checks that the corresponding PV's node affinity is satisfied by the given node.

For PVCs that are unbound, it tries to find available PVs that can satisfy the PVC requirements and that the PV node affinity is satisfied by the given node.

The predicate returns true if all bound PVCs have compatible PVs with the node, and if all unbound PVCs can be matched with an available and node-compatible PV.

func (*VolumeBinding) Name

func (pl *VolumeBinding) Name() string

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

func (*VolumeBinding) PostBind

func (pl *VolumeBinding) PostBind(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeName string)

PostBind is called after a pod is successfully bound.

func (*VolumeBinding) PreBind added in v1.19.0

func (pl *VolumeBinding) PreBind(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status

PreBind will make the API update with the assumed bindings and wait until the PV controller has completely finished the binding operation.

If binding errors, times out or gets undone, then an error will be returned to retry scheduling.

func (*VolumeBinding) Reserve added in v1.19.0

func (pl *VolumeBinding) Reserve(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status

Reserve reserves volumes of pod and saves binding status in cycle state.

func (*VolumeBinding) Unreserve added in v1.19.0

func (pl *VolumeBinding) Unreserve(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeName string)

Unreserve clears pod binding state. TODO(#90962) Revert assumed PV/PVC cache

Jump to

Keyboard shortcuts

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