package podtopologylabels
import "k8s.io/kubernetes/plugin/pkg/admission/podtopologylabels"
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
- func Register(plugins *admission.Plugins)
- type Config
- type Plugin
- func NewPodTopologyPlugin(c Config) *Plugin
- func (p *Plugin) Admit(ctx context.Context, a admission.Attributes, o admission.ObjectInterfaces) (err error)
- func (p *Plugin) InspectFeatureGates(featureGates featuregate.FeatureGate)
- func (p *Plugin) SetExternalKubeInformerFactory(factory informers.SharedInformerFactory)
- func (p *Plugin) ValidateInitialization() error
Constants ¶
const PluginName = "PodTopologyLabels"
PluginName is a string with the name of the plugin
Functions ¶
func Register ¶
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 ¶
func NewPodTopologyPlugin ¶
NewPodTopologyPlugin initializes a Plugin
func (*Plugin) Admit ¶
func (p *Plugin) Admit(ctx context.Context, a admission.Attributes, o admission.ObjectInterfaces) (err error)
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 ¶
Source Files ¶
admission.go doc.go
- Version
- v1.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 5 hours ago –
Tools for package owners.