kubernetes well_known_labels 源码

  • 2022-09-18
  • 浏览 (57)

kubernetes well_known_labels 代码


Copyright 2019 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at


Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

package v1

const (
	LabelHostname = "kubernetes.io/hostname"

	LabelTopologyZone   = "topology.kubernetes.io/zone"
	LabelTopologyRegion = "topology.kubernetes.io/region"

	// These label have been deprecated since 1.17, but will be supported for
	// the foreseeable future, to accommodate things like long-lived PVs that
	// use them.  New users should prefer the "topology.kubernetes.io/*"
	// equivalents.
	LabelFailureDomainBetaZone   = "failure-domain.beta.kubernetes.io/zone"   // deprecated
	LabelFailureDomainBetaRegion = "failure-domain.beta.kubernetes.io/region" // deprecated

	// Retained for compat when vendored.  Do not use these consts in new code.
	LabelZoneFailureDomain       = LabelFailureDomainBetaZone   // deprecated
	LabelZoneRegion              = LabelFailureDomainBetaRegion // deprecated
	LabelZoneFailureDomainStable = LabelTopologyZone            // deprecated
	LabelZoneRegionStable        = LabelTopologyRegion          // deprecated

	LabelInstanceType       = "beta.kubernetes.io/instance-type"
	LabelInstanceTypeStable = "node.kubernetes.io/instance-type"

	LabelOSStable   = "kubernetes.io/os"
	LabelArchStable = "kubernetes.io/arch"

	// LabelWindowsBuild is used on Windows nodes to specify the Windows build number starting with v1.17.0.
	// It's in the format MajorVersion.MinorVersion.BuildNumber (for ex: 10.0.17763)
	LabelWindowsBuild = "node.kubernetes.io/windows-build"

	// LabelNamespaceSuffixKubelet is an allowed label namespace suffix kubelets can self-set ([*.]kubelet.kubernetes.io/*)
	LabelNamespaceSuffixKubelet = "kubelet.kubernetes.io"
	// LabelNamespaceSuffixNode is an allowed label namespace suffix kubelets can self-set ([*.]node.kubernetes.io/*)
	LabelNamespaceSuffixNode = "node.kubernetes.io"

	// LabelNamespaceNodeRestriction is a forbidden label namespace that kubelets may not self-set when the NodeRestriction admission plugin is enabled
	LabelNamespaceNodeRestriction = "node-restriction.kubernetes.io"

	// IsHeadlessService is added by Controller to an Endpoint denoting if its parent
	// Service is Headless. The existence of this label can be used further by other
	// controllers and kube-proxy to check if the Endpoint objects should be replicated when
	// using Headless Services
	IsHeadlessService = "service.kubernetes.io/headless"

	// LabelNodeExcludeBalancers specifies that the node should not be considered as a target
	// for external load-balancers which use nodes as a second hop (e.g. many cloud LBs which only
	// understand nodes). For services that use externalTrafficPolicy=Local, this may mean that
	// any backends on excluded nodes are not reachable by those external load-balancers.
	// Implementations of this exclusion may vary based on provider.
	LabelNodeExcludeBalancers = "node.kubernetes.io/exclude-from-external-load-balancers"
	// LabelMetadataName is the label name which, in-tree, is used to automatically label namespaces, so they can be selected easily by tools which require definitive labels
	LabelMetadataName = "kubernetes.io/metadata.name"


kubernetes 源码目录


kubernetes annotation_key_constants 源码

kubernetes doc 源码

kubernetes generated.pb 源码

kubernetes lifecycle 源码

kubernetes objectreference 源码

kubernetes register 源码

kubernetes resource 源码

kubernetes taint 源码

kubernetes taint_test 源码

kubernetes toleration 源码

0  赞