kubernetes: k8s.io/kubernetes/plugin/pkg/admission/runtimeclass Index | Files

package runtimeclass

import "k8s.io/kubernetes/plugin/pkg/admission/runtimeclass"

Package runtimeclass contains an admission controller for modifying and validating new Pods to take RuntimeClass into account. For RuntimeClass definitions which describe an overhead associated with running a pod, this admission controller will set the pod.Spec.Overhead field accordingly. This field should only be set through this controller, so validation will be carried out to ensure the pod's value matches what is defined in the coresponding RuntimeClass.


Package Files



const PluginName = "RuntimeClass"

PluginName indicates name of admission plugin.

func Register Uses

func Register(plugins *admission.Plugins)

Register registers a plugin

type RuntimeClass Uses

type RuntimeClass struct {
    // contains filtered or unexported fields

RuntimeClass is an implementation of admission.Interface. It looks at all new pods and sets pod.Spec.Overhead if a RuntimeClass is specified which defines an Overhead. If pod.Spec.Overhead is set but a RuntimeClass with matching overhead is not specified, the pod is rejected.

func NewRuntimeClass Uses

func NewRuntimeClass() *RuntimeClass

NewRuntimeClass creates a new RuntimeClass admission control handler

func (*RuntimeClass) Admit Uses

func (r *RuntimeClass) Admit(ctx context.Context, attributes admission.Attributes, o admission.ObjectInterfaces) error

Admit makes an admission decision based on the request attributes

func (*RuntimeClass) InspectFeatureGates Uses

func (r *RuntimeClass) InspectFeatureGates(featureGates featuregate.FeatureGate)

InspectFeatureGates allows setting bools without taking a dep on a global variable

func (*RuntimeClass) SetExternalKubeClientSet Uses

func (r *RuntimeClass) SetExternalKubeClientSet(client kubernetes.Interface)

SetExternalKubeClientSet sets the client for the plugin

func (*RuntimeClass) SetExternalKubeInformerFactory Uses

func (r *RuntimeClass) SetExternalKubeInformerFactory(f informers.SharedInformerFactory)

SetExternalKubeInformerFactory implements the WantsExternalKubeInformerFactory interface.

func (*RuntimeClass) Validate Uses

func (r *RuntimeClass) Validate(ctx context.Context, attributes admission.Attributes, o admission.ObjectInterfaces) error

Validate makes sure that pod adhere's to RuntimeClass's definition

func (*RuntimeClass) ValidateInitialization Uses

func (r *RuntimeClass) ValidateInitialization() error

ValidateInitialization implements the WantsExternalKubeInformerFactory interface.

Package runtimeclass imports 19 packages (graph) and is imported by 33 packages. Updated 2020-11-21. Refresh now. Tools for package owners.