volumerestrictions

package
v1.29.9 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// Name is the name of the plugin used in the plugin registry and configurations.
	Name = names.VolumeRestrictions

	// ErrReasonDiskConflict is used for NoDiskConflict predicate error.
	ErrReasonDiskConflict = "node(s) had no available disk"
	// ErrReasonReadWriteOncePodConflict is used when a pod is found using the same PVC with the ReadWriteOncePod access mode.
	ErrReasonReadWriteOncePodConflict = "node has pod using PersistentVolumeClaim with the same name and ReadWriteOncePod access mode"
)

Variables

This section is empty.

Functions

func New

New initializes a new plugin and returns it.

Types

type VolumeRestrictions

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

VolumeRestrictions is a plugin that checks volume restrictions.

func (*VolumeRestrictions) AddPod added in v1.27.0

func (pl *VolumeRestrictions) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podInfoToAdd *framework.PodInfo, nodeInfo *framework.NodeInfo) *framework.Status

AddPod from pre-computed data in cycleState.

func (*VolumeRestrictions) EventsToRegister added in v1.22.0

func (pl *VolumeRestrictions) EventsToRegister() []framework.ClusterEventWithHint

EventsToRegister returns the possible events that may make a Pod failed by this plugin schedulable.

func (*VolumeRestrictions) Filter

func (pl *VolumeRestrictions) Filter(ctx context.Context, cycleState *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, and those that are already mounted. If there is already a volume mounted on that node, another pod that uses the same volume can't be scheduled there. This is GCE, Amazon EBS, ISCSI and Ceph RBD specific for now: - GCE PD allows multiple mounts as long as they're all read-only - AWS EBS forbids any two pods mounting the same volume ID - Ceph RBD forbids if any two pods share at least same monitor, and match pool and image, and the image is read-only - ISCSI forbids if any two pods share at least same IQN and ISCSI volume is read-only If the pod uses PVCs with the ReadWriteOncePod access mode, it evaluates if these PVCs are already in-use and if preemption will help.

func (*VolumeRestrictions) Name

func (pl *VolumeRestrictions) Name() string

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

func (*VolumeRestrictions) PreFilter added in v1.22.0

PreFilter computes and stores cycleState containing details for enforcing ReadWriteOncePod.

func (*VolumeRestrictions) PreFilterExtensions added in v1.22.0

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

PreFilterExtensions returns prefilter extensions, pod add and remove.

func (*VolumeRestrictions) RemovePod added in v1.27.0

func (pl *VolumeRestrictions) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podInfoToRemove *framework.PodInfo, nodeInfo *framework.NodeInfo) *framework.Status

RemovePod from pre-computed data in cycleState.

Jump to

Keyboard shortcuts

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