...

Source file src/k8s.io/kubernetes/cmd/kube-controller-manager/names/controller_names.go

Documentation: k8s.io/kubernetes/cmd/kube-controller-manager/names

     1  /*
     2  Copyright 2023 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package names
    18  
    19  // Canonical controller names
    20  //
    21  // NAMING CONVENTIONS
    22  // 1. naming should be consistent across the controllers
    23  // 2. use of shortcuts should be avoided, unless they are well-known non-Kubernetes shortcuts
    24  // 3. Kubernetes' resources should be written together without a hyphen ("-")
    25  //
    26  // CHANGE POLICY
    27  // The controller names should be treated as IDs.
    28  // They can only be changed if absolutely necessary. For example if an inappropriate name was chosen in the past, or if the scope of the controller changes.
    29  // When a name is changed, the old name should be aliased in app.ControllerDescriptor#GetAliases, while preserving all old aliases.
    30  // This is done to achieve backwards compatibility
    31  //
    32  // USE CASES
    33  // The following places should use the controller name constants, when:
    34  //  1. defining a new app.ControllerDescriptor so it can be used in app.NewControllerDescriptors or app.KnownControllers:
    35  //  2. used anywhere inside the controller itself:
    36  //     2.1. [TODO] logging should use a canonical controller name when referencing a controller (Eg. Starting X, Shutting down X)
    37  //     2.2. [TODO] emitted events should have an EventSource.Component set to the controller name (usually when initializing an EventRecorder)
    38  //     2.3. [TODO] registering ControllerManagerMetrics with ControllerStarted and ControllerStopped
    39  //     2.4. [TODO] calling WaitForNamedCacheSync
    40  //  3. defining controller options for "--help" command or generated documentation
    41  //     3.1. controller name should be used to create a pflag.FlagSet when registering controller options (the name is rendered in a controller flag group header) in options.KubeControllerManagerOptions
    42  //     3.2. when defined flag's help mentions a controller name
    43  //  4. defining a new service account for a new controller (old controllers may have inconsistent service accounts to stay backwards compatible)
    44  const (
    45  	ServiceAccountTokenController                = "serviceaccount-token-controller"
    46  	EndpointsController                          = "endpoints-controller"
    47  	EndpointSliceController                      = "endpointslice-controller"
    48  	EndpointSliceMirroringController             = "endpointslice-mirroring-controller"
    49  	ReplicationControllerController              = "replicationcontroller-controller"
    50  	PodGarbageCollectorController                = "pod-garbage-collector-controller"
    51  	ResourceQuotaController                      = "resourcequota-controller"
    52  	NamespaceController                          = "namespace-controller"
    53  	ServiceAccountController                     = "serviceaccount-controller"
    54  	GarbageCollectorController                   = "garbage-collector-controller"
    55  	DaemonSetController                          = "daemonset-controller"
    56  	JobController                                = "job-controller"
    57  	DeploymentController                         = "deployment-controller"
    58  	ReplicaSetController                         = "replicaset-controller"
    59  	HorizontalPodAutoscalerController            = "horizontal-pod-autoscaler-controller"
    60  	DisruptionController                         = "disruption-controller"
    61  	StatefulSetController                        = "statefulset-controller"
    62  	CronJobController                            = "cronjob-controller"
    63  	CertificateSigningRequestSigningController   = "certificatesigningrequest-signing-controller"
    64  	CertificateSigningRequestApprovingController = "certificatesigningrequest-approving-controller"
    65  	CertificateSigningRequestCleanerController   = "certificatesigningrequest-cleaner-controller"
    66  	TTLController                                = "ttl-controller"
    67  	BootstrapSignerController                    = "bootstrap-signer-controller"
    68  	TokenCleanerController                       = "token-cleaner-controller"
    69  	NodeIpamController                           = "node-ipam-controller"
    70  	NodeLifecycleController                      = "node-lifecycle-controller"
    71  	TaintEvictionController                      = "taint-eviction-controller"
    72  	PersistentVolumeBinderController             = "persistentvolume-binder-controller"
    73  	PersistentVolumeAttachDetachController       = "persistentvolume-attach-detach-controller"
    74  	PersistentVolumeExpanderController           = "persistentvolume-expander-controller"
    75  	ClusterRoleAggregationController             = "clusterrole-aggregation-controller"
    76  	PersistentVolumeClaimProtectionController    = "persistentvolumeclaim-protection-controller"
    77  	PersistentVolumeProtectionController         = "persistentvolume-protection-controller"
    78  	TTLAfterFinishedController                   = "ttl-after-finished-controller"
    79  	RootCACertificatePublisherController         = "root-ca-certificate-publisher-controller"
    80  	EphemeralVolumeController                    = "ephemeral-volume-controller"
    81  	StorageVersionGarbageCollectorController     = "storageversion-garbage-collector-controller"
    82  	ResourceClaimController                      = "resourceclaim-controller"
    83  	LegacyServiceAccountTokenCleanerController   = "legacy-serviceaccount-token-cleaner-controller"
    84  	ValidatingAdmissionPolicyStatusController    = "validatingadmissionpolicy-status-controller"
    85  	ServiceCIDRController                        = "service-cidr-controller"
    86  	StorageVersionMigratorController             = "storage-version-migrator-controller"
    87  )
    88  

View as plain text