apiserverk8s.io/apiserver/pkg/admission/initializer Index | Files

package initializer

import "k8s.io/apiserver/pkg/admission/initializer"

Index

Functions

func New

func New(
	extClientset kubernetes.Interface,
	dynamicClient dynamic.Interface,
	extInformers informers.SharedInformerFactory,
	authz authorizer.Authorizer,
	featureGates featuregate.FeatureGate,
	effectiveVersion compatibility.EffectiveVersion,
	stopCh <-chan struct{},
	restMapper meta.RESTMapper,
) pluginInitializer

New creates an instance of admission plugins initializer. This constructor is public with a long param list so that callers immediately know that new information can be expected during compilation when they update a level.

func NewAPIServerIDInitializer

func NewAPIServerIDInitializer(apiServerID string) admission.PluginInitializer

NewAPIServerIDInitializer returns a PluginInitializer that injects the given API server ID into admission plugins that implement WantsAPIServerID. This initializer must be placed before the generic initializer in the chain so that the API server ID is available when SetExternalKubeInformerFactory is called.

Types

type ManifestLoaders

type ManifestLoaders struct {
	// LoadValidatingWebhookManifests loads ValidatingWebhookConfiguration manifests.
	LoadValidatingWebhookManifests ValidatingWebhookManifestLoadFunc
	// LoadMutatingWebhookManifests loads MutatingWebhookConfiguration manifests.
	LoadMutatingWebhookManifests MutatingWebhookManifestLoadFunc
	// LoadValidatingPolicyManifests loads ValidatingAdmissionPolicy manifests.
	LoadValidatingPolicyManifests ValidatingPolicyManifestLoadFunc
	// LoadMutatingPolicyManifests loads MutatingAdmissionPolicy manifests.
	LoadMutatingPolicyManifests MutatingPolicyManifestLoadFunc
}

ManifestLoaders provides functions to load admission configurations from static manifest files with scheme-based defaulting and validation.

type MutatingPolicyManifestLoadFunc

MutatingPolicyManifestLoadFunc loads MutatingAdmissionPolicy manifests from a directory.

type MutatingWebhookManifestLoadFunc

type MutatingWebhookManifestLoadFunc func(dir string) ([]*admissionregistrationv1api.MutatingWebhookConfiguration, string, error)

MutatingWebhookManifestLoadFunc loads MutatingWebhookConfiguration manifests from a directory.

type ValidatingPolicyManifestLoadFunc

ValidatingPolicyManifestLoadFunc loads ValidatingAdmissionPolicy manifests from a directory.

type ValidatingWebhookManifestLoadFunc

type ValidatingWebhookManifestLoadFunc func(dir string) ([]*admissionregistrationv1api.ValidatingWebhookConfiguration, string, error)

ValidatingWebhookManifestLoadFunc loads ValidatingWebhookConfiguration manifests from a directory.

type WantsAPIServerID

type WantsAPIServerID interface {
	SetAPIServerID(apiServerID string)
	admission.InitializationValidator
}

WantsAPIServerID defines a function which sets the API server ID for admission plugins that need it (e.g., for metrics labeling in HA setups).

type WantsAuthorizer

type WantsAuthorizer interface {
	SetAuthorizer(authorizer.Authorizer)
	admission.InitializationValidator
}

WantsAuthorizer defines a function which sets Authorizer for admission plugins that need it.

type WantsDrainedNotification

type WantsDrainedNotification interface {
	SetDrainedNotification(<-chan struct{})
	admission.InitializationValidator
}

WantsDrainedNotification defines a function which sets the notification of where the apiserver has already been drained for admission plugins that need it. After receiving that notification, Admit/Validate calls won't be called anymore.

type WantsDynamicClient

type WantsDynamicClient interface {
	SetDynamicClient(dynamic.Interface)
	admission.InitializationValidator
}

type WantsEffectiveVersion

type WantsEffectiveVersion interface {
	InspectEffectiveVersion(compatibility.EffectiveVersion)
	admission.InitializationValidator
}

WantsEffectiveVersion defines a function which passes the effective version for inspection by an admission plugin.

type WantsExcludedAdmissionResources

type WantsExcludedAdmissionResources interface {
	SetExcludedAdmissionResources(excludedAdmissionResources []schema.GroupResource)
	admission.InitializationValidator
}

WantsExcludedAdmissionResources defines a function which sets the ExcludedAdmissionResources for an admission plugin that needs it.

type WantsExternalKubeClientSet

type WantsExternalKubeClientSet interface {
	SetExternalKubeClientSet(kubernetes.Interface)
	admission.InitializationValidator
}

WantsExternalKubeClientSet defines a function which sets external ClientSet for admission plugins that need it

type WantsExternalKubeInformerFactory

type WantsExternalKubeInformerFactory interface {
	SetExternalKubeInformerFactory(informers.SharedInformerFactory)
	admission.InitializationValidator
}

WantsExternalKubeInformerFactory defines a function which sets InformerFactory for admission plugins that need it

type WantsFeatures

type WantsFeatures interface {
	InspectFeatureGates(featuregate.FeatureGate)
	admission.InitializationValidator
}

WantsFeatureGate defines a function which passes the featureGates for inspection by an admission plugin. Admission plugins should not hold a reference to the featureGates. Instead, they should query a particular one and assign it to a simple bool in the admission plugin struct.

func (a *admissionPlugin) InspectFeatureGates(features featuregate.FeatureGate){
    a.myFeatureIsOn = features.Enabled("my-feature")
}

type WantsManifestLoaders

type WantsManifestLoaders interface {
	SetManifestLoaders(loaders *ManifestLoaders)
}

WantsManifestLoaders is implemented by admission plugins that load configurations from static manifest files and need scheme-based defaulting and validation.

type WantsQuotaConfiguration

type WantsQuotaConfiguration interface {
	SetQuotaConfiguration(quota.Configuration)
	admission.InitializationValidator
}

WantsQuotaConfiguration defines a function which sets quota configuration for admission plugins that need it.

type WantsRESTMapper

type WantsRESTMapper interface {
	SetRESTMapper(meta.RESTMapper)
	admission.InitializationValidator
}

WantsRESTMapper defines a function which sets RESTMapper for admission plugins that need it.

type WantsSchemaResolver

type WantsSchemaResolver interface {
	SetSchemaResolver(resolver resolver.SchemaResolver)
	admission.InitializationValidator
}

WantsSchemaResolver defines a function which sets the SchemaResolver for an admission plugin that needs it.

Source Files

apiserver_id.go initializer.go interfaces.go

Version
v0.36.0 (latest)
Published
Apr 22, 2026
Platform
linux/amd64
Imports
12 packages
Last checked
4 days ago

Tools for package owners.