admission

package
v1.8.0-alpha.2....-ef85265 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// HighestUserDefinablePriority is the highest priority for user defined priority classes. Priority values larger than 1 billion are reserved for Kubernetes system use.
	HighestUserDefinablePriority = 1000000000
	// SystemCriticalPriority is the beginning of the range of priority values for critical system components.
	SystemCriticalPriority = 2 * HighestUserDefinablePriority
)

Variables

View Source
var SystemPriorityClasses = map[string]int32{
	"system-cluster-critical": SystemCriticalPriority,
	"system-node-critical":    SystemCriticalPriority + 1000,
}

SystemPriorityClasses defines special priority classes which are used by system critical pods that should not be preempted by workload pods.

Functions

func Register

func Register(plugins *admission.Plugins)

Register registers a plugin

Types

type PriorityPlugin

type PriorityPlugin struct {
	*admission.Handler
	// contains filtered or unexported fields
}

PriorityPlugin is an implementation of admission.Interface.

func NewPlugin

func NewPlugin() *PriorityPlugin

NewPlugin creates a new priority admission plugin.

func (*PriorityPlugin) Admit

Admit checks Pods and admits or rejects them. It also resolves the priority of pods based on their PriorityClass. Note that pod validation mechanism prevents update of a pod priority.

func (*PriorityPlugin) SetInternalKubeClientSet

func (p *PriorityPlugin) SetInternalKubeClientSet(client internalclientset.Interface)

SetInternalKubeClientSet implements the WantsInternalKubeClientSet interface.

func (*PriorityPlugin) SetInternalKubeInformerFactory

func (p *PriorityPlugin) SetInternalKubeInformerFactory(f informers.SharedInformerFactory)

SetInternalKubeInformerFactory implements the WantsInternalKubeInformerFactory interface.

func (*PriorityPlugin) Validate

func (p *PriorityPlugin) Validate(a admission.Attributes) error

Validate checks PriorityClasses and admits or rejects them.

func (*PriorityPlugin) ValidateInitialization

func (p *PriorityPlugin) ValidateInitialization() error

ValidateInitialization implements the InitializationValidator interface.

Jump to

Keyboard shortcuts

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