podtopologylabels

package
v1.33.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package podtopologylabels is a plugin that mutates `pod/binding` requests by copying the `topology.k8s.io/{zone,region}` labels from the assigned Node object (in the Binding being admitted) onto the Binding so that it can be persisted onto the Pod object when the Pod is being scheduled. Requests for the regular `pods` resource that set the `spec.nodeName` will also trigger the plugin to copy the labels as described. If the binding target is NOT a Node object, no action is taken. If the referenced Node object does not exist, no action is taken.

Index

Constants

View Source
const PluginName = "PodTopologyLabels"

PluginName is a string with the name of the plugin

Variables

This section is empty.

Functions

func Register

func Register(plugins *admission.Plugins)

Register registers a plugin

Types

type Config

type Config struct {
	// Labels is set of explicit label keys to be copied from the Node object onto
	// pod Binding objects during admission.
	Labels []string
}

Config contains configuration for instances of the podtopologylabels admission plugin. This is not exposed as user-facing APIServer configuration, however can be used by platform operators when building custom topology label plugins.

type Plugin

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

func NewPodTopologyPlugin

func NewPodTopologyPlugin(c Config) *Plugin

NewPodTopologyPlugin initializes a Plugin

func (*Plugin) Admit

func (*Plugin) InspectFeatureGates

func (p *Plugin) InspectFeatureGates(featureGates featuregate.FeatureGate)

InspectFeatureGates implements WantsFeatures.

func (*Plugin) SetExternalKubeInformerFactory

func (p *Plugin) SetExternalKubeInformerFactory(factory informers.SharedInformerFactory)

func (*Plugin) ValidateInitialization

func (p *Plugin) ValidateInitialization() error

Jump to

Keyboard shortcuts

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