Merge pull request #66993 from luxas/cleanup_componentconfig_types

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Refactor the kube-controller-manager ComponentConfig structs

**What this PR does / why we need it**:

This PR cleans up the kube-controller-manager structs in the componentconfig package and fixes various structural issues in the current code, in order to make it possible to later move the code out to external API groups (as a starting point `GenericControllerManagerConfiguration` to `k8s.io/controller-manager`).

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref: https://github.com/kubernetes/community/pull/2354

This PR depends on:
 - [x] https://github.com/kubernetes/kubernetes/pull/67149
 - [x] https://github.com/kubernetes/kubernetes/pull/67090
 - [x] https://github.com/kubernetes/kubernetes/pull/67159
 - [x] https://github.com/kubernetes/kubernetes/pull/67207
 - [x] https://github.com/kubernetes/kubernetes/pull/66722

**Special notes for your reviewer**:

Please only review the following commits:
 - **Refactor the k-c-m ComponentConfig structs to they can be moved out**
 - **Fixup cmd/kube-controller-manager code after struct changes.**

**Release note**:

```release-note
NONE
```
/assign @sttts @stewart-yu @liggitt @thockin
This commit is contained in:
Kubernetes Submit Queue 2018-09-02 06:25:11 -07:00 committed by GitHub
commit b8e97d3451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 521 additions and 537 deletions

View File

@ -62,9 +62,7 @@ API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alp
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CSRSigningControllerConfiguration,ClusterSigningCertFile API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CSRSigningControllerConfiguration,ClusterSigningCertFile
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CSRSigningControllerConfiguration,ClusterSigningKeyFile API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CSRSigningControllerConfiguration,ClusterSigningKeyFile
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CSRSigningControllerConfiguration,ClusterSigningDuration API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CSRSigningControllerConfiguration,ClusterSigningDuration
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CloudControllerManagerConfiguration,CloudProvider API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CloudControllerManagerConfiguration,Generic
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CloudControllerManagerConfiguration,Debugging
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CloudControllerManagerConfiguration,GenericComponent
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CloudControllerManagerConfiguration,KubeCloudShared API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CloudControllerManagerConfiguration,KubeCloudShared
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CloudControllerManagerConfiguration,ServiceController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CloudControllerManagerConfiguration,ServiceController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CloudControllerManagerConfiguration,NodeStatusUpdateFrequency API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CloudControllerManagerConfiguration,NodeStatusUpdateFrequency
@ -76,16 +74,18 @@ API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alp
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,DeprecatedControllerConfiguration,DeletingPodsQps API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,DeprecatedControllerConfiguration,DeletingPodsQps
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,DeprecatedControllerConfiguration,DeletingPodsBurst API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,DeprecatedControllerConfiguration,DeletingPodsBurst
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,DeprecatedControllerConfiguration,RegisterRetryCount API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,DeprecatedControllerConfiguration,RegisterRetryCount
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,EndPointControllerConfiguration,ConcurrentEndpointSyncs API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,EndpointControllerConfiguration,ConcurrentEndpointSyncs
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GarbageCollectorControllerConfiguration,EnableGarbageCollector API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GarbageCollectorControllerConfiguration,EnableGarbageCollector
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GarbageCollectorControllerConfiguration,ConcurrentGCSyncs API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GarbageCollectorControllerConfiguration,ConcurrentGCSyncs
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GarbageCollectorControllerConfiguration,GCIgnoredResources API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GarbageCollectorControllerConfiguration,GCIgnoredResources
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericComponentConfiguration,MinResyncPeriod API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericControllerManagerConfiguration,Port
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericComponentConfiguration,ContentType API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericControllerManagerConfiguration,Address
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericComponentConfiguration,KubeAPIQPS API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericControllerManagerConfiguration,MinResyncPeriod
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericComponentConfiguration,KubeAPIBurst API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericControllerManagerConfiguration,ClientConnection
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericComponentConfiguration,ControllerStartInterval API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericControllerManagerConfiguration,ControllerStartInterval
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericComponentConfiguration,LeaderElection API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericControllerManagerConfiguration,LeaderElection
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericControllerManagerConfiguration,Controllers
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GenericControllerManagerConfiguration,Debugging
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GroupResource,Group API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GroupResource,Group
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GroupResource,Resource API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,GroupResource,Resource
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,HPAControllerConfiguration,HorizontalPodAutoscalerSyncPeriod API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,HPAControllerConfiguration,HorizontalPodAutoscalerSyncPeriod
@ -96,8 +96,8 @@ API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alp
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,HPAControllerConfiguration,HorizontalPodAutoscalerCPUInitializationPeriod API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,HPAControllerConfiguration,HorizontalPodAutoscalerCPUInitializationPeriod
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,HPAControllerConfiguration,HorizontalPodAutoscalerInitialReadinessDelay API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,HPAControllerConfiguration,HorizontalPodAutoscalerInitialReadinessDelay
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,JobControllerConfiguration,ConcurrentJobSyncs API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,JobControllerConfiguration,ConcurrentJobSyncs
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,Port API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,CloudProvider
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,Address API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,ExternalCloudVolumePlugin
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,UseServiceAccountCredentials API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,UseServiceAccountCredentials
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,AllowUntaggedCloud API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,AllowUntaggedCloud
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,RouteReconciliationPeriod API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,RouteReconciliationPeriod
@ -108,21 +108,19 @@ API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alp
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,CIDRAllocatorType API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,CIDRAllocatorType
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,ConfigureCloudRoutes API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,ConfigureCloudRoutes
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,NodeSyncPeriod API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeCloudSharedConfiguration,NodeSyncPeriod
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,CloudProvider API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,Generic
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,Debugging
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,GenericComponent
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,KubeCloudShared API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,KubeCloudShared
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,AttachDetachController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,AttachDetachController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,CSRSigningController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,CSRSigningController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,DaemonSetController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,DaemonSetController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,DeploymentController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,DeploymentController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,DeprecatedController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,DeprecatedController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,EndPointController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,EndpointController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,GarbageCollectorController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,GarbageCollectorController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,HPAController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,HPAController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,JobController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,JobController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,NamespaceController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,NamespaceController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,NodeIpamController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,NodeIPAMController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,NodeLifecycleController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,NodeLifecycleController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,PersistentVolumeBinderController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,PersistentVolumeBinderController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,PodGCController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,PodGCController
@ -131,12 +129,10 @@ API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alp
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,ResourceQuotaController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,ResourceQuotaController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,SAController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,SAController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,ServiceController API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,ServiceController
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,Controllers
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,KubeControllerManagerConfiguration,ExternalCloudVolumePlugin
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NamespaceControllerConfiguration,NamespaceSyncPeriod API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NamespaceControllerConfiguration,NamespaceSyncPeriod
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NamespaceControllerConfiguration,ConcurrentNamespaceSyncs API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NamespaceControllerConfiguration,ConcurrentNamespaceSyncs
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NodeIpamControllerConfiguration,ServiceCIDR API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NodeIPAMControllerConfiguration,ServiceCIDR
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NodeIpamControllerConfiguration,NodeCIDRMaskSize API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NodeIPAMControllerConfiguration,NodeCIDRMaskSize
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NodeLifecycleControllerConfiguration,EnableTaintManager API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NodeLifecycleControllerConfiguration,EnableTaintManager
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NodeLifecycleControllerConfiguration,NodeEvictionRate API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NodeLifecycleControllerConfiguration,NodeEvictionRate
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NodeLifecycleControllerConfiguration,SecondaryNodeEvictionRate API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,NodeLifecycleControllerConfiguration,SecondaryNodeEvictionRate

View File

@ -102,7 +102,7 @@ the cloud specific control loops shipped with Kubernetes.`,
// Run runs the ExternalCMServer. This should never exit. // Run runs the ExternalCMServer. This should never exit.
func Run(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}) error { func Run(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}) error {
cloud, err := cloudprovider.InitCloudProvider(c.ComponentConfig.CloudProvider.Name, c.ComponentConfig.CloudProvider.CloudConfigFile) cloud, err := cloudprovider.InitCloudProvider(c.ComponentConfig.KubeCloudShared.CloudProvider.Name, c.ComponentConfig.KubeCloudShared.CloudProvider.CloudConfigFile)
if err != nil { if err != nil {
glog.Fatalf("Cloud provider could not be initialized: %v", err) glog.Fatalf("Cloud provider could not be initialized: %v", err)
} }
@ -127,14 +127,14 @@ func Run(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}) error
// Start the controller manager HTTP server // Start the controller manager HTTP server
if c.SecureServing != nil { if c.SecureServing != nil {
unsecuredMux := genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Debugging) unsecuredMux := genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Generic.Debugging)
handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, &c.Authorization, &c.Authentication) handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, &c.Authorization, &c.Authentication)
if err := c.SecureServing.Serve(handler, 0, stopCh); err != nil { if err := c.SecureServing.Serve(handler, 0, stopCh); err != nil {
return err return err
} }
} }
if c.InsecureServing != nil { if c.InsecureServing != nil {
unsecuredMux := genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Debugging) unsecuredMux := genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Generic.Debugging)
insecureSuperuserAuthn := server.AuthenticationInfo{Authenticator: &server.InsecureSuperuser{}} insecureSuperuserAuthn := server.AuthenticationInfo{Authenticator: &server.InsecureSuperuser{}}
handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, nil, &insecureSuperuserAuthn) handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, nil, &insecureSuperuserAuthn)
if err := c.InsecureServing.Serve(handler, 0, stopCh); err != nil { if err := c.InsecureServing.Serve(handler, 0, stopCh); err != nil {
@ -148,7 +148,7 @@ func Run(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}) error
} }
} }
if !c.ComponentConfig.GenericComponent.LeaderElection.LeaderElect { if !c.ComponentConfig.Generic.LeaderElection.LeaderElect {
run(context.TODO()) run(context.TODO())
panic("unreachable") panic("unreachable")
} }
@ -162,7 +162,7 @@ func Run(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}) error
id = id + "_" + string(uuid.NewUUID()) id = id + "_" + string(uuid.NewUUID())
// Lock required for leader election // Lock required for leader election
rl, err := resourcelock.New(c.ComponentConfig.GenericComponent.LeaderElection.ResourceLock, rl, err := resourcelock.New(c.ComponentConfig.Generic.LeaderElection.ResourceLock,
"kube-system", "kube-system",
"cloud-controller-manager", "cloud-controller-manager",
c.LeaderElectionClient.CoreV1(), c.LeaderElectionClient.CoreV1(),
@ -177,9 +177,9 @@ func Run(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}) error
// Try and become the leader and start cloud controller manager loops // Try and become the leader and start cloud controller manager loops
leaderelection.RunOrDie(context.TODO(), leaderelection.LeaderElectionConfig{ leaderelection.RunOrDie(context.TODO(), leaderelection.LeaderElectionConfig{
Lock: rl, Lock: rl,
LeaseDuration: c.ComponentConfig.GenericComponent.LeaderElection.LeaseDuration.Duration, LeaseDuration: c.ComponentConfig.Generic.LeaderElection.LeaseDuration.Duration,
RenewDeadline: c.ComponentConfig.GenericComponent.LeaderElection.RenewDeadline.Duration, RenewDeadline: c.ComponentConfig.Generic.LeaderElection.RenewDeadline.Duration,
RetryPeriod: c.ComponentConfig.GenericComponent.LeaderElection.RetryPeriod.Duration, RetryPeriod: c.ComponentConfig.Generic.LeaderElection.RetryPeriod.Duration,
Callbacks: leaderelection.LeaderCallbacks{ Callbacks: leaderelection.LeaderCallbacks{
OnStartedLeading: run, OnStartedLeading: run,
OnStoppedLeading: func() { OnStoppedLeading: func() {
@ -208,12 +208,12 @@ func startControllers(c *cloudcontrollerconfig.CompletedConfig, stop <-chan stru
c.ComponentConfig.NodeStatusUpdateFrequency.Duration) c.ComponentConfig.NodeStatusUpdateFrequency.Duration)
nodeController.Run(stop) nodeController.Run(stop)
time.Sleep(wait.Jitter(c.ComponentConfig.GenericComponent.ControllerStartInterval.Duration, ControllerStartJitter)) time.Sleep(wait.Jitter(c.ComponentConfig.Generic.ControllerStartInterval.Duration, ControllerStartJitter))
// Start the PersistentVolumeLabelController // Start the PersistentVolumeLabelController
pvlController := cloudcontrollers.NewPersistentVolumeLabelController(client("pvl-controller"), cloud) pvlController := cloudcontrollers.NewPersistentVolumeLabelController(client("pvl-controller"), cloud)
go pvlController.Run(5, stop) go pvlController.Run(5, stop)
time.Sleep(wait.Jitter(c.ComponentConfig.GenericComponent.ControllerStartInterval.Duration, ControllerStartJitter)) time.Sleep(wait.Jitter(c.ComponentConfig.Generic.ControllerStartInterval.Duration, ControllerStartJitter))
// Start the service controller // Start the service controller
serviceController, err := servicecontroller.New( serviceController, err := servicecontroller.New(
@ -227,7 +227,7 @@ func startControllers(c *cloudcontrollerconfig.CompletedConfig, stop <-chan stru
glog.Errorf("Failed to start service controller: %v", err) glog.Errorf("Failed to start service controller: %v", err)
} else { } else {
go serviceController.Run(stop, int(c.ComponentConfig.ServiceController.ConcurrentServiceSyncs)) go serviceController.Run(stop, int(c.ComponentConfig.ServiceController.ConcurrentServiceSyncs))
time.Sleep(wait.Jitter(c.ComponentConfig.GenericComponent.ControllerStartInterval.Duration, ControllerStartJitter)) time.Sleep(wait.Jitter(c.ComponentConfig.Generic.ControllerStartInterval.Duration, ControllerStartJitter))
} }
// If CIDRs should be allocated for pods and set on the CloudProvider, then start the route controller // If CIDRs should be allocated for pods and set on the CloudProvider, then start the route controller
@ -245,7 +245,7 @@ func startControllers(c *cloudcontrollerconfig.CompletedConfig, stop <-chan stru
routeController := routecontroller.New(routes, client("route-controller"), c.SharedInformers.Core().V1().Nodes(), c.ComponentConfig.KubeCloudShared.ClusterName, clusterCIDR) routeController := routecontroller.New(routes, client("route-controller"), c.SharedInformers.Core().V1().Nodes(), c.ComponentConfig.KubeCloudShared.ClusterName, clusterCIDR)
go routeController.Run(stop, c.ComponentConfig.KubeCloudShared.RouteReconciliationPeriod.Duration) go routeController.Run(stop, c.ComponentConfig.KubeCloudShared.RouteReconciliationPeriod.Duration)
time.Sleep(wait.Jitter(c.ComponentConfig.GenericComponent.ControllerStartInterval.Duration, ControllerStartJitter)) time.Sleep(wait.Jitter(c.ComponentConfig.Generic.ControllerStartInterval.Duration, ControllerStartJitter))
} }
} else { } else {
glog.Infof("Will not configure cloud provider routes for allocate-node-cidrs: %v, configure-cloud-routes: %v.", c.ComponentConfig.KubeCloudShared.AllocateNodeCIDRs, c.ComponentConfig.KubeCloudShared.ConfigureCloudRoutes) glog.Infof("Will not configure cloud provider routes for allocate-node-cidrs: %v, configure-cloud-routes: %v.", c.ComponentConfig.KubeCloudShared.AllocateNodeCIDRs, c.ComponentConfig.KubeCloudShared.ConfigureCloudRoutes)

View File

@ -55,6 +55,7 @@ go_test(
embed = [":go_default_library"], embed = [":go_default_library"],
deps = [ deps = [
"//cmd/controller-manager/app/options:go_default_library", "//cmd/controller-manager/app/options:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library",

View File

@ -55,9 +55,7 @@ const (
// CloudControllerManagerOptions is the main context object for the controller manager. // CloudControllerManagerOptions is the main context object for the controller manager.
type CloudControllerManagerOptions struct { type CloudControllerManagerOptions struct {
CloudProvider *cmoptions.CloudProviderOptions Generic *cmoptions.GenericControllerManagerConfigurationOptions
Debugging *cmoptions.DebuggingOptions
GenericComponent *cmoptions.GenericComponentConfigOptions
KubeCloudShared *cmoptions.KubeCloudSharedOptions KubeCloudShared *cmoptions.KubeCloudSharedOptions
ServiceController *cmoptions.ServiceControllerOptions ServiceController *cmoptions.ServiceControllerOptions
@ -82,17 +80,15 @@ func NewCloudControllerManagerOptions() (*CloudControllerManagerOptions, error)
} }
s := CloudControllerManagerOptions{ s := CloudControllerManagerOptions{
CloudProvider: &cmoptions.CloudProviderOptions{}, Generic: cmoptions.NewGenericControllerManagerConfigurationOptions(componentConfig.Generic),
Debugging: &cmoptions.DebuggingOptions{}, KubeCloudShared: cmoptions.NewKubeCloudSharedOptions(componentConfig.KubeCloudShared),
GenericComponent: cmoptions.NewGenericComponentConfigOptions(componentConfig.GenericComponent),
KubeCloudShared: cmoptions.NewKubeCloudSharedOptions(componentConfig.KubeCloudShared),
ServiceController: &cmoptions.ServiceControllerOptions{ ServiceController: &cmoptions.ServiceControllerOptions{
ConcurrentServiceSyncs: componentConfig.ServiceController.ConcurrentServiceSyncs, ConcurrentServiceSyncs: componentConfig.ServiceController.ConcurrentServiceSyncs,
}, },
SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(), SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(),
InsecureServing: (&apiserveroptions.DeprecatedInsecureServingOptions{ InsecureServing: (&apiserveroptions.DeprecatedInsecureServingOptions{
BindAddress: net.ParseIP(componentConfig.KubeCloudShared.Address), BindAddress: net.ParseIP(componentConfig.Generic.Address),
BindPort: int(componentConfig.KubeCloudShared.Port), BindPort: int(componentConfig.Generic.Port),
BindNetwork: "tcp", BindNetwork: "tcp",
}).WithLoopback(), }).WithLoopback(),
Authentication: apiserveroptions.NewDelegatingAuthenticationOptions(), Authentication: apiserveroptions.NewDelegatingAuthenticationOptions(),
@ -112,31 +108,35 @@ func NewCloudControllerManagerOptions() (*CloudControllerManagerOptions, error)
} }
// NewDefaultComponentConfig returns cloud-controller manager configuration object. // NewDefaultComponentConfig returns cloud-controller manager configuration object.
func NewDefaultComponentConfig(insecurePort int32) (componentconfig.CloudControllerManagerConfiguration, error) { func NewDefaultComponentConfig(insecurePort int32) (*componentconfig.CloudControllerManagerConfiguration, error) {
// TODO: This code will be fixed up/improved when the ccm API types are moved to their own, real API group out of
// pkg/apis/componentconfig to cmd/cloud-controller-manager/app/apis/
scheme := runtime.NewScheme() scheme := runtime.NewScheme()
if err := componentconfigv1alpha1.AddToScheme(scheme); err != nil { if err := componentconfigv1alpha1.AddToScheme(scheme); err != nil {
return componentconfig.CloudControllerManagerConfiguration{}, err return nil, err
} }
if err := componentconfig.AddToScheme(scheme); err != nil { if err := componentconfig.AddToScheme(scheme); err != nil {
return componentconfig.CloudControllerManagerConfiguration{}, err return nil, err
} }
scheme.AddKnownTypes(componentconfigv1alpha1.SchemeGroupVersion, &componentconfigv1alpha1.CloudControllerManagerConfiguration{})
scheme.AddKnownTypes(componentconfig.SchemeGroupVersion, &componentconfig.CloudControllerManagerConfiguration{})
versioned := componentconfigv1alpha1.CloudControllerManagerConfiguration{} versioned := &componentconfigv1alpha1.CloudControllerManagerConfiguration{}
scheme.Default(&versioned) internal := &componentconfig.CloudControllerManagerConfiguration{}
scheme.Default(versioned)
internal := componentconfig.CloudControllerManagerConfiguration{} if err := scheme.Convert(versioned, internal, nil); err != nil {
if err := scheme.Convert(&versioned, &internal, nil); err != nil {
return internal, err return internal, err
} }
internal.KubeCloudShared.Port = insecurePort internal.Generic.Port = insecurePort
return internal, nil return internal, nil
} }
// Flags returns flags for a specific APIServer by section name // Flags returns flags for a specific APIServer by section name
func (o *CloudControllerManagerOptions) Flags() (fss apiserverflag.NamedFlagSets) { func (o *CloudControllerManagerOptions) Flags() apiserverflag.NamedFlagSets {
o.CloudProvider.AddFlags(fss.FlagSet("cloud provider")) fss := apiserverflag.NamedFlagSets{}
o.Debugging.AddFlags(fss.FlagSet("debugging")) o.Generic.AddFlags(&fss, []string{}, []string{})
o.GenericComponent.AddFlags(fss.FlagSet("generic")) // TODO: Implement the --controllers flag fully for the ccm
fss.FlagSet("generic").MarkHidden("controllers")
o.KubeCloudShared.AddFlags(fss.FlagSet("generic")) o.KubeCloudShared.AddFlags(fss.FlagSet("generic"))
o.ServiceController.AddFlags(fss.FlagSet("service controller")) o.ServiceController.AddFlags(fss.FlagSet("service controller"))
@ -158,13 +158,7 @@ func (o *CloudControllerManagerOptions) Flags() (fss apiserverflag.NamedFlagSets
// ApplyTo fills up cloud controller manager config with options. // ApplyTo fills up cloud controller manager config with options.
func (o *CloudControllerManagerOptions) ApplyTo(c *cloudcontrollerconfig.Config, userAgent string) error { func (o *CloudControllerManagerOptions) ApplyTo(c *cloudcontrollerconfig.Config, userAgent string) error {
var err error var err error
if err = o.CloudProvider.ApplyTo(&c.ComponentConfig.CloudProvider); err != nil { if err = o.Generic.ApplyTo(&c.ComponentConfig.Generic); err != nil {
return err
}
if err = o.Debugging.ApplyTo(&c.ComponentConfig.Debugging); err != nil {
return err
}
if err = o.GenericComponent.ApplyTo(&c.ComponentConfig.GenericComponent); err != nil {
return err return err
} }
if err = o.KubeCloudShared.ApplyTo(&c.ComponentConfig.KubeCloudShared); err != nil { if err = o.KubeCloudShared.ApplyTo(&c.ComponentConfig.KubeCloudShared); err != nil {
@ -192,9 +186,9 @@ func (o *CloudControllerManagerOptions) ApplyTo(c *cloudcontrollerconfig.Config,
if err != nil { if err != nil {
return err return err
} }
c.Kubeconfig.ContentConfig.ContentType = o.GenericComponent.ContentType c.Kubeconfig.ContentConfig.ContentType = o.Generic.ClientConnection.ContentType
c.Kubeconfig.QPS = o.GenericComponent.KubeAPIQPS c.Kubeconfig.QPS = o.Generic.ClientConnection.QPS
c.Kubeconfig.Burst = int(o.GenericComponent.KubeAPIBurst) c.Kubeconfig.Burst = int(o.Generic.ClientConnection.Burst)
c.Client, err = clientset.NewForConfig(restclient.AddUserAgent(c.Kubeconfig, userAgent)) c.Client, err = clientset.NewForConfig(restclient.AddUserAgent(c.Kubeconfig, userAgent))
if err != nil { if err != nil {
@ -213,7 +207,7 @@ func (o *CloudControllerManagerOptions) ApplyTo(c *cloudcontrollerconfig.Config,
ClientConfig: restclient.AnonymousClientConfig(c.Kubeconfig), ClientConfig: restclient.AnonymousClientConfig(c.Kubeconfig),
CoreClient: c.Client.CoreV1(), CoreClient: c.Client.CoreV1(),
AuthenticationClient: c.Client.AuthenticationV1(), AuthenticationClient: c.Client.AuthenticationV1(),
Namespace: "kube-system", Namespace: metav1.NamespaceSystem,
} }
} else { } else {
c.ClientBuilder = rootClientBuilder c.ClientBuilder = rootClientBuilder
@ -223,8 +217,8 @@ func (o *CloudControllerManagerOptions) ApplyTo(c *cloudcontrollerconfig.Config,
// sync back to component config // sync back to component config
// TODO: find more elegant way than syncing back the values. // TODO: find more elegant way than syncing back the values.
c.ComponentConfig.KubeCloudShared.Port = int32(o.InsecureServing.BindPort) c.ComponentConfig.Generic.Port = int32(o.InsecureServing.BindPort)
c.ComponentConfig.KubeCloudShared.Address = o.InsecureServing.BindAddress.String() c.ComponentConfig.Generic.Address = o.InsecureServing.BindAddress.String()
c.ComponentConfig.NodeStatusUpdateFrequency = o.NodeStatusUpdateFrequency c.ComponentConfig.NodeStatusUpdateFrequency = o.NodeStatusUpdateFrequency
@ -235,9 +229,7 @@ func (o *CloudControllerManagerOptions) ApplyTo(c *cloudcontrollerconfig.Config,
func (o *CloudControllerManagerOptions) Validate() error { func (o *CloudControllerManagerOptions) Validate() error {
errors := []error{} errors := []error{}
errors = append(errors, o.CloudProvider.Validate()...) errors = append(errors, o.Generic.Validate(nil, nil)...)
errors = append(errors, o.Debugging.Validate()...)
errors = append(errors, o.GenericComponent.Validate()...)
errors = append(errors, o.KubeCloudShared.Validate()...) errors = append(errors, o.KubeCloudShared.Validate()...)
errors = append(errors, o.ServiceController.Validate()...) errors = append(errors, o.ServiceController.Validate()...)
errors = append(errors, o.SecureServing.Validate()...) errors = append(errors, o.SecureServing.Validate()...)
@ -245,7 +237,7 @@ func (o *CloudControllerManagerOptions) Validate() error {
errors = append(errors, o.Authentication.Validate()...) errors = append(errors, o.Authentication.Validate()...)
errors = append(errors, o.Authorization.Validate()...) errors = append(errors, o.Authorization.Validate()...)
if len(o.CloudProvider.Name) == 0 { if len(o.KubeCloudShared.CloudProvider.Name) == 0 {
errors = append(errors, fmt.Errorf("--cloud-provider cannot be empty")) errors = append(errors, fmt.Errorf("--cloud-provider cannot be empty"))
} }
@ -256,7 +248,7 @@ func (o *CloudControllerManagerOptions) Validate() error {
func resyncPeriod(c *cloudcontrollerconfig.Config) func() time.Duration { func resyncPeriod(c *cloudcontrollerconfig.Config) func() time.Duration {
return func() time.Duration { return func() time.Duration {
factor := rand.Float64() + 1 factor := rand.Float64() + 1
return time.Duration(float64(c.ComponentConfig.GenericComponent.MinResyncPeriod.Nanoseconds()) * factor) return time.Duration(float64(c.ComponentConfig.Generic.MinResyncPeriod.Nanoseconds()) * factor)
} }
} }

View File

@ -24,6 +24,7 @@ import (
"github.com/spf13/pflag" "github.com/spf13/pflag"
apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/diff" "k8s.io/apimachinery/pkg/util/diff"
apiserverconfig "k8s.io/apiserver/pkg/apis/config" apiserverconfig "k8s.io/apiserver/pkg/apis/config"
@ -35,18 +36,15 @@ func TestDefaultFlags(t *testing.T) {
s, _ := NewCloudControllerManagerOptions() s, _ := NewCloudControllerManagerOptions()
expected := &CloudControllerManagerOptions{ expected := &CloudControllerManagerOptions{
CloudProvider: &cmoptions.CloudProviderOptions{ Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
Name: "", Port: 10253, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
CloudConfigFile: "", Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
}, MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour},
Debugging: &cmoptions.DebuggingOptions{ ClientConnection: apimachineryconfig.ClientConnectionConfiguration{
EnableContentionProfiling: false, ContentType: "application/vnd.kubernetes.protobuf",
}, QPS: 20.0,
GenericComponent: &cmoptions.GenericComponentConfigOptions{ Burst: 30,
MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour}, },
ContentType: "application/vnd.kubernetes.protobuf",
KubeAPIQPS: 20.0,
KubeAPIBurst: 30,
ControllerStartInterval: metav1.Duration{Duration: 0}, ControllerStartInterval: metav1.Duration{Duration: 0},
LeaderElection: apiserverconfig.LeaderElectionConfiguration{ LeaderElection: apiserverconfig.LeaderElectionConfiguration{
ResourceLock: "endpoints", ResourceLock: "endpoints",
@ -55,10 +53,12 @@ func TestDefaultFlags(t *testing.T) {
RenewDeadline: metav1.Duration{Duration: 10 * time.Second}, RenewDeadline: metav1.Duration{Duration: 10 * time.Second},
RetryPeriod: metav1.Duration{Duration: 2 * time.Second}, RetryPeriod: metav1.Duration{Duration: 2 * time.Second},
}, },
Debugging: &cmoptions.DebuggingOptions{
EnableContentionProfiling: false,
},
Controllers: []string{"*"},
}, },
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{ KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
Port: 10253, // Note: DeprecatedInsecureServingOptions.ApplyTo will write the flag value back into the component config
Address: "0.0.0.0", // Note: DeprecatedInsecureServingOptions.ApplyTo will write the flag value back into the component config
RouteReconciliationPeriod: metav1.Duration{Duration: 10 * time.Second}, RouteReconciliationPeriod: metav1.Duration{Duration: 10 * time.Second},
NodeMonitorPeriod: metav1.Duration{Duration: 5 * time.Second}, NodeMonitorPeriod: metav1.Duration{Duration: 5 * time.Second},
ClusterName: "kubernetes", ClusterName: "kubernetes",
@ -66,6 +66,10 @@ func TestDefaultFlags(t *testing.T) {
AllocateNodeCIDRs: false, AllocateNodeCIDRs: false,
CIDRAllocatorType: "", CIDRAllocatorType: "",
ConfigureCloudRoutes: true, ConfigureCloudRoutes: true,
CloudProvider: &cmoptions.CloudProviderOptions{
Name: "",
CloudConfigFile: "",
},
}, },
ServiceController: &cmoptions.ServiceControllerOptions{ ServiceController: &cmoptions.ServiceControllerOptions{
ConcurrentServiceSyncs: 1, ConcurrentServiceSyncs: 1,
@ -150,18 +154,15 @@ func TestAddFlags(t *testing.T) {
fs.Parse(args) fs.Parse(args)
expected := &CloudControllerManagerOptions{ expected := &CloudControllerManagerOptions{
CloudProvider: &cmoptions.CloudProviderOptions{ Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
Name: "gce", Port: 10253, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
CloudConfigFile: "/cloud-config", Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
}, MinResyncPeriod: metav1.Duration{Duration: 100 * time.Minute},
Debugging: &cmoptions.DebuggingOptions{ ClientConnection: apimachineryconfig.ClientConnectionConfiguration{
EnableContentionProfiling: true, ContentType: "application/vnd.kubernetes.protobuf",
}, QPS: 50.0,
GenericComponent: &cmoptions.GenericComponentConfigOptions{ Burst: 100,
MinResyncPeriod: metav1.Duration{Duration: 100 * time.Minute}, },
ContentType: "application/vnd.kubernetes.protobuf",
KubeAPIQPS: 50.0,
KubeAPIBurst: 100,
ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute}, ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute},
LeaderElection: apiserverconfig.LeaderElectionConfiguration{ LeaderElection: apiserverconfig.LeaderElectionConfiguration{
ResourceLock: "configmap", ResourceLock: "configmap",
@ -170,10 +171,16 @@ func TestAddFlags(t *testing.T) {
RenewDeadline: metav1.Duration{Duration: 15 * time.Second}, RenewDeadline: metav1.Duration{Duration: 15 * time.Second},
RetryPeriod: metav1.Duration{Duration: 5 * time.Second}, RetryPeriod: metav1.Duration{Duration: 5 * time.Second},
}, },
Debugging: &cmoptions.DebuggingOptions{
EnableContentionProfiling: true,
},
Controllers: []string{"*"},
}, },
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{ KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
Port: 10253, // Note: DeprecatedInsecureServingOptions.ApplyTo will write the flag value back into the component config CloudProvider: &cmoptions.CloudProviderOptions{
Address: "0.0.0.0", // Note: DeprecatedInsecureServingOptions.ApplyTo will write the flag value back into the component config Name: "gce",
CloudConfigFile: "/cloud-config",
},
RouteReconciliationPeriod: metav1.Duration{Duration: 30 * time.Second}, RouteReconciliationPeriod: metav1.Duration{Duration: 30 * time.Second},
NodeMonitorPeriod: metav1.Duration{Duration: 5 * time.Second}, NodeMonitorPeriod: metav1.Duration{Duration: 5 * time.Second},
ClusterName: "k8s", ClusterName: "k8s",

View File

@ -14,8 +14,11 @@ go_library(
deps = [ deps = [
"//pkg/apis/componentconfig:go_default_library", "//pkg/apis/componentconfig:go_default_library",
"//pkg/client/leaderelectionconfig:go_default_library", "//pkg/client/leaderelectionconfig:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/flag:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library",
], ],
) )

View File

@ -17,77 +17,112 @@ limitations under the License.
package options package options
import ( import (
"github.com/spf13/pflag" "fmt"
"strings"
apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
apiserverconfig "k8s.io/apiserver/pkg/apis/config" apiserverconfig "k8s.io/apiserver/pkg/apis/config"
apiserverflag "k8s.io/apiserver/pkg/util/flag"
"k8s.io/kubernetes/pkg/apis/componentconfig" "k8s.io/kubernetes/pkg/apis/componentconfig"
"k8s.io/kubernetes/pkg/client/leaderelectionconfig" "k8s.io/kubernetes/pkg/client/leaderelectionconfig"
) )
// GenericComponentConfigOptions holds the options which are generic. // GenericControllerManagerConfigurationOptions holds the options which are generic.
type GenericComponentConfigOptions struct { type GenericControllerManagerConfigurationOptions struct {
Port int32
Address string
MinResyncPeriod metav1.Duration MinResyncPeriod metav1.Duration
ContentType string ClientConnection apimachineryconfig.ClientConnectionConfiguration
KubeAPIQPS float32
KubeAPIBurst int32
ControllerStartInterval metav1.Duration ControllerStartInterval metav1.Duration
LeaderElection apiserverconfig.LeaderElectionConfiguration LeaderElection apiserverconfig.LeaderElectionConfiguration
Debugging *DebuggingOptions
Controllers []string
} }
// NewGenericComponentConfigOptions returns generic configuration default values for both // NewGenericControllerManagerConfigurationOptions returns generic configuration default values for both
// the kube-controller-manager and the cloud-contoller-manager. Any common changes should // the kube-controller-manager and the cloud-contoller-manager. Any common changes should
// be made here. Any individual changes should be made in that controller. // be made here. Any individual changes should be made in that controller.
func NewGenericComponentConfigOptions(cfg componentconfig.GenericComponentConfiguration) *GenericComponentConfigOptions { func NewGenericControllerManagerConfigurationOptions(cfg componentconfig.GenericControllerManagerConfiguration) *GenericControllerManagerConfigurationOptions {
o := &GenericComponentConfigOptions{ o := &GenericControllerManagerConfigurationOptions{
Port: cfg.Port,
Address: cfg.Address,
MinResyncPeriod: cfg.MinResyncPeriod, MinResyncPeriod: cfg.MinResyncPeriod,
ContentType: cfg.ContentType, ClientConnection: cfg.ClientConnection,
KubeAPIQPS: cfg.KubeAPIQPS,
KubeAPIBurst: cfg.KubeAPIBurst,
ControllerStartInterval: cfg.ControllerStartInterval, ControllerStartInterval: cfg.ControllerStartInterval,
LeaderElection: cfg.LeaderElection, LeaderElection: cfg.LeaderElection,
Debugging: &DebuggingOptions{},
Controllers: cfg.Controllers,
} }
return o return o
} }
// AddFlags adds flags related to generic for controller manager to the specified FlagSet. // AddFlags adds flags related to generic for controller manager to the specified FlagSet.
func (o *GenericComponentConfigOptions) AddFlags(fs *pflag.FlagSet) { func (o *GenericControllerManagerConfigurationOptions) AddFlags(fss *apiserverflag.NamedFlagSets, allControllers, disabledByDefaultControllers []string) {
if o == nil { if o == nil {
return return
} }
fs.DurationVar(&o.MinResyncPeriod.Duration, "min-resync-period", o.MinResyncPeriod.Duration, "The resync period in reflectors will be random between MinResyncPeriod and 2*MinResyncPeriod.") o.Debugging.AddFlags(fss.FlagSet("debugging"))
fs.StringVar(&o.ContentType, "kube-api-content-type", o.ContentType, "Content type of requests sent to apiserver.") genericfs := fss.FlagSet("generic")
fs.Float32Var(&o.KubeAPIQPS, "kube-api-qps", o.KubeAPIQPS, "QPS to use while talking with kubernetes apiserver.") genericfs.DurationVar(&o.MinResyncPeriod.Duration, "min-resync-period", o.MinResyncPeriod.Duration, "The resync period in reflectors will be random between MinResyncPeriod and 2*MinResyncPeriod.")
fs.Int32Var(&o.KubeAPIBurst, "kube-api-burst", o.KubeAPIBurst, "Burst to use while talking with kubernetes apiserver.") genericfs.StringVar(&o.ClientConnection.ContentType, "kube-api-content-type", o.ClientConnection.ContentType, "Content type of requests sent to apiserver.")
fs.DurationVar(&o.ControllerStartInterval.Duration, "controller-start-interval", o.ControllerStartInterval.Duration, "Interval between starting controller managers.") genericfs.Float32Var(&o.ClientConnection.QPS, "kube-api-qps", o.ClientConnection.QPS, "QPS to use while talking with kubernetes apiserver.")
genericfs.Int32Var(&o.ClientConnection.Burst, "kube-api-burst", o.ClientConnection.Burst, "Burst to use while talking with kubernetes apiserver.")
genericfs.DurationVar(&o.ControllerStartInterval.Duration, "controller-start-interval", o.ControllerStartInterval.Duration, "Interval between starting controller managers.")
// TODO: complete the work of the cloud-controller-manager (and possibly other consumers of this code) respecting the --controllers flag
genericfs.StringSliceVar(&o.Controllers, "controllers", o.Controllers, fmt.Sprintf(""+
"A list of controllers to enable. '*' enables all on-by-default controllers, 'foo' enables the controller "+
"named 'foo', '-foo' disables the controller named 'foo'.\nAll controllers: %s\nDisabled-by-default controllers: %s",
strings.Join(allControllers, ", "), strings.Join(disabledByDefaultControllers, ", ")))
leaderelectionconfig.BindFlags(&o.LeaderElection, fs) leaderelectionconfig.BindFlags(&o.LeaderElection, genericfs)
} }
// ApplyTo fills up generic config with options. // ApplyTo fills up generic config with options.
func (o *GenericComponentConfigOptions) ApplyTo(cfg *componentconfig.GenericComponentConfiguration) error { func (o *GenericControllerManagerConfigurationOptions) ApplyTo(cfg *componentconfig.GenericControllerManagerConfiguration) error {
if o == nil { if o == nil {
return nil return nil
} }
if err := o.Debugging.ApplyTo(&cfg.Debugging); err != nil {
return err
}
cfg.Port = o.Port
cfg.Address = o.Address
cfg.MinResyncPeriod = o.MinResyncPeriod cfg.MinResyncPeriod = o.MinResyncPeriod
cfg.ContentType = o.ContentType cfg.ClientConnection = o.ClientConnection
cfg.KubeAPIQPS = o.KubeAPIQPS
cfg.KubeAPIBurst = o.KubeAPIBurst
cfg.ControllerStartInterval = o.ControllerStartInterval cfg.ControllerStartInterval = o.ControllerStartInterval
cfg.LeaderElection = o.LeaderElection cfg.LeaderElection = o.LeaderElection
cfg.Controllers = o.Controllers
return nil return nil
} }
// Validate checks validation of GenericOptions. // Validate checks validation of GenericOptions.
func (o *GenericComponentConfigOptions) Validate() []error { func (o *GenericControllerManagerConfigurationOptions) Validate(allControllers []string, disabledByDefaultControllers []string) []error {
if o == nil { if o == nil {
return nil return nil
} }
errs := []error{} errs := []error{}
errs = append(errs, o.Debugging.Validate()...)
allControllersSet := sets.NewString(allControllers...)
for _, controller := range o.Controllers {
if controller == "*" {
continue
}
if strings.HasPrefix(controller, "-") {
controller = controller[1:]
}
if !allControllersSet.Has(controller) {
errs = append(errs, fmt.Errorf("%q is not in the list of known controllers", controller))
}
}
return errs return errs
} }

View File

@ -26,8 +26,8 @@ import (
// KubeCloudSharedOptions holds the options shared between kube-controller-manager // KubeCloudSharedOptions holds the options shared between kube-controller-manager
// and cloud-controller-manager. // and cloud-controller-manager.
type KubeCloudSharedOptions struct { type KubeCloudSharedOptions struct {
Port int32 CloudProvider *CloudProviderOptions
Address string ExternalCloudVolumePlugin string
UseServiceAccountCredentials bool UseServiceAccountCredentials bool
AllowUntaggedCloud bool AllowUntaggedCloud bool
RouteReconciliationPeriod metav1.Duration RouteReconciliationPeriod metav1.Duration
@ -45,12 +45,13 @@ type KubeCloudSharedOptions struct {
// be made here. Any individual changes should be made in that controller. // be made here. Any individual changes should be made in that controller.
func NewKubeCloudSharedOptions(cfg componentconfig.KubeCloudSharedConfiguration) *KubeCloudSharedOptions { func NewKubeCloudSharedOptions(cfg componentconfig.KubeCloudSharedConfiguration) *KubeCloudSharedOptions {
o := &KubeCloudSharedOptions{ o := &KubeCloudSharedOptions{
Port: cfg.Port, CloudProvider: &CloudProviderOptions{},
Address: cfg.Address, ExternalCloudVolumePlugin: cfg.ExternalCloudVolumePlugin,
RouteReconciliationPeriod: cfg.RouteReconciliationPeriod, UseServiceAccountCredentials: cfg.UseServiceAccountCredentials,
NodeMonitorPeriod: cfg.NodeMonitorPeriod, RouteReconciliationPeriod: cfg.RouteReconciliationPeriod,
ClusterName: cfg.ClusterName, NodeMonitorPeriod: cfg.NodeMonitorPeriod,
ConfigureCloudRoutes: cfg.ConfigureCloudRoutes, ClusterName: cfg.ClusterName,
ConfigureCloudRoutes: cfg.ConfigureCloudRoutes,
} }
return o return o
@ -62,6 +63,8 @@ func (o *KubeCloudSharedOptions) AddFlags(fs *pflag.FlagSet) {
return return
} }
o.CloudProvider.AddFlags(fs)
fs.StringVar(&o.ExternalCloudVolumePlugin, "external-cloud-volume-plugin", o.ExternalCloudVolumePlugin, "The plugin to use when cloud provider is set to external. Can be empty, should only be set when cloud-provider is external. Currently used to allow node and volume controllers to work for in tree cloud providers.")
fs.BoolVar(&o.UseServiceAccountCredentials, "use-service-account-credentials", o.UseServiceAccountCredentials, "If true, use individual service account credentials for each controller.") fs.BoolVar(&o.UseServiceAccountCredentials, "use-service-account-credentials", o.UseServiceAccountCredentials, "If true, use individual service account credentials for each controller.")
fs.BoolVar(&o.AllowUntaggedCloud, "allow-untagged-cloud", false, "Allow the cluster to run without the cluster-id on cloud instances. This is a legacy mode of operation and a cluster-id will be required in the future.") fs.BoolVar(&o.AllowUntaggedCloud, "allow-untagged-cloud", false, "Allow the cluster to run without the cluster-id on cloud instances. This is a legacy mode of operation and a cluster-id will be required in the future.")
fs.MarkDeprecated("allow-untagged-cloud", "This flag is deprecated and will be removed in a future release. A cluster-id will be required on cloud instances.") fs.MarkDeprecated("allow-untagged-cloud", "This flag is deprecated and will be removed in a future release. A cluster-id will be required on cloud instances.")
@ -86,8 +89,10 @@ func (o *KubeCloudSharedOptions) ApplyTo(cfg *componentconfig.KubeCloudSharedCon
return nil return nil
} }
cfg.Port = o.Port if err := o.CloudProvider.ApplyTo(&cfg.CloudProvider); err != nil {
cfg.Address = o.Address return err
}
cfg.ExternalCloudVolumePlugin = o.ExternalCloudVolumePlugin
cfg.UseServiceAccountCredentials = o.UseServiceAccountCredentials cfg.UseServiceAccountCredentials = o.UseServiceAccountCredentials
cfg.AllowUntaggedCloud = o.AllowUntaggedCloud cfg.AllowUntaggedCloud = o.AllowUntaggedCloud
cfg.RouteReconciliationPeriod = o.RouteReconciliationPeriod cfg.RouteReconciliationPeriod = o.RouteReconciliationPeriod
@ -109,5 +114,7 @@ func (o *KubeCloudSharedOptions) Validate() []error {
} }
errs := []error{} errs := []error{}
errs = append(errs, o.CloudProvider.Validate()...)
return errs return errs
} }

View File

@ -133,7 +133,7 @@ controller, and serviceaccounts controller.`,
func ResyncPeriod(c *config.CompletedConfig) func() time.Duration { func ResyncPeriod(c *config.CompletedConfig) func() time.Duration {
return func() time.Duration { return func() time.Duration {
factor := rand.Float64() + 1 factor := rand.Float64() + 1
return time.Duration(float64(c.ComponentConfig.GenericComponent.MinResyncPeriod.Nanoseconds()) * factor) return time.Duration(float64(c.ComponentConfig.Generic.MinResyncPeriod.Nanoseconds()) * factor)
} }
} }
@ -152,14 +152,14 @@ func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error {
// unsecuredMux is the handler for these controller *after* authn/authz filters have been applied // unsecuredMux is the handler for these controller *after* authn/authz filters have been applied
var unsecuredMux *mux.PathRecorderMux var unsecuredMux *mux.PathRecorderMux
if c.SecureServing != nil { if c.SecureServing != nil {
unsecuredMux = genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Debugging) unsecuredMux = genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Generic.Debugging)
handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, &c.Authorization, &c.Authentication) handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, &c.Authorization, &c.Authentication)
if err := c.SecureServing.Serve(handler, 0, stopCh); err != nil { if err := c.SecureServing.Serve(handler, 0, stopCh); err != nil {
return err return err
} }
} }
if c.InsecureServing != nil { if c.InsecureServing != nil {
unsecuredMux = genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Debugging) unsecuredMux = genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Generic.Debugging)
insecureSuperuserAuthn := server.AuthenticationInfo{Authenticator: &server.InsecureSuperuser{}} insecureSuperuserAuthn := server.AuthenticationInfo{Authenticator: &server.InsecureSuperuser{}}
handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, nil, &insecureSuperuserAuthn) handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, nil, &insecureSuperuserAuthn)
if err := c.InsecureServing.Serve(handler, 0, stopCh); err != nil { if err := c.InsecureServing.Serve(handler, 0, stopCh); err != nil {
@ -203,7 +203,7 @@ func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error {
select {} select {}
} }
if !c.ComponentConfig.GenericComponent.LeaderElection.LeaderElect { if !c.ComponentConfig.Generic.LeaderElection.LeaderElect {
run(context.TODO()) run(context.TODO())
panic("unreachable") panic("unreachable")
} }
@ -215,7 +215,7 @@ func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error {
// add a uniquifier so that two processes on the same host don't accidentally both become active // add a uniquifier so that two processes on the same host don't accidentally both become active
id = id + "_" + string(uuid.NewUUID()) id = id + "_" + string(uuid.NewUUID())
rl, err := resourcelock.New(c.ComponentConfig.GenericComponent.LeaderElection.ResourceLock, rl, err := resourcelock.New(c.ComponentConfig.Generic.LeaderElection.ResourceLock,
"kube-system", "kube-system",
"kube-controller-manager", "kube-controller-manager",
c.LeaderElectionClient.CoreV1(), c.LeaderElectionClient.CoreV1(),
@ -229,9 +229,9 @@ func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error {
leaderelection.RunOrDie(context.TODO(), leaderelection.LeaderElectionConfig{ leaderelection.RunOrDie(context.TODO(), leaderelection.LeaderElectionConfig{
Lock: rl, Lock: rl,
LeaseDuration: c.ComponentConfig.GenericComponent.LeaderElection.LeaseDuration.Duration, LeaseDuration: c.ComponentConfig.Generic.LeaderElection.LeaseDuration.Duration,
RenewDeadline: c.ComponentConfig.GenericComponent.LeaderElection.RenewDeadline.Duration, RenewDeadline: c.ComponentConfig.Generic.LeaderElection.RenewDeadline.Duration,
RetryPeriod: c.ComponentConfig.GenericComponent.LeaderElection.RetryPeriod.Duration, RetryPeriod: c.ComponentConfig.Generic.LeaderElection.RetryPeriod.Duration,
Callbacks: leaderelection.LeaderCallbacks{ Callbacks: leaderelection.LeaderCallbacks{
OnStartedLeading: run, OnStartedLeading: run,
OnStoppedLeading: func() { OnStoppedLeading: func() {
@ -283,7 +283,7 @@ type ControllerContext struct {
} }
func (c ControllerContext) IsControllerEnabled(name string) bool { func (c ControllerContext) IsControllerEnabled(name string) bool {
return IsControllerEnabled(name, ControllersDisabledByDefault, c.ComponentConfig.Controllers...) return IsControllerEnabled(name, ControllersDisabledByDefault, c.ComponentConfig.Generic.Controllers...)
} }
func IsControllerEnabled(name string, disabledByDefaultControllers sets.String, controllers ...string) bool { func IsControllerEnabled(name string, disabledByDefaultControllers sets.String, controllers ...string) bool {
@ -436,8 +436,8 @@ func CreateControllerContext(s *config.CompletedConfig, rootClientBuilder, clien
return ControllerContext{}, err return ControllerContext{}, err
} }
cloud, loopMode, err := createCloudProvider(s.ComponentConfig.CloudProvider.Name, s.ComponentConfig.ExternalCloudVolumePlugin, cloud, loopMode, err := createCloudProvider(s.ComponentConfig.KubeCloudShared.CloudProvider.Name, s.ComponentConfig.KubeCloudShared.ExternalCloudVolumePlugin,
s.ComponentConfig.CloudProvider.CloudConfigFile, s.ComponentConfig.KubeCloudShared.AllowUntaggedCloud, sharedInformers) s.ComponentConfig.KubeCloudShared.CloudProvider.CloudConfigFile, s.ComponentConfig.KubeCloudShared.AllowUntaggedCloud, sharedInformers)
if err != nil { if err != nil {
return ControllerContext{}, err return ControllerContext{}, err
} }
@ -476,7 +476,7 @@ func StartControllers(ctx ControllerContext, startSATokenController InitFunc, co
continue continue
} }
time.Sleep(wait.Jitter(ctx.ComponentConfig.GenericComponent.ControllerStartInterval.Duration, ControllerStartJitter)) time.Sleep(wait.Jitter(ctx.ComponentConfig.Generic.ControllerStartInterval.Duration, ControllerStartJitter))
glog.V(1).Infof("Starting %q", controllerName) glog.V(1).Infof("Starting %q", controllerName)
debugHandler, started, err := initFn(ctx) debugHandler, started, err := initFn(ctx)

View File

@ -96,10 +96,10 @@ func startNodeIpamController(ctx ControllerContext) (http.Handler, bool, error)
} }
} }
if len(strings.TrimSpace(ctx.ComponentConfig.NodeIpamController.ServiceCIDR)) != 0 { if len(strings.TrimSpace(ctx.ComponentConfig.NodeIPAMController.ServiceCIDR)) != 0 {
_, serviceCIDR, err = net.ParseCIDR(ctx.ComponentConfig.NodeIpamController.ServiceCIDR) _, serviceCIDR, err = net.ParseCIDR(ctx.ComponentConfig.NodeIPAMController.ServiceCIDR)
if err != nil { if err != nil {
glog.Warningf("Unsuccessful parsing of service CIDR %v: %v", ctx.ComponentConfig.NodeIpamController.ServiceCIDR, err) glog.Warningf("Unsuccessful parsing of service CIDR %v: %v", ctx.ComponentConfig.NodeIPAMController.ServiceCIDR, err)
} }
} }
@ -109,7 +109,7 @@ func startNodeIpamController(ctx ControllerContext) (http.Handler, bool, error)
ctx.ClientBuilder.ClientOrDie("node-controller"), ctx.ClientBuilder.ClientOrDie("node-controller"),
clusterCIDR, clusterCIDR,
serviceCIDR, serviceCIDR,
int(ctx.ComponentConfig.NodeIpamController.NodeCIDRMaskSize), int(ctx.ComponentConfig.NodeIPAMController.NodeCIDRMaskSize),
ipam.CIDRAllocatorType(ctx.ComponentConfig.KubeCloudShared.CIDRAllocatorType), ipam.CIDRAllocatorType(ctx.ComponentConfig.KubeCloudShared.CIDRAllocatorType),
) )
if err != nil { if err != nil {
@ -247,7 +247,7 @@ func startEndpointController(ctx ControllerContext) (http.Handler, bool, error)
ctx.InformerFactory.Core().V1().Services(), ctx.InformerFactory.Core().V1().Services(),
ctx.InformerFactory.Core().V1().Endpoints(), ctx.InformerFactory.Core().V1().Endpoints(),
ctx.ClientBuilder.ClientOrDie("endpoint-controller"), ctx.ClientBuilder.ClientOrDie("endpoint-controller"),
).Run(int(ctx.ComponentConfig.EndPointController.ConcurrentEndpointSyncs), ctx.Stop) ).Run(int(ctx.ComponentConfig.EndpointController.ConcurrentEndpointSyncs), ctx.Stop)
return nil, true, nil return nil, true, nil
} }

View File

@ -43,7 +43,6 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/server/options:go_default_library", "//staging/src/k8s.io/apiserver/pkg/server/options:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/flag:go_default_library", "//staging/src/k8s.io/apiserver/pkg/util/flag:go_default_library",
@ -78,6 +77,7 @@ go_test(
deps = [ deps = [
"//cmd/controller-manager/app/options:go_default_library", "//cmd/controller-manager/app/options:go_default_library",
"//pkg/apis/componentconfig:go_default_library", "//pkg/apis/componentconfig:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library", "//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library",

View File

@ -22,13 +22,13 @@ import (
"k8s.io/kubernetes/pkg/apis/componentconfig" "k8s.io/kubernetes/pkg/apis/componentconfig"
) )
// EndPointControllerOptions holds the EndPointController options. // EndpointControllerOptions holds the EndPointController options.
type EndPointControllerOptions struct { type EndpointControllerOptions struct {
ConcurrentEndpointSyncs int32 ConcurrentEndpointSyncs int32
} }
// AddFlags adds flags related to EndPointController for controller manager to the specified FlagSet. // AddFlags adds flags related to EndPointController for controller manager to the specified FlagSet.
func (o *EndPointControllerOptions) AddFlags(fs *pflag.FlagSet) { func (o *EndpointControllerOptions) AddFlags(fs *pflag.FlagSet) {
if o == nil { if o == nil {
return return
} }
@ -37,7 +37,7 @@ func (o *EndPointControllerOptions) AddFlags(fs *pflag.FlagSet) {
} }
// ApplyTo fills up EndPointController config with options. // ApplyTo fills up EndPointController config with options.
func (o *EndPointControllerOptions) ApplyTo(cfg *componentconfig.EndPointControllerConfiguration) error { func (o *EndpointControllerOptions) ApplyTo(cfg *componentconfig.EndpointControllerConfiguration) error {
if o == nil { if o == nil {
return nil return nil
} }
@ -47,8 +47,8 @@ func (o *EndPointControllerOptions) ApplyTo(cfg *componentconfig.EndPointControl
return nil return nil
} }
// Validate checks validation of EndPointControllerOptions. // Validate checks validation of EndpointControllerOptions.
func (o *EndPointControllerOptions) Validate() []error { func (o *EndpointControllerOptions) Validate() []error {
if o == nil { if o == nil {
return nil return nil
} }

View File

@ -22,14 +22,14 @@ import (
"k8s.io/kubernetes/pkg/apis/componentconfig" "k8s.io/kubernetes/pkg/apis/componentconfig"
) )
// NodeIpamControllerOptions holds the NodeIpamController options. // NodeIPAMControllerOptions holds the NodeIpamController options.
type NodeIpamControllerOptions struct { type NodeIPAMControllerOptions struct {
ServiceCIDR string ServiceCIDR string
NodeCIDRMaskSize int32 NodeCIDRMaskSize int32
} }
// AddFlags adds flags related to NodeIpamController for controller manager to the specified FlagSet. // AddFlags adds flags related to NodeIpamController for controller manager to the specified FlagSet.
func (o *NodeIpamControllerOptions) AddFlags(fs *pflag.FlagSet) { func (o *NodeIPAMControllerOptions) AddFlags(fs *pflag.FlagSet) {
if o == nil { if o == nil {
return return
} }
@ -39,7 +39,7 @@ func (o *NodeIpamControllerOptions) AddFlags(fs *pflag.FlagSet) {
} }
// ApplyTo fills up NodeIpamController config with options. // ApplyTo fills up NodeIpamController config with options.
func (o *NodeIpamControllerOptions) ApplyTo(cfg *componentconfig.NodeIpamControllerConfiguration) error { func (o *NodeIPAMControllerOptions) ApplyTo(cfg *componentconfig.NodeIPAMControllerConfiguration) error {
if o == nil { if o == nil {
return nil return nil
} }
@ -50,8 +50,8 @@ func (o *NodeIpamControllerOptions) ApplyTo(cfg *componentconfig.NodeIpamControl
return nil return nil
} }
// Validate checks validation of NodeIpamControllerOptions. // Validate checks validation of NodeIPAMControllerOptions.
func (o *NodeIpamControllerOptions) Validate() []error { func (o *NodeIPAMControllerOptions) Validate() []error {
if o == nil { if o == nil {
return nil return nil
} }

View File

@ -21,12 +21,10 @@ package options
import ( import (
"fmt" "fmt"
"net" "net"
"strings"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
utilerrors "k8s.io/apimachinery/pkg/util/errors" utilerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apimachinery/pkg/util/sets"
apiserveroptions "k8s.io/apiserver/pkg/server/options" apiserveroptions "k8s.io/apiserver/pkg/server/options"
utilfeature "k8s.io/apiserver/pkg/util/feature" utilfeature "k8s.io/apiserver/pkg/util/feature"
apiserverflag "k8s.io/apiserver/pkg/util/flag" apiserverflag "k8s.io/apiserver/pkg/util/flag"
@ -56,9 +54,7 @@ const (
// KubeControllerManagerOptions is the main context object for the kube-controller manager. // KubeControllerManagerOptions is the main context object for the kube-controller manager.
type KubeControllerManagerOptions struct { type KubeControllerManagerOptions struct {
CloudProvider *cmoptions.CloudProviderOptions Generic *cmoptions.GenericControllerManagerConfigurationOptions
Debugging *cmoptions.DebuggingOptions
GenericComponent *cmoptions.GenericComponentConfigOptions
KubeCloudShared *cmoptions.KubeCloudSharedOptions KubeCloudShared *cmoptions.KubeCloudSharedOptions
ServiceController *cmoptions.ServiceControllerOptions ServiceController *cmoptions.ServiceControllerOptions
@ -67,12 +63,12 @@ type KubeControllerManagerOptions struct {
DaemonSetController *DaemonSetControllerOptions DaemonSetController *DaemonSetControllerOptions
DeploymentController *DeploymentControllerOptions DeploymentController *DeploymentControllerOptions
DeprecatedFlags *DeprecatedControllerOptions DeprecatedFlags *DeprecatedControllerOptions
EndPointController *EndPointControllerOptions EndpointController *EndpointControllerOptions
GarbageCollectorController *GarbageCollectorControllerOptions GarbageCollectorController *GarbageCollectorControllerOptions
HPAController *HPAControllerOptions HPAController *HPAControllerOptions
JobController *JobControllerOptions JobController *JobControllerOptions
NamespaceController *NamespaceControllerOptions NamespaceController *NamespaceControllerOptions
NodeIpamController *NodeIpamControllerOptions NodeIPAMController *NodeIPAMControllerOptions
NodeLifecycleController *NodeLifecycleControllerOptions NodeLifecycleController *NodeLifecycleControllerOptions
PersistentVolumeBinderController *PersistentVolumeBinderControllerOptions PersistentVolumeBinderController *PersistentVolumeBinderControllerOptions
PodGCController *PodGCControllerOptions PodGCController *PodGCControllerOptions
@ -81,9 +77,6 @@ type KubeControllerManagerOptions struct {
ResourceQuotaController *ResourceQuotaControllerOptions ResourceQuotaController *ResourceQuotaControllerOptions
SAController *SAControllerOptions SAController *SAControllerOptions
Controllers []string
ExternalCloudVolumePlugin string
SecureServing *apiserveroptions.SecureServingOptionsWithLoopback SecureServing *apiserveroptions.SecureServingOptionsWithLoopback
// TODO: remove insecure serving mode // TODO: remove insecure serving mode
InsecureServing *apiserveroptions.DeprecatedInsecureServingOptionsWithLoopback InsecureServing *apiserveroptions.DeprecatedInsecureServingOptionsWithLoopback
@ -102,10 +95,8 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
} }
s := KubeControllerManagerOptions{ s := KubeControllerManagerOptions{
CloudProvider: &cmoptions.CloudProviderOptions{}, Generic: cmoptions.NewGenericControllerManagerConfigurationOptions(componentConfig.Generic),
Debugging: &cmoptions.DebuggingOptions{}, KubeCloudShared: cmoptions.NewKubeCloudSharedOptions(componentConfig.KubeCloudShared),
GenericComponent: cmoptions.NewGenericComponentConfigOptions(componentConfig.GenericComponent),
KubeCloudShared: cmoptions.NewKubeCloudSharedOptions(componentConfig.KubeCloudShared),
AttachDetachController: &AttachDetachControllerOptions{ AttachDetachController: &AttachDetachControllerOptions{
ReconcilerSyncLoopPeriod: componentConfig.AttachDetachController.ReconcilerSyncLoopPeriod, ReconcilerSyncLoopPeriod: componentConfig.AttachDetachController.ReconcilerSyncLoopPeriod,
}, },
@ -124,8 +115,8 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
DeprecatedFlags: &DeprecatedControllerOptions{ DeprecatedFlags: &DeprecatedControllerOptions{
RegisterRetryCount: componentConfig.DeprecatedController.RegisterRetryCount, RegisterRetryCount: componentConfig.DeprecatedController.RegisterRetryCount,
}, },
EndPointController: &EndPointControllerOptions{ EndpointController: &EndpointControllerOptions{
ConcurrentEndpointSyncs: componentConfig.EndPointController.ConcurrentEndpointSyncs, ConcurrentEndpointSyncs: componentConfig.EndpointController.ConcurrentEndpointSyncs,
}, },
GarbageCollectorController: &GarbageCollectorControllerOptions{ GarbageCollectorController: &GarbageCollectorControllerOptions{
ConcurrentGCSyncs: componentConfig.GarbageCollectorController.ConcurrentGCSyncs, ConcurrentGCSyncs: componentConfig.GarbageCollectorController.ConcurrentGCSyncs,
@ -147,8 +138,8 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
NamespaceSyncPeriod: componentConfig.NamespaceController.NamespaceSyncPeriod, NamespaceSyncPeriod: componentConfig.NamespaceController.NamespaceSyncPeriod,
ConcurrentNamespaceSyncs: componentConfig.NamespaceController.ConcurrentNamespaceSyncs, ConcurrentNamespaceSyncs: componentConfig.NamespaceController.ConcurrentNamespaceSyncs,
}, },
NodeIpamController: &NodeIpamControllerOptions{ NodeIPAMController: &NodeIPAMControllerOptions{
NodeCIDRMaskSize: componentConfig.NodeIpamController.NodeCIDRMaskSize, NodeCIDRMaskSize: componentConfig.NodeIPAMController.NodeCIDRMaskSize,
}, },
NodeLifecycleController: &NodeLifecycleControllerOptions{ NodeLifecycleController: &NodeLifecycleControllerOptions{
EnableTaintManager: componentConfig.NodeLifecycleController.EnableTaintManager, EnableTaintManager: componentConfig.NodeLifecycleController.EnableTaintManager,
@ -179,11 +170,10 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
ServiceController: &cmoptions.ServiceControllerOptions{ ServiceController: &cmoptions.ServiceControllerOptions{
ConcurrentServiceSyncs: componentConfig.ServiceController.ConcurrentServiceSyncs, ConcurrentServiceSyncs: componentConfig.ServiceController.ConcurrentServiceSyncs,
}, },
Controllers: componentConfig.Controllers,
SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(), SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(),
InsecureServing: (&apiserveroptions.DeprecatedInsecureServingOptions{ InsecureServing: (&apiserveroptions.DeprecatedInsecureServingOptions{
BindAddress: net.ParseIP(componentConfig.KubeCloudShared.Address), BindAddress: net.ParseIP(componentConfig.Generic.Address),
BindPort: int(componentConfig.KubeCloudShared.Port), BindPort: int(componentConfig.Generic.Port),
BindNetwork: "tcp", BindNetwork: "tcp",
}).WithLoopback(), }).WithLoopback(),
Authentication: apiserveroptions.NewDelegatingAuthenticationOptions(), Authentication: apiserveroptions.NewDelegatingAuthenticationOptions(),
@ -225,15 +215,14 @@ func NewDefaultComponentConfig(insecurePort int32) (componentconfig.KubeControll
if err := scheme.Convert(&versioned, &internal, nil); err != nil { if err := scheme.Convert(&versioned, &internal, nil); err != nil {
return internal, err return internal, err
} }
internal.KubeCloudShared.Port = insecurePort internal.Generic.Port = insecurePort
return internal, nil return internal, nil
} }
// Flags returns flags for a specific APIServer by section name // Flags returns flags for a specific APIServer by section name
func (s *KubeControllerManagerOptions) Flags(allControllers []string, disabledByDefaultControllers []string) (fss apiserverflag.NamedFlagSets) { func (s *KubeControllerManagerOptions) Flags(allControllers []string, disabledByDefaultControllers []string) apiserverflag.NamedFlagSets {
s.CloudProvider.AddFlags(fss.FlagSet("cloud provider")) fss := apiserverflag.NamedFlagSets{}
s.Debugging.AddFlags(fss.FlagSet("debugging")) s.Generic.AddFlags(&fss, allControllers, disabledByDefaultControllers)
s.GenericComponent.AddFlags(fss.FlagSet("generic"))
s.KubeCloudShared.AddFlags(fss.FlagSet("generic")) s.KubeCloudShared.AddFlags(fss.FlagSet("generic"))
s.ServiceController.AddFlags(fss.FlagSet("service controller")) s.ServiceController.AddFlags(fss.FlagSet("service controller"))
@ -247,12 +236,12 @@ func (s *KubeControllerManagerOptions) Flags(allControllers []string, disabledBy
s.DeploymentController.AddFlags(fss.FlagSet("deployment controller")) s.DeploymentController.AddFlags(fss.FlagSet("deployment controller"))
s.DaemonSetController.AddFlags(fss.FlagSet("daemonset controller")) s.DaemonSetController.AddFlags(fss.FlagSet("daemonset controller"))
s.DeprecatedFlags.AddFlags(fss.FlagSet("deprecated")) s.DeprecatedFlags.AddFlags(fss.FlagSet("deprecated"))
s.EndPointController.AddFlags(fss.FlagSet("endpoint controller")) s.EndpointController.AddFlags(fss.FlagSet("endpoint controller"))
s.GarbageCollectorController.AddFlags(fss.FlagSet("garbagecollector controller")) s.GarbageCollectorController.AddFlags(fss.FlagSet("garbagecollector controller"))
s.HPAController.AddFlags(fss.FlagSet("horizontalpodautoscaling controller")) s.HPAController.AddFlags(fss.FlagSet("horizontalpodautoscaling controller"))
s.JobController.AddFlags(fss.FlagSet("job controller")) s.JobController.AddFlags(fss.FlagSet("job controller"))
s.NamespaceController.AddFlags(fss.FlagSet("namespace controller")) s.NamespaceController.AddFlags(fss.FlagSet("namespace controller"))
s.NodeIpamController.AddFlags(fss.FlagSet("nodeipam controller")) s.NodeIPAMController.AddFlags(fss.FlagSet("nodeipam controller"))
s.NodeLifecycleController.AddFlags(fss.FlagSet("nodelifecycle controller")) s.NodeLifecycleController.AddFlags(fss.FlagSet("nodelifecycle controller"))
s.PersistentVolumeBinderController.AddFlags(fss.FlagSet("persistentvolume-binder controller")) s.PersistentVolumeBinderController.AddFlags(fss.FlagSet("persistentvolume-binder controller"))
s.PodGCController.AddFlags(fss.FlagSet("podgc controller")) s.PodGCController.AddFlags(fss.FlagSet("podgc controller"))
@ -264,11 +253,6 @@ func (s *KubeControllerManagerOptions) Flags(allControllers []string, disabledBy
fs := fss.FlagSet("misc") fs := fss.FlagSet("misc")
fs.StringVar(&s.Master, "master", s.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig).") fs.StringVar(&s.Master, "master", s.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig).")
fs.StringVar(&s.Kubeconfig, "kubeconfig", s.Kubeconfig, "Path to kubeconfig file with authorization and master location information.") fs.StringVar(&s.Kubeconfig, "kubeconfig", s.Kubeconfig, "Path to kubeconfig file with authorization and master location information.")
fs.StringSliceVar(&s.Controllers, "controllers", s.Controllers, fmt.Sprintf(""+
"A list of controllers to enable. '*' enables all on-by-default controllers, 'foo' enables the controller "+
"named 'foo', '-foo' disables the controller named 'foo'.\nAll controllers: %s\nDisabled-by-default controllers: %s",
strings.Join(allControllers, ", "), strings.Join(disabledByDefaultControllers, ", ")))
fs.StringVar(&s.ExternalCloudVolumePlugin, "external-cloud-volume-plugin", s.ExternalCloudVolumePlugin, "The plugin to use when cloud provider is set to external. Can be empty, should only be set when cloud-provider is external. Currently used to allow node and volume controllers to work for in tree cloud providers.")
var dummy string var dummy string
fs.MarkDeprecated("insecure-experimental-approve-all-kubelet-csrs-for-group", "This flag does nothing.") fs.MarkDeprecated("insecure-experimental-approve-all-kubelet-csrs-for-group", "This flag does nothing.")
fs.StringVar(&dummy, "insecure-experimental-approve-all-kubelet-csrs-for-group", "", "This flag does nothing.") fs.StringVar(&dummy, "insecure-experimental-approve-all-kubelet-csrs-for-group", "", "This flag does nothing.")
@ -279,13 +263,7 @@ func (s *KubeControllerManagerOptions) Flags(allControllers []string, disabledBy
// ApplyTo fills up controller manager config with options. // ApplyTo fills up controller manager config with options.
func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config) error { func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config) error {
if err := s.CloudProvider.ApplyTo(&c.ComponentConfig.CloudProvider); err != nil { if err := s.Generic.ApplyTo(&c.ComponentConfig.Generic); err != nil {
return err
}
if err := s.Debugging.ApplyTo(&c.ComponentConfig.Debugging); err != nil {
return err
}
if err := s.GenericComponent.ApplyTo(&c.ComponentConfig.GenericComponent); err != nil {
return err return err
} }
if err := s.KubeCloudShared.ApplyTo(&c.ComponentConfig.KubeCloudShared); err != nil { if err := s.KubeCloudShared.ApplyTo(&c.ComponentConfig.KubeCloudShared); err != nil {
@ -306,7 +284,7 @@ func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config) e
if err := s.DeprecatedFlags.ApplyTo(&c.ComponentConfig.DeprecatedController); err != nil { if err := s.DeprecatedFlags.ApplyTo(&c.ComponentConfig.DeprecatedController); err != nil {
return err return err
} }
if err := s.EndPointController.ApplyTo(&c.ComponentConfig.EndPointController); err != nil { if err := s.EndpointController.ApplyTo(&c.ComponentConfig.EndpointController); err != nil {
return err return err
} }
if err := s.GarbageCollectorController.ApplyTo(&c.ComponentConfig.GarbageCollectorController); err != nil { if err := s.GarbageCollectorController.ApplyTo(&c.ComponentConfig.GarbageCollectorController); err != nil {
@ -321,7 +299,7 @@ func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config) e
if err := s.NamespaceController.ApplyTo(&c.ComponentConfig.NamespaceController); err != nil { if err := s.NamespaceController.ApplyTo(&c.ComponentConfig.NamespaceController); err != nil {
return err return err
} }
if err := s.NodeIpamController.ApplyTo(&c.ComponentConfig.NodeIpamController); err != nil { if err := s.NodeIPAMController.ApplyTo(&c.ComponentConfig.NodeIPAMController); err != nil {
return err return err
} }
if err := s.NodeLifecycleController.ApplyTo(&c.ComponentConfig.NodeLifecycleController); err != nil { if err := s.NodeLifecycleController.ApplyTo(&c.ComponentConfig.NodeLifecycleController); err != nil {
@ -365,11 +343,8 @@ func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config) e
// sync back to component config // sync back to component config
// TODO: find more elegant way than syncing back the values. // TODO: find more elegant way than syncing back the values.
c.ComponentConfig.KubeCloudShared.Port = int32(s.InsecureServing.BindPort) c.ComponentConfig.Generic.Port = int32(s.InsecureServing.BindPort)
c.ComponentConfig.KubeCloudShared.Address = s.InsecureServing.BindAddress.String() c.ComponentConfig.Generic.Address = s.InsecureServing.BindAddress.String()
c.ComponentConfig.Controllers = s.Controllers
c.ComponentConfig.ExternalCloudVolumePlugin = s.ExternalCloudVolumePlugin
return nil return nil
} }
@ -378,21 +353,19 @@ func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config) e
func (s *KubeControllerManagerOptions) Validate(allControllers []string, disabledByDefaultControllers []string) error { func (s *KubeControllerManagerOptions) Validate(allControllers []string, disabledByDefaultControllers []string) error {
var errs []error var errs []error
errs = append(errs, s.CloudProvider.Validate()...) errs = append(errs, s.Generic.Validate(allControllers, disabledByDefaultControllers)...)
errs = append(errs, s.Debugging.Validate()...)
errs = append(errs, s.GenericComponent.Validate()...)
errs = append(errs, s.KubeCloudShared.Validate()...) errs = append(errs, s.KubeCloudShared.Validate()...)
errs = append(errs, s.AttachDetachController.Validate()...) errs = append(errs, s.AttachDetachController.Validate()...)
errs = append(errs, s.CSRSigningController.Validate()...) errs = append(errs, s.CSRSigningController.Validate()...)
errs = append(errs, s.DaemonSetController.Validate()...) errs = append(errs, s.DaemonSetController.Validate()...)
errs = append(errs, s.DeploymentController.Validate()...) errs = append(errs, s.DeploymentController.Validate()...)
errs = append(errs, s.DeprecatedFlags.Validate()...) errs = append(errs, s.DeprecatedFlags.Validate()...)
errs = append(errs, s.EndPointController.Validate()...) errs = append(errs, s.EndpointController.Validate()...)
errs = append(errs, s.GarbageCollectorController.Validate()...) errs = append(errs, s.GarbageCollectorController.Validate()...)
errs = append(errs, s.HPAController.Validate()...) errs = append(errs, s.HPAController.Validate()...)
errs = append(errs, s.JobController.Validate()...) errs = append(errs, s.JobController.Validate()...)
errs = append(errs, s.NamespaceController.Validate()...) errs = append(errs, s.NamespaceController.Validate()...)
errs = append(errs, s.NodeIpamController.Validate()...) errs = append(errs, s.NodeIPAMController.Validate()...)
errs = append(errs, s.NodeLifecycleController.Validate()...) errs = append(errs, s.NodeLifecycleController.Validate()...)
errs = append(errs, s.PersistentVolumeBinderController.Validate()...) errs = append(errs, s.PersistentVolumeBinderController.Validate()...)
errs = append(errs, s.PodGCController.Validate()...) errs = append(errs, s.PodGCController.Validate()...)
@ -408,20 +381,6 @@ func (s *KubeControllerManagerOptions) Validate(allControllers []string, disable
// TODO: validate component config, master and kubeconfig // TODO: validate component config, master and kubeconfig
allControllersSet := sets.NewString(allControllers...)
for _, controller := range s.Controllers {
if controller == "*" {
continue
}
if strings.HasPrefix(controller, "-") {
controller = controller[1:]
}
if !allControllersSet.Has(controller) {
errs = append(errs, fmt.Errorf("%q is not in the list of known controllers", controller))
}
}
return utilerrors.NewAggregate(errs) return utilerrors.NewAggregate(errs)
} }
@ -439,9 +398,9 @@ func (s KubeControllerManagerOptions) Config(allControllers []string, disabledBy
if err != nil { if err != nil {
return nil, err return nil, err
} }
kubeconfig.ContentConfig.ContentType = s.GenericComponent.ContentType kubeconfig.ContentConfig.ContentType = s.Generic.ClientConnection.ContentType
kubeconfig.QPS = s.GenericComponent.KubeAPIQPS kubeconfig.QPS = s.Generic.ClientConnection.QPS
kubeconfig.Burst = int(s.GenericComponent.KubeAPIBurst) kubeconfig.Burst = int(s.Generic.ClientConnection.Burst)
client, err := clientset.NewForConfig(restclient.AddUserAgent(kubeconfig, KubeControllerManagerUserAgent)) client, err := clientset.NewForConfig(restclient.AddUserAgent(kubeconfig, KubeControllerManagerUserAgent))
if err != nil { if err != nil {
@ -450,7 +409,7 @@ func (s KubeControllerManagerOptions) Config(allControllers []string, disabledBy
// shallow copy, do not modify the kubeconfig.Timeout. // shallow copy, do not modify the kubeconfig.Timeout.
config := *kubeconfig config := *kubeconfig
config.Timeout = s.GenericComponent.LeaderElection.RenewDeadline.Duration config.Timeout = s.Generic.LeaderElection.RenewDeadline.Duration
leaderElectionClient := clientset.NewForConfigOrDie(restclient.AddUserAgent(&config, "leader-election")) leaderElectionClient := clientset.NewForConfigOrDie(restclient.AddUserAgent(&config, "leader-election"))
eventRecorder := createRecorder(client, KubeControllerManagerUserAgent) eventRecorder := createRecorder(client, KubeControllerManagerUserAgent)

View File

@ -25,6 +25,7 @@ import (
"github.com/spf13/pflag" "github.com/spf13/pflag"
apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/diff" "k8s.io/apimachinery/pkg/util/diff"
apiserverconfig "k8s.io/apiserver/pkg/apis/config" apiserverconfig "k8s.io/apiserver/pkg/apis/config"
@ -121,19 +122,15 @@ func TestAddFlags(t *testing.T) {
sort.Sort(sortedGCIgnoredResources(s.GarbageCollectorController.GCIgnoredResources)) sort.Sort(sortedGCIgnoredResources(s.GarbageCollectorController.GCIgnoredResources))
expected := &KubeControllerManagerOptions{ expected := &KubeControllerManagerOptions{
CloudProvider: &cmoptions.CloudProviderOptions{ Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
Name: "gce", Port: 10252, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
CloudConfigFile: "/cloud-config", Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
}, MinResyncPeriod: metav1.Duration{Duration: 8 * time.Hour},
Debugging: &cmoptions.DebuggingOptions{ ClientConnection: apimachineryconfig.ClientConnectionConfiguration{
EnableProfiling: false, ContentType: "application/json",
EnableContentionProfiling: true, QPS: 50.0,
}, Burst: 100,
GenericComponent: &cmoptions.GenericComponentConfigOptions{ },
MinResyncPeriod: metav1.Duration{Duration: 8 * time.Hour},
ContentType: "application/json",
KubeAPIQPS: 50.0,
KubeAPIBurst: 100,
ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute}, ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute},
LeaderElection: apiserverconfig.LeaderElectionConfiguration{ LeaderElection: apiserverconfig.LeaderElectionConfiguration{
ResourceLock: "configmap", ResourceLock: "configmap",
@ -142,10 +139,13 @@ func TestAddFlags(t *testing.T) {
RenewDeadline: metav1.Duration{Duration: 15 * time.Second}, RenewDeadline: metav1.Duration{Duration: 15 * time.Second},
RetryPeriod: metav1.Duration{Duration: 5 * time.Second}, RetryPeriod: metav1.Duration{Duration: 5 * time.Second},
}, },
Debugging: &cmoptions.DebuggingOptions{
EnableProfiling: false,
EnableContentionProfiling: true,
},
Controllers: []string{"foo", "bar"},
}, },
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{ KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
Port: 10252, // Note: DeprecatedInsecureServingOptions.ApplyTo will write the flag value back into the component config
Address: "0.0.0.0", // Note: DeprecatedInsecureServingOptions.ApplyTo will write the flag value back into the component config
UseServiceAccountCredentials: true, UseServiceAccountCredentials: true,
RouteReconciliationPeriod: metav1.Duration{Duration: 30 * time.Second}, RouteReconciliationPeriod: metav1.Duration{Duration: 30 * time.Second},
NodeMonitorPeriod: metav1.Duration{Duration: 10 * time.Second}, NodeMonitorPeriod: metav1.Duration{Duration: 10 * time.Second},
@ -154,6 +154,10 @@ func TestAddFlags(t *testing.T) {
AllocateNodeCIDRs: true, AllocateNodeCIDRs: true,
CIDRAllocatorType: "CloudAllocator", CIDRAllocatorType: "CloudAllocator",
ConfigureCloudRoutes: false, ConfigureCloudRoutes: false,
CloudProvider: &cmoptions.CloudProviderOptions{
Name: "gce",
CloudConfigFile: "/cloud-config",
},
}, },
AttachDetachController: &AttachDetachControllerOptions{ AttachDetachController: &AttachDetachControllerOptions{
ReconcilerSyncLoopPeriod: metav1.Duration{Duration: 30 * time.Second}, ReconcilerSyncLoopPeriod: metav1.Duration{Duration: 30 * time.Second},
@ -175,7 +179,7 @@ func TestAddFlags(t *testing.T) {
DeletingPodsQPS: 0.1, DeletingPodsQPS: 0.1,
RegisterRetryCount: 10, RegisterRetryCount: 10,
}, },
EndPointController: &EndPointControllerOptions{ EndpointController: &EndpointControllerOptions{
ConcurrentEndpointSyncs: 10, ConcurrentEndpointSyncs: 10,
}, },
GarbageCollectorController: &GarbageCollectorControllerOptions{ GarbageCollectorController: &GarbageCollectorControllerOptions{
@ -201,7 +205,7 @@ func TestAddFlags(t *testing.T) {
NamespaceSyncPeriod: metav1.Duration{Duration: 10 * time.Minute}, NamespaceSyncPeriod: metav1.Duration{Duration: 10 * time.Minute},
ConcurrentNamespaceSyncs: 20, ConcurrentNamespaceSyncs: 20,
}, },
NodeIpamController: &NodeIpamControllerOptions{ NodeIPAMController: &NodeIPAMControllerOptions{
NodeCIDRMaskSize: 48, NodeCIDRMaskSize: 48,
}, },
NodeLifecycleController: &NodeLifecycleControllerOptions{ NodeLifecycleController: &NodeLifecycleControllerOptions{
@ -249,7 +253,6 @@ func TestAddFlags(t *testing.T) {
ServiceController: &cmoptions.ServiceControllerOptions{ ServiceController: &cmoptions.ServiceControllerOptions{
ConcurrentServiceSyncs: 2, ConcurrentServiceSyncs: 2,
}, },
Controllers: []string{"foo", "bar"},
SecureServing: (&apiserveroptions.SecureServingOptions{ SecureServing: (&apiserveroptions.SecureServingOptions{
BindPort: 10001, BindPort: 10001,
BindAddress: net.ParseIP("192.168.4.21"), BindAddress: net.ParseIP("192.168.4.21"),

View File

@ -18,6 +18,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/apis/componentconfig", importpath = "k8s.io/kubernetes/pkg/apis/componentconfig",
deps = [ deps = [
"//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",

View File

@ -17,6 +17,7 @@ limitations under the License.
package componentconfig package componentconfig
import ( import (
apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apiserverconfig "k8s.io/apiserver/pkg/apis/config" apiserverconfig "k8s.io/apiserver/pkg/apis/config"
) )
@ -33,13 +34,8 @@ type GroupResource struct {
type KubeControllerManagerConfiguration struct { type KubeControllerManagerConfiguration struct {
metav1.TypeMeta metav1.TypeMeta
// CloudProviderConfiguration holds configuration for CloudProvider related features. // Generic holds configuration for a generic controller-manager
CloudProvider CloudProviderConfiguration Generic GenericControllerManagerConfiguration
// DebuggingConfiguration holds configuration for Debugging related features.
Debugging apiserverconfig.DebuggingConfiguration
// GenericComponentConfiguration holds configuration for GenericComponent
// related features both in cloud controller manager and kube-controller manager.
GenericComponent GenericComponentConfiguration
// KubeCloudSharedConfiguration holds configuration for shared related features // KubeCloudSharedConfiguration holds configuration for shared related features
// both in cloud controller manager and kube-controller manager. // both in cloud controller manager and kube-controller manager.
KubeCloudShared KubeCloudSharedConfiguration KubeCloudShared KubeCloudSharedConfiguration
@ -59,9 +55,9 @@ type KubeControllerManagerConfiguration struct {
// DeprecatedControllerConfiguration holds configuration for some deprecated // DeprecatedControllerConfiguration holds configuration for some deprecated
// features. // features.
DeprecatedController DeprecatedControllerConfiguration DeprecatedController DeprecatedControllerConfiguration
// EndPointControllerConfiguration holds configuration for EndPointController // EndpointControllerConfiguration holds configuration for EndpointController
// related features. // related features.
EndPointController EndPointControllerConfiguration EndpointController EndpointControllerConfiguration
// GarbageCollectorControllerConfiguration holds configuration for // GarbageCollectorControllerConfiguration holds configuration for
// GarbageCollectorController related features. // GarbageCollectorController related features.
GarbageCollectorController GarbageCollectorControllerConfiguration GarbageCollectorController GarbageCollectorControllerConfiguration
@ -69,12 +65,12 @@ type KubeControllerManagerConfiguration struct {
HPAController HPAControllerConfiguration HPAController HPAControllerConfiguration
// JobControllerConfiguration holds configuration for JobController related features. // JobControllerConfiguration holds configuration for JobController related features.
JobController JobControllerConfiguration JobController JobControllerConfiguration
// NamespaceControllerConfiguration holds configuration for // NamespaceControllerConfiguration holds configuration for NamespaceController
// NamespaceController related features.
NamespaceController NamespaceControllerConfiguration
// NodeIpamControllerConfiguration holds configuration for NodeIpamController
// related features. // related features.
NodeIpamController NodeIpamControllerConfiguration NamespaceController NamespaceControllerConfiguration
// NodeIPAMControllerConfiguration holds configuration for NodeIPAMController
// related features.
NodeIPAMController NodeIPAMControllerConfiguration
// NodeLifecycleControllerConfiguration holds configuration for // NodeLifecycleControllerConfiguration holds configuration for
// NodeLifecycleController related features. // NodeLifecycleController related features.
NodeLifecycleController NodeLifecycleControllerConfiguration NodeLifecycleController NodeLifecycleControllerConfiguration
@ -98,16 +94,6 @@ type KubeControllerManagerConfiguration struct {
// ServiceControllerConfiguration holds configuration for ServiceController // ServiceControllerConfiguration holds configuration for ServiceController
// related features. // related features.
ServiceController ServiceControllerConfiguration ServiceController ServiceControllerConfiguration
// Controllers is the list of controllers to enable or disable
// '*' means "all enabled by default controllers"
// 'foo' means "enable 'foo'"
// '-foo' means "disable 'foo'"
// first item for a particular name wins
Controllers []string
// externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
// It is currently used by the in repo cloud providers to handle node and volume control in the KCM.
ExternalCloudVolumePlugin string
} }
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@ -115,16 +101,12 @@ type KubeControllerManagerConfiguration struct {
type CloudControllerManagerConfiguration struct { type CloudControllerManagerConfiguration struct {
metav1.TypeMeta metav1.TypeMeta
// CloudProviderConfiguration holds configuration for CloudProvider related features. // Generic holds configuration for a generic controller-manager
CloudProvider CloudProviderConfiguration Generic GenericControllerManagerConfiguration
// DebuggingConfiguration holds configuration for Debugging related features.
Debugging apiserverconfig.DebuggingConfiguration
// GenericComponentConfiguration holds configuration for GenericComponent
// related features both in cloud controller manager and kube-controller manager.
GenericComponent GenericComponentConfiguration
// KubeCloudSharedConfiguration holds configuration for shared related features // KubeCloudSharedConfiguration holds configuration for shared related features
// both in cloud controller manager and kube-controller manager. // both in cloud controller manager and kube-controller manager.
KubeCloudShared KubeCloudSharedConfiguration KubeCloudShared KubeCloudSharedConfiguration
// ServiceControllerConfiguration holds configuration for ServiceController // ServiceControllerConfiguration holds configuration for ServiceController
// related features. // related features.
ServiceController ServiceControllerConfiguration ServiceController ServiceControllerConfiguration
@ -132,34 +114,37 @@ type CloudControllerManagerConfiguration struct {
NodeStatusUpdateFrequency metav1.Duration NodeStatusUpdateFrequency metav1.Duration
} }
type CloudProviderConfiguration struct { type GenericControllerManagerConfiguration struct {
// Name is the provider for cloud services.
Name string
// cloudConfigFile is the path to the cloud provider configuration file.
CloudConfigFile string
}
type GenericComponentConfiguration struct {
// minResyncPeriod is the resync period in reflectors; will be random between
// minResyncPeriod and 2*minResyncPeriod.
MinResyncPeriod metav1.Duration
// contentType is contentType of requests sent to apiserver.
ContentType string
// kubeAPIQPS is the QPS to use while talking with kubernetes apiserver.
KubeAPIQPS float32
// kubeAPIBurst is the burst to use while talking with kubernetes apiserver.
KubeAPIBurst int32
// How long to wait between starting controller managers
ControllerStartInterval metav1.Duration
// leaderElection defines the configuration of leader election client.
LeaderElection apiserverconfig.LeaderElectionConfiguration
}
type KubeCloudSharedConfiguration struct {
// port is the port that the controller-manager's http service runs on. // port is the port that the controller-manager's http service runs on.
Port int32 Port int32
// address is the IP address to serve on (set to 0.0.0.0 for all interfaces). // address is the IP address to serve on (set to 0.0.0.0 for all interfaces).
Address string Address string
// minResyncPeriod is the resync period in reflectors; will be random between
// minResyncPeriod and 2*minResyncPeriod.
MinResyncPeriod metav1.Duration
// ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the apiserver.
ClientConnection apimachineryconfig.ClientConnectionConfiguration
// How long to wait between starting controller managers
ControllerStartInterval metav1.Duration
// leaderElection defines the configuration of leader election client.
LeaderElection apiserverconfig.LeaderElectionConfiguration
// Controllers is the list of controllers to enable or disable
// '*' means "all enabled by default controllers"
// 'foo' means "enable 'foo'"
// '-foo' means "disable 'foo'"
// first item for a particular name wins
Controllers []string
// DebuggingConfiguration holds configuration for Debugging related features.
Debugging apiserverconfig.DebuggingConfiguration
}
type KubeCloudSharedConfiguration struct {
// CloudProviderConfiguration holds configuration for CloudProvider related features.
CloudProvider CloudProviderConfiguration
// externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
// It is currently used by the in repo cloud providers to handle node and volume control in the KCM.
ExternalCloudVolumePlugin string
// useServiceAccountCredentials indicates whether controllers should be run with // useServiceAccountCredentials indicates whether controllers should be run with
// individual service account credentials. // individual service account credentials.
UseServiceAccountCredentials bool UseServiceAccountCredentials bool
@ -197,6 +182,13 @@ type AttachDetachControllerConfiguration struct {
ReconcilerSyncLoopPeriod metav1.Duration ReconcilerSyncLoopPeriod metav1.Duration
} }
type CloudProviderConfiguration struct {
// Name is the provider for cloud services.
Name string
// cloudConfigFile is the path to the cloud provider configuration file.
CloudConfigFile string
}
type CSRSigningControllerConfiguration struct { type CSRSigningControllerConfiguration struct {
// clusterSigningCertFile is the filename containing a PEM-encoded // clusterSigningCertFile is the filename containing a PEM-encoded
// X509 CA certificate used to issue cluster-scoped certificates // X509 CA certificate used to issue cluster-scoped certificates
@ -237,7 +229,7 @@ type DeprecatedControllerConfiguration struct {
RegisterRetryCount int32 RegisterRetryCount int32
} }
type EndPointControllerConfiguration struct { type EndpointControllerConfiguration struct {
// concurrentEndpointSyncs is the number of endpoint syncing operations // concurrentEndpointSyncs is the number of endpoint syncing operations
// that will be done concurrently. Larger number = faster endpoint updating, // that will be done concurrently. Larger number = faster endpoint updating,
// but more CPU (and network) load. // but more CPU (and network) load.
@ -297,7 +289,7 @@ type NamespaceControllerConfiguration struct {
ConcurrentNamespaceSyncs int32 ConcurrentNamespaceSyncs int32
} }
type NodeIpamControllerConfiguration struct { type NodeIPAMControllerConfiguration struct {
// serviceCIDR is CIDR Range for Services in cluster. // serviceCIDR is CIDR Range for Services in cluster.
ServiceCIDR string ServiceCIDR string
// NodeCIDRMaskSize is the mask size for node cidr in cluster. // NodeCIDRMaskSize is the mask size for node cidr in cluster.

View File

@ -20,6 +20,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1", importpath = "k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1",
deps = [ deps = [
"//pkg/apis/componentconfig:go_default_library", "//pkg/apis/componentconfig:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",

View File

@ -19,6 +19,7 @@ package v1alpha1
import ( import (
"time" "time"
apimachineryconfigv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kruntime "k8s.io/apimachinery/pkg/runtime" kruntime "k8s.io/apimachinery/pkg/runtime"
apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1"
@ -29,23 +30,10 @@ func addDefaultingFuncs(scheme *kruntime.Scheme) error {
return RegisterDefaults(scheme) return RegisterDefaults(scheme)
} }
func SetDefaults_CloudControllerManagerConfiguration(obj *CloudControllerManagerConfiguration) {
zero := metav1.Duration{}
if obj.ServiceController.ConcurrentServiceSyncs == 0 {
obj.ServiceController.ConcurrentServiceSyncs = 1
}
if obj.NodeStatusUpdateFrequency == zero {
obj.NodeStatusUpdateFrequency = metav1.Duration{Duration: 5 * time.Minute}
}
}
func SetDefaults_KubeControllerManagerConfiguration(obj *KubeControllerManagerConfiguration) { func SetDefaults_KubeControllerManagerConfiguration(obj *KubeControllerManagerConfiguration) {
zero := metav1.Duration{} zero := metav1.Duration{}
if len(obj.Controllers) == 0 { if obj.EndpointController.ConcurrentEndpointSyncs == 0 {
obj.Controllers = []string{"*"} obj.EndpointController.ConcurrentEndpointSyncs = 5
}
if obj.EndPointController.ConcurrentEndpointSyncs == 0 {
obj.EndPointController.ConcurrentEndpointSyncs = 5
} }
if obj.ServiceController.ConcurrentServiceSyncs == 0 { if obj.ServiceController.ConcurrentServiceSyncs == 0 {
obj.ServiceController.ConcurrentServiceSyncs = 1 obj.ServiceController.ConcurrentServiceSyncs = 1
@ -116,8 +104,8 @@ func SetDefaults_KubeControllerManagerConfiguration(obj *KubeControllerManagerCo
if obj.NodeLifecycleController.NodeStartupGracePeriod == zero { if obj.NodeLifecycleController.NodeStartupGracePeriod == zero {
obj.NodeLifecycleController.NodeStartupGracePeriod = metav1.Duration{Duration: 60 * time.Second} obj.NodeLifecycleController.NodeStartupGracePeriod = metav1.Duration{Duration: 60 * time.Second}
} }
if obj.NodeIpamController.NodeCIDRMaskSize == 0 { if obj.NodeIPAMController.NodeCIDRMaskSize == 0 {
obj.NodeIpamController.NodeCIDRMaskSize = 24 obj.NodeIPAMController.NodeCIDRMaskSize = 24
} }
if obj.PodGCController.TerminatedPodGCThreshold == 0 { if obj.PodGCController.TerminatedPodGCThreshold == 0 {
obj.PodGCController.TerminatedPodGCThreshold = 12500 obj.PodGCController.TerminatedPodGCThreshold = 12500
@ -146,39 +134,58 @@ func SetDefaults_KubeControllerManagerConfiguration(obj *KubeControllerManagerCo
if obj.HPAController.HorizontalPodAutoscalerUseRESTClients == nil { if obj.HPAController.HorizontalPodAutoscalerUseRESTClients == nil {
obj.HPAController.HorizontalPodAutoscalerUseRESTClients = utilpointer.BoolPtr(true) obj.HPAController.HorizontalPodAutoscalerUseRESTClients = utilpointer.BoolPtr(true)
} }
// These defaults override the recommended defaults from the apimachineryconfigv1alpha1 package that are applied automatically
// These client-connection defaults are specific to the kube-controller-manager
if obj.Generic.ClientConnection.QPS == 0.0 {
obj.Generic.ClientConnection.QPS = 50.0
}
if obj.Generic.ClientConnection.Burst == 0 {
obj.Generic.ClientConnection.Burst = 100
}
} }
func SetDefaults_GenericComponentConfiguration(obj *GenericComponentConfiguration) { func SetDefaults_CloudControllerManagerConfiguration(obj *CloudControllerManagerConfiguration) {
zero := metav1.Duration{} zero := metav1.Duration{}
if obj.ServiceController.ConcurrentServiceSyncs == 0 {
obj.ServiceController.ConcurrentServiceSyncs = 1
}
if obj.NodeStatusUpdateFrequency == zero {
obj.NodeStatusUpdateFrequency = metav1.Duration{Duration: 5 * time.Minute}
}
// These defaults override the recommended defaults from the apimachineryconfigv1alpha1 package that are applied automatically
// These client-connection defaults are specific to the cloud-controller-manager
if obj.Generic.ClientConnection.QPS == 0 {
obj.Generic.ClientConnection.QPS = 20
}
if obj.Generic.ClientConnection.Burst == 0 {
obj.Generic.ClientConnection.Burst = 30
}
}
func SetDefaults_GenericControllerManagerConfiguration(obj *GenericControllerManagerConfiguration) {
zero := metav1.Duration{}
if obj.Address == "" {
obj.Address = "0.0.0.0"
}
if obj.MinResyncPeriod == zero { if obj.MinResyncPeriod == zero {
obj.MinResyncPeriod = metav1.Duration{Duration: 12 * time.Hour} obj.MinResyncPeriod = metav1.Duration{Duration: 12 * time.Hour}
} }
if obj.ContentType == "" {
obj.ContentType = "application/vnd.kubernetes.protobuf"
}
if obj.KubeAPIQPS == 0 {
obj.KubeAPIQPS = 20.0
}
if obj.KubeAPIBurst == 0 {
obj.KubeAPIBurst = 30
}
if obj.ControllerStartInterval == zero { if obj.ControllerStartInterval == zero {
obj.ControllerStartInterval = metav1.Duration{Duration: 0 * time.Second} obj.ControllerStartInterval = metav1.Duration{Duration: 0 * time.Second}
} }
if len(obj.Controllers) == 0 {
obj.Controllers = []string{"*"}
}
// Use the default LeaderElectionConfiguration options // Use the default ClientConnectionConfiguration and LeaderElectionConfiguration options
apimachineryconfigv1alpha1.RecommendedDefaultClientConnectionConfiguration(&obj.ClientConnection)
apiserverconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection) apiserverconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection)
} }
func SetDefaults_KubeCloudSharedConfiguration(obj *KubeCloudSharedConfiguration) { func SetDefaults_KubeCloudSharedConfiguration(obj *KubeCloudSharedConfiguration) {
zero := metav1.Duration{} zero := metav1.Duration{}
// Port
if obj.Address == "" {
obj.Address = "0.0.0.0"
}
if obj.RouteReconciliationPeriod == zero {
obj.RouteReconciliationPeriod = metav1.Duration{Duration: 10 * time.Second}
}
if obj.NodeMonitorPeriod == zero { if obj.NodeMonitorPeriod == zero {
obj.NodeMonitorPeriod = metav1.Duration{Duration: 5 * time.Second} obj.NodeMonitorPeriod = metav1.Duration{Duration: 5 * time.Second}
} }
@ -188,6 +195,9 @@ func SetDefaults_KubeCloudSharedConfiguration(obj *KubeCloudSharedConfiguration)
if obj.ConfigureCloudRoutes == nil { if obj.ConfigureCloudRoutes == nil {
obj.ConfigureCloudRoutes = utilpointer.BoolPtr(true) obj.ConfigureCloudRoutes = utilpointer.BoolPtr(true)
} }
if obj.RouteReconciliationPeriod == zero {
obj.RouteReconciliationPeriod = metav1.Duration{Duration: 10 * time.Second}
}
} }
func SetDefaults_PersistentVolumeRecyclerConfiguration(obj *PersistentVolumeRecyclerConfiguration) { func SetDefaults_PersistentVolumeRecyclerConfiguration(obj *PersistentVolumeRecyclerConfiguration) {

View File

@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1 package v1alpha1
import ( import (
apimachineryconfigv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1"
) )
@ -81,13 +82,8 @@ type GroupResource struct {
type KubeControllerManagerConfiguration struct { type KubeControllerManagerConfiguration struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`
// CloudProviderConfiguration holds configuration for CloudProvider related features. // Generic holds configuration for a generic controller-manager
CloudProvider CloudProviderConfiguration Generic GenericControllerManagerConfiguration
// DebuggingConfiguration holds configuration for Debugging related features.
Debugging apiserverconfigv1alpha1.DebuggingConfiguration
// GenericComponentConfiguration holds configuration for GenericComponent
// related features both in cloud controller manager and kube-controller manager.
GenericComponent GenericComponentConfiguration
// KubeCloudSharedConfiguration holds configuration for shared related features // KubeCloudSharedConfiguration holds configuration for shared related features
// both in cloud controller manager and kube-controller manager. // both in cloud controller manager and kube-controller manager.
KubeCloudShared KubeCloudSharedConfiguration KubeCloudShared KubeCloudSharedConfiguration
@ -107,9 +103,9 @@ type KubeControllerManagerConfiguration struct {
// DeprecatedControllerConfiguration holds configuration for some deprecated // DeprecatedControllerConfiguration holds configuration for some deprecated
// features. // features.
DeprecatedController DeprecatedControllerConfiguration DeprecatedController DeprecatedControllerConfiguration
// EndPointControllerConfiguration holds configuration for EndPointController // EndpointControllerConfiguration holds configuration for EndpointController
// related features. // related features.
EndPointController EndPointControllerConfiguration EndpointController EndpointControllerConfiguration
// GarbageCollectorControllerConfiguration holds configuration for // GarbageCollectorControllerConfiguration holds configuration for
// GarbageCollectorController related features. // GarbageCollectorController related features.
GarbageCollectorController GarbageCollectorControllerConfiguration GarbageCollectorController GarbageCollectorControllerConfiguration
@ -120,9 +116,9 @@ type KubeControllerManagerConfiguration struct {
// NamespaceControllerConfiguration holds configuration for NamespaceController // NamespaceControllerConfiguration holds configuration for NamespaceController
// related features. // related features.
NamespaceController NamespaceControllerConfiguration NamespaceController NamespaceControllerConfiguration
// NodeIpamControllerConfiguration holds configuration for NodeIpamController // NodeIPAMControllerConfiguration holds configuration for NodeIPAMController
// related features. // related features.
NodeIpamController NodeIpamControllerConfiguration NodeIPAMController NodeIPAMControllerConfiguration
// NodeLifecycleControllerConfiguration holds configuration for // NodeLifecycleControllerConfiguration holds configuration for
// NodeLifecycleController related features. // NodeLifecycleController related features.
NodeLifecycleController NodeLifecycleControllerConfiguration NodeLifecycleController NodeLifecycleControllerConfiguration
@ -146,16 +142,6 @@ type KubeControllerManagerConfiguration struct {
// ServiceControllerConfiguration holds configuration for ServiceController // ServiceControllerConfiguration holds configuration for ServiceController
// related features. // related features.
ServiceController ServiceControllerConfiguration ServiceController ServiceControllerConfiguration
// Controllers is the list of controllers to enable or disable
// '*' means "all enabled by default controllers"
// 'foo' means "enable 'foo'"
// '-foo' means "disable 'foo'"
// first item for a particular name wins
Controllers []string
// externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
// It is currently used by the in repo cloud providers to handle node and volume control in the KCM.
ExternalCloudVolumePlugin string
} }
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@ -163,13 +149,8 @@ type KubeControllerManagerConfiguration struct {
type CloudControllerManagerConfiguration struct { type CloudControllerManagerConfiguration struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`
// CloudProviderConfiguration holds configuration for CloudProvider related features. // Generic holds configuration for a generic controller-manager
CloudProvider CloudProviderConfiguration Generic GenericControllerManagerConfiguration
// DebuggingConfiguration holds configuration for Debugging related features.
Debugging apiserverconfigv1alpha1.DebuggingConfiguration
// GenericComponentConfiguration holds configuration for GenericComponent
// related features both in cloud controller manager and kube-controller manager.
GenericComponent GenericComponentConfiguration
// KubeCloudSharedConfiguration holds configuration for shared related features // KubeCloudSharedConfiguration holds configuration for shared related features
// both in cloud controller manager and kube-controller manager. // both in cloud controller manager and kube-controller manager.
KubeCloudShared KubeCloudSharedConfiguration KubeCloudShared KubeCloudSharedConfiguration
@ -180,35 +161,37 @@ type CloudControllerManagerConfiguration struct {
NodeStatusUpdateFrequency metav1.Duration NodeStatusUpdateFrequency metav1.Duration
} }
type CloudProviderConfiguration struct { type GenericControllerManagerConfiguration struct {
// Name is the provider for cloud services.
Name string
// cloudConfigFile is the path to the cloud provider configuration file.
CloudConfigFile string
}
type GenericComponentConfiguration struct {
// minResyncPeriod is the resync period in reflectors; will be random between
// minResyncPeriod and 2*minResyncPeriod.
MinResyncPeriod metav1.Duration
// contentType is contentType of requests sent to apiserver.
ContentType string
// kubeAPIQPS is the QPS to use while talking with kubernetes apiserver.
KubeAPIQPS float32
// kubeAPIBurst is the burst to use while talking with kubernetes apiserver.
KubeAPIBurst int32
// How long to wait between starting controller managers
ControllerStartInterval metav1.Duration
// leaderElection defines the configuration of leader election client.
LeaderElection apiserverconfigv1alpha1.LeaderElectionConfiguration
}
type KubeCloudSharedConfiguration struct {
// port is the port that the controller-manager's http service runs on. // port is the port that the controller-manager's http service runs on.
Port int32 Port int32
// address is the IP address to serve on (set to 0.0.0.0 for all interfaces). // address is the IP address to serve on (set to 0.0.0.0 for all interfaces).
Address string Address string
// minResyncPeriod is the resync period in reflectors; will be random between
// minResyncPeriod and 2*minResyncPeriod.
MinResyncPeriod metav1.Duration
// ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the apiserver.
ClientConnection apimachineryconfigv1alpha1.ClientConnectionConfiguration
// How long to wait between starting controller managers
ControllerStartInterval metav1.Duration
// leaderElection defines the configuration of leader election client.
LeaderElection apiserverconfigv1alpha1.LeaderElectionConfiguration
// Controllers is the list of controllers to enable or disable
// '*' means "all enabled by default controllers"
// 'foo' means "enable 'foo'"
// '-foo' means "disable 'foo'"
// first item for a particular name wins
Controllers []string
// DebuggingConfiguration holds configuration for Debugging related features.
Debugging apiserverconfigv1alpha1.DebuggingConfiguration
}
type KubeCloudSharedConfiguration struct {
// CloudProviderConfiguration holds configuration for CloudProvider related features.
CloudProvider CloudProviderConfiguration
// externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
// It is currently used by the in repo cloud providers to handle node and volume control in the KCM.
ExternalCloudVolumePlugin string
// useServiceAccountCredentials indicates whether controllers should be run with // useServiceAccountCredentials indicates whether controllers should be run with
// individual service account credentials. // individual service account credentials.
UseServiceAccountCredentials bool UseServiceAccountCredentials bool
@ -246,6 +229,13 @@ type AttachDetachControllerConfiguration struct {
ReconcilerSyncLoopPeriod metav1.Duration ReconcilerSyncLoopPeriod metav1.Duration
} }
type CloudProviderConfiguration struct {
// Name is the provider for cloud services.
Name string
// cloudConfigFile is the path to the cloud provider configuration file.
CloudConfigFile string
}
type CSRSigningControllerConfiguration struct { type CSRSigningControllerConfiguration struct {
// clusterSigningCertFile is the filename containing a PEM-encoded // clusterSigningCertFile is the filename containing a PEM-encoded
// X509 CA certificate used to issue cluster-scoped certificates // X509 CA certificate used to issue cluster-scoped certificates
@ -286,7 +276,7 @@ type DeprecatedControllerConfiguration struct {
RegisterRetryCount int32 RegisterRetryCount int32
} }
type EndPointControllerConfiguration struct { type EndpointControllerConfiguration struct {
// concurrentEndpointSyncs is the number of endpoint syncing operations // concurrentEndpointSyncs is the number of endpoint syncing operations
// that will be done concurrently. Larger number = faster endpoint updating, // that will be done concurrently. Larger number = faster endpoint updating,
// but more CPU (and network) load. // but more CPU (and network) load.
@ -346,7 +336,7 @@ type NamespaceControllerConfiguration struct {
ConcurrentNamespaceSyncs int32 ConcurrentNamespaceSyncs int32
} }
type NodeIpamControllerConfiguration struct { type NodeIPAMControllerConfiguration struct {
// serviceCIDR is CIDR Range for Services in cluster. // serviceCIDR is CIDR Range for Services in cluster.
ServiceCIDR string ServiceCIDR string
// NodeCIDRMaskSize is the mask size for node cidr in cluster. // NodeCIDRMaskSize is the mask size for node cidr in cluster.

View File

@ -23,10 +23,11 @@ package v1alpha1
import ( import (
unsafe "unsafe" unsafe "unsafe"
configv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion" conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
configv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" apisconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1"
componentconfig "k8s.io/kubernetes/pkg/apis/componentconfig" componentconfig "k8s.io/kubernetes/pkg/apis/componentconfig"
) )
@ -107,13 +108,13 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddGeneratedConversionFunc((*EndPointControllerConfiguration)(nil), (*componentconfig.EndPointControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddGeneratedConversionFunc((*EndpointControllerConfiguration)(nil), (*componentconfig.EndpointControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_EndPointControllerConfiguration_To_componentconfig_EndPointControllerConfiguration(a.(*EndPointControllerConfiguration), b.(*componentconfig.EndPointControllerConfiguration), scope) return Convert_v1alpha1_EndpointControllerConfiguration_To_componentconfig_EndpointControllerConfiguration(a.(*EndpointControllerConfiguration), b.(*componentconfig.EndpointControllerConfiguration), scope)
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddGeneratedConversionFunc((*componentconfig.EndPointControllerConfiguration)(nil), (*EndPointControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddGeneratedConversionFunc((*componentconfig.EndpointControllerConfiguration)(nil), (*EndpointControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_componentconfig_EndPointControllerConfiguration_To_v1alpha1_EndPointControllerConfiguration(a.(*componentconfig.EndPointControllerConfiguration), b.(*EndPointControllerConfiguration), scope) return Convert_componentconfig_EndpointControllerConfiguration_To_v1alpha1_EndpointControllerConfiguration(a.(*componentconfig.EndpointControllerConfiguration), b.(*EndpointControllerConfiguration), scope)
}); err != nil { }); err != nil {
return err return err
} }
@ -127,13 +128,13 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddGeneratedConversionFunc((*GenericComponentConfiguration)(nil), (*componentconfig.GenericComponentConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddGeneratedConversionFunc((*GenericControllerManagerConfiguration)(nil), (*componentconfig.GenericControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_GenericComponentConfiguration_To_componentconfig_GenericComponentConfiguration(a.(*GenericComponentConfiguration), b.(*componentconfig.GenericComponentConfiguration), scope) return Convert_v1alpha1_GenericControllerManagerConfiguration_To_componentconfig_GenericControllerManagerConfiguration(a.(*GenericControllerManagerConfiguration), b.(*componentconfig.GenericControllerManagerConfiguration), scope)
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddGeneratedConversionFunc((*componentconfig.GenericComponentConfiguration)(nil), (*GenericComponentConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddGeneratedConversionFunc((*componentconfig.GenericControllerManagerConfiguration)(nil), (*GenericControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_componentconfig_GenericComponentConfiguration_To_v1alpha1_GenericComponentConfiguration(a.(*componentconfig.GenericComponentConfiguration), b.(*GenericComponentConfiguration), scope) return Convert_componentconfig_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(a.(*componentconfig.GenericControllerManagerConfiguration), b.(*GenericControllerManagerConfiguration), scope)
}); err != nil { }); err != nil {
return err return err
} }
@ -197,13 +198,13 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddGeneratedConversionFunc((*NodeIpamControllerConfiguration)(nil), (*componentconfig.NodeIpamControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddGeneratedConversionFunc((*NodeIPAMControllerConfiguration)(nil), (*componentconfig.NodeIPAMControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_NodeIpamControllerConfiguration_To_componentconfig_NodeIpamControllerConfiguration(a.(*NodeIpamControllerConfiguration), b.(*componentconfig.NodeIpamControllerConfiguration), scope) return Convert_v1alpha1_NodeIPAMControllerConfiguration_To_componentconfig_NodeIPAMControllerConfiguration(a.(*NodeIPAMControllerConfiguration), b.(*componentconfig.NodeIPAMControllerConfiguration), scope)
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddGeneratedConversionFunc((*componentconfig.NodeIpamControllerConfiguration)(nil), (*NodeIpamControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddGeneratedConversionFunc((*componentconfig.NodeIPAMControllerConfiguration)(nil), (*NodeIPAMControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_componentconfig_NodeIpamControllerConfiguration_To_v1alpha1_NodeIpamControllerConfiguration(a.(*componentconfig.NodeIpamControllerConfiguration), b.(*NodeIpamControllerConfiguration), scope) return Convert_componentconfig_NodeIPAMControllerConfiguration_To_v1alpha1_NodeIPAMControllerConfiguration(a.(*componentconfig.NodeIPAMControllerConfiguration), b.(*NodeIPAMControllerConfiguration), scope)
}); err != nil { }); err != nil {
return err return err
} }
@ -357,13 +358,7 @@ func Convert_componentconfig_CSRSigningControllerConfiguration_To_v1alpha1_CSRSi
} }
func autoConvert_v1alpha1_CloudControllerManagerConfiguration_To_componentconfig_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration, out *componentconfig.CloudControllerManagerConfiguration, s conversion.Scope) error { func autoConvert_v1alpha1_CloudControllerManagerConfiguration_To_componentconfig_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration, out *componentconfig.CloudControllerManagerConfiguration, s conversion.Scope) error {
if err := Convert_v1alpha1_CloudProviderConfiguration_To_componentconfig_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil { if err := Convert_v1alpha1_GenericControllerManagerConfiguration_To_componentconfig_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
return err
}
if err := configv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil {
return err
}
if err := Convert_v1alpha1_GenericComponentConfiguration_To_componentconfig_GenericComponentConfiguration(&in.GenericComponent, &out.GenericComponent, s); err != nil {
return err return err
} }
if err := Convert_v1alpha1_KubeCloudSharedConfiguration_To_componentconfig_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil { if err := Convert_v1alpha1_KubeCloudSharedConfiguration_To_componentconfig_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
@ -382,13 +377,7 @@ func Convert_v1alpha1_CloudControllerManagerConfiguration_To_componentconfig_Clo
} }
func autoConvert_componentconfig_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in *componentconfig.CloudControllerManagerConfiguration, out *CloudControllerManagerConfiguration, s conversion.Scope) error { func autoConvert_componentconfig_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in *componentconfig.CloudControllerManagerConfiguration, out *CloudControllerManagerConfiguration, s conversion.Scope) error {
if err := Convert_componentconfig_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil { if err := Convert_componentconfig_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
return err
}
if err := configv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil {
return err
}
if err := Convert_componentconfig_GenericComponentConfiguration_To_v1alpha1_GenericComponentConfiguration(&in.GenericComponent, &out.GenericComponent, s); err != nil {
return err return err
} }
if err := Convert_componentconfig_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil { if err := Convert_componentconfig_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
@ -494,24 +483,24 @@ func Convert_componentconfig_DeprecatedControllerConfiguration_To_v1alpha1_Depre
return autoConvert_componentconfig_DeprecatedControllerConfiguration_To_v1alpha1_DeprecatedControllerConfiguration(in, out, s) return autoConvert_componentconfig_DeprecatedControllerConfiguration_To_v1alpha1_DeprecatedControllerConfiguration(in, out, s)
} }
func autoConvert_v1alpha1_EndPointControllerConfiguration_To_componentconfig_EndPointControllerConfiguration(in *EndPointControllerConfiguration, out *componentconfig.EndPointControllerConfiguration, s conversion.Scope) error { func autoConvert_v1alpha1_EndpointControllerConfiguration_To_componentconfig_EndpointControllerConfiguration(in *EndpointControllerConfiguration, out *componentconfig.EndpointControllerConfiguration, s conversion.Scope) error {
out.ConcurrentEndpointSyncs = in.ConcurrentEndpointSyncs out.ConcurrentEndpointSyncs = in.ConcurrentEndpointSyncs
return nil return nil
} }
// Convert_v1alpha1_EndPointControllerConfiguration_To_componentconfig_EndPointControllerConfiguration is an autogenerated conversion function. // Convert_v1alpha1_EndpointControllerConfiguration_To_componentconfig_EndpointControllerConfiguration is an autogenerated conversion function.
func Convert_v1alpha1_EndPointControllerConfiguration_To_componentconfig_EndPointControllerConfiguration(in *EndPointControllerConfiguration, out *componentconfig.EndPointControllerConfiguration, s conversion.Scope) error { func Convert_v1alpha1_EndpointControllerConfiguration_To_componentconfig_EndpointControllerConfiguration(in *EndpointControllerConfiguration, out *componentconfig.EndpointControllerConfiguration, s conversion.Scope) error {
return autoConvert_v1alpha1_EndPointControllerConfiguration_To_componentconfig_EndPointControllerConfiguration(in, out, s) return autoConvert_v1alpha1_EndpointControllerConfiguration_To_componentconfig_EndpointControllerConfiguration(in, out, s)
} }
func autoConvert_componentconfig_EndPointControllerConfiguration_To_v1alpha1_EndPointControllerConfiguration(in *componentconfig.EndPointControllerConfiguration, out *EndPointControllerConfiguration, s conversion.Scope) error { func autoConvert_componentconfig_EndpointControllerConfiguration_To_v1alpha1_EndpointControllerConfiguration(in *componentconfig.EndpointControllerConfiguration, out *EndpointControllerConfiguration, s conversion.Scope) error {
out.ConcurrentEndpointSyncs = in.ConcurrentEndpointSyncs out.ConcurrentEndpointSyncs = in.ConcurrentEndpointSyncs
return nil return nil
} }
// Convert_componentconfig_EndPointControllerConfiguration_To_v1alpha1_EndPointControllerConfiguration is an autogenerated conversion function. // Convert_componentconfig_EndpointControllerConfiguration_To_v1alpha1_EndpointControllerConfiguration is an autogenerated conversion function.
func Convert_componentconfig_EndPointControllerConfiguration_To_v1alpha1_EndPointControllerConfiguration(in *componentconfig.EndPointControllerConfiguration, out *EndPointControllerConfiguration, s conversion.Scope) error { func Convert_componentconfig_EndpointControllerConfiguration_To_v1alpha1_EndpointControllerConfiguration(in *componentconfig.EndpointControllerConfiguration, out *EndpointControllerConfiguration, s conversion.Scope) error {
return autoConvert_componentconfig_EndPointControllerConfiguration_To_v1alpha1_EndPointControllerConfiguration(in, out, s) return autoConvert_componentconfig_EndpointControllerConfiguration_To_v1alpha1_EndpointControllerConfiguration(in, out, s)
} }
func autoConvert_v1alpha1_GarbageCollectorControllerConfiguration_To_componentconfig_GarbageCollectorControllerConfiguration(in *GarbageCollectorControllerConfiguration, out *componentconfig.GarbageCollectorControllerConfiguration, s conversion.Scope) error { func autoConvert_v1alpha1_GarbageCollectorControllerConfiguration_To_componentconfig_GarbageCollectorControllerConfiguration(in *GarbageCollectorControllerConfiguration, out *componentconfig.GarbageCollectorControllerConfiguration, s conversion.Scope) error {
@ -542,38 +531,50 @@ func Convert_componentconfig_GarbageCollectorControllerConfiguration_To_v1alpha1
return autoConvert_componentconfig_GarbageCollectorControllerConfiguration_To_v1alpha1_GarbageCollectorControllerConfiguration(in, out, s) return autoConvert_componentconfig_GarbageCollectorControllerConfiguration_To_v1alpha1_GarbageCollectorControllerConfiguration(in, out, s)
} }
func autoConvert_v1alpha1_GenericComponentConfiguration_To_componentconfig_GenericComponentConfiguration(in *GenericComponentConfiguration, out *componentconfig.GenericComponentConfiguration, s conversion.Scope) error { func autoConvert_v1alpha1_GenericControllerManagerConfiguration_To_componentconfig_GenericControllerManagerConfiguration(in *GenericControllerManagerConfiguration, out *componentconfig.GenericControllerManagerConfiguration, s conversion.Scope) error {
out.Port = in.Port
out.Address = in.Address
out.MinResyncPeriod = in.MinResyncPeriod out.MinResyncPeriod = in.MinResyncPeriod
out.ContentType = in.ContentType if err := configv1alpha1.Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil {
out.KubeAPIQPS = in.KubeAPIQPS return err
out.KubeAPIBurst = in.KubeAPIBurst }
out.ControllerStartInterval = in.ControllerStartInterval out.ControllerStartInterval = in.ControllerStartInterval
if err := configv1alpha1.Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { if err := apisconfigv1alpha1.Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil {
return err
}
out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers))
if err := apisconfigv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil {
return err return err
} }
return nil return nil
} }
// Convert_v1alpha1_GenericComponentConfiguration_To_componentconfig_GenericComponentConfiguration is an autogenerated conversion function. // Convert_v1alpha1_GenericControllerManagerConfiguration_To_componentconfig_GenericControllerManagerConfiguration is an autogenerated conversion function.
func Convert_v1alpha1_GenericComponentConfiguration_To_componentconfig_GenericComponentConfiguration(in *GenericComponentConfiguration, out *componentconfig.GenericComponentConfiguration, s conversion.Scope) error { func Convert_v1alpha1_GenericControllerManagerConfiguration_To_componentconfig_GenericControllerManagerConfiguration(in *GenericControllerManagerConfiguration, out *componentconfig.GenericControllerManagerConfiguration, s conversion.Scope) error {
return autoConvert_v1alpha1_GenericComponentConfiguration_To_componentconfig_GenericComponentConfiguration(in, out, s) return autoConvert_v1alpha1_GenericControllerManagerConfiguration_To_componentconfig_GenericControllerManagerConfiguration(in, out, s)
} }
func autoConvert_componentconfig_GenericComponentConfiguration_To_v1alpha1_GenericComponentConfiguration(in *componentconfig.GenericComponentConfiguration, out *GenericComponentConfiguration, s conversion.Scope) error { func autoConvert_componentconfig_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in *componentconfig.GenericControllerManagerConfiguration, out *GenericControllerManagerConfiguration, s conversion.Scope) error {
out.Port = in.Port
out.Address = in.Address
out.MinResyncPeriod = in.MinResyncPeriod out.MinResyncPeriod = in.MinResyncPeriod
out.ContentType = in.ContentType if err := configv1alpha1.Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil {
out.KubeAPIQPS = in.KubeAPIQPS return err
out.KubeAPIBurst = in.KubeAPIBurst }
out.ControllerStartInterval = in.ControllerStartInterval out.ControllerStartInterval = in.ControllerStartInterval
if err := configv1alpha1.Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { if err := apisconfigv1alpha1.Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil {
return err
}
out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers))
if err := apisconfigv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil {
return err return err
} }
return nil return nil
} }
// Convert_componentconfig_GenericComponentConfiguration_To_v1alpha1_GenericComponentConfiguration is an autogenerated conversion function. // Convert_componentconfig_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration is an autogenerated conversion function.
func Convert_componentconfig_GenericComponentConfiguration_To_v1alpha1_GenericComponentConfiguration(in *componentconfig.GenericComponentConfiguration, out *GenericComponentConfiguration, s conversion.Scope) error { func Convert_componentconfig_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in *componentconfig.GenericControllerManagerConfiguration, out *GenericControllerManagerConfiguration, s conversion.Scope) error {
return autoConvert_componentconfig_GenericComponentConfiguration_To_v1alpha1_GenericComponentConfiguration(in, out, s) return autoConvert_componentconfig_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in, out, s)
} }
func autoConvert_v1alpha1_GroupResource_To_componentconfig_GroupResource(in *GroupResource, out *componentconfig.GroupResource, s conversion.Scope) error { func autoConvert_v1alpha1_GroupResource_To_componentconfig_GroupResource(in *GroupResource, out *componentconfig.GroupResource, s conversion.Scope) error {
@ -655,8 +656,10 @@ func Convert_componentconfig_JobControllerConfiguration_To_v1alpha1_JobControlle
} }
func autoConvert_v1alpha1_KubeCloudSharedConfiguration_To_componentconfig_KubeCloudSharedConfiguration(in *KubeCloudSharedConfiguration, out *componentconfig.KubeCloudSharedConfiguration, s conversion.Scope) error { func autoConvert_v1alpha1_KubeCloudSharedConfiguration_To_componentconfig_KubeCloudSharedConfiguration(in *KubeCloudSharedConfiguration, out *componentconfig.KubeCloudSharedConfiguration, s conversion.Scope) error {
out.Port = in.Port if err := Convert_v1alpha1_CloudProviderConfiguration_To_componentconfig_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil {
out.Address = in.Address return err
}
out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
out.AllowUntaggedCloud = in.AllowUntaggedCloud out.AllowUntaggedCloud = in.AllowUntaggedCloud
out.RouteReconciliationPeriod = in.RouteReconciliationPeriod out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
@ -678,8 +681,10 @@ func Convert_v1alpha1_KubeCloudSharedConfiguration_To_componentconfig_KubeCloudS
} }
func autoConvert_componentconfig_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in *componentconfig.KubeCloudSharedConfiguration, out *KubeCloudSharedConfiguration, s conversion.Scope) error { func autoConvert_componentconfig_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in *componentconfig.KubeCloudSharedConfiguration, out *KubeCloudSharedConfiguration, s conversion.Scope) error {
out.Port = in.Port if err := Convert_componentconfig_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil {
out.Address = in.Address return err
}
out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
out.AllowUntaggedCloud = in.AllowUntaggedCloud out.AllowUntaggedCloud = in.AllowUntaggedCloud
out.RouteReconciliationPeriod = in.RouteReconciliationPeriod out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
@ -701,13 +706,7 @@ func Convert_componentconfig_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudS
} }
func autoConvert_v1alpha1_KubeControllerManagerConfiguration_To_componentconfig_KubeControllerManagerConfiguration(in *KubeControllerManagerConfiguration, out *componentconfig.KubeControllerManagerConfiguration, s conversion.Scope) error { func autoConvert_v1alpha1_KubeControllerManagerConfiguration_To_componentconfig_KubeControllerManagerConfiguration(in *KubeControllerManagerConfiguration, out *componentconfig.KubeControllerManagerConfiguration, s conversion.Scope) error {
if err := Convert_v1alpha1_CloudProviderConfiguration_To_componentconfig_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil { if err := Convert_v1alpha1_GenericControllerManagerConfiguration_To_componentconfig_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
return err
}
if err := configv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil {
return err
}
if err := Convert_v1alpha1_GenericComponentConfiguration_To_componentconfig_GenericComponentConfiguration(&in.GenericComponent, &out.GenericComponent, s); err != nil {
return err return err
} }
if err := Convert_v1alpha1_KubeCloudSharedConfiguration_To_componentconfig_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil { if err := Convert_v1alpha1_KubeCloudSharedConfiguration_To_componentconfig_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
@ -728,7 +727,7 @@ func autoConvert_v1alpha1_KubeControllerManagerConfiguration_To_componentconfig_
if err := Convert_v1alpha1_DeprecatedControllerConfiguration_To_componentconfig_DeprecatedControllerConfiguration(&in.DeprecatedController, &out.DeprecatedController, s); err != nil { if err := Convert_v1alpha1_DeprecatedControllerConfiguration_To_componentconfig_DeprecatedControllerConfiguration(&in.DeprecatedController, &out.DeprecatedController, s); err != nil {
return err return err
} }
if err := Convert_v1alpha1_EndPointControllerConfiguration_To_componentconfig_EndPointControllerConfiguration(&in.EndPointController, &out.EndPointController, s); err != nil { if err := Convert_v1alpha1_EndpointControllerConfiguration_To_componentconfig_EndpointControllerConfiguration(&in.EndpointController, &out.EndpointController, s); err != nil {
return err return err
} }
if err := Convert_v1alpha1_GarbageCollectorControllerConfiguration_To_componentconfig_GarbageCollectorControllerConfiguration(&in.GarbageCollectorController, &out.GarbageCollectorController, s); err != nil { if err := Convert_v1alpha1_GarbageCollectorControllerConfiguration_To_componentconfig_GarbageCollectorControllerConfiguration(&in.GarbageCollectorController, &out.GarbageCollectorController, s); err != nil {
@ -743,7 +742,7 @@ func autoConvert_v1alpha1_KubeControllerManagerConfiguration_To_componentconfig_
if err := Convert_v1alpha1_NamespaceControllerConfiguration_To_componentconfig_NamespaceControllerConfiguration(&in.NamespaceController, &out.NamespaceController, s); err != nil { if err := Convert_v1alpha1_NamespaceControllerConfiguration_To_componentconfig_NamespaceControllerConfiguration(&in.NamespaceController, &out.NamespaceController, s); err != nil {
return err return err
} }
if err := Convert_v1alpha1_NodeIpamControllerConfiguration_To_componentconfig_NodeIpamControllerConfiguration(&in.NodeIpamController, &out.NodeIpamController, s); err != nil { if err := Convert_v1alpha1_NodeIPAMControllerConfiguration_To_componentconfig_NodeIPAMControllerConfiguration(&in.NodeIPAMController, &out.NodeIPAMController, s); err != nil {
return err return err
} }
if err := Convert_v1alpha1_NodeLifecycleControllerConfiguration_To_componentconfig_NodeLifecycleControllerConfiguration(&in.NodeLifecycleController, &out.NodeLifecycleController, s); err != nil { if err := Convert_v1alpha1_NodeLifecycleControllerConfiguration_To_componentconfig_NodeLifecycleControllerConfiguration(&in.NodeLifecycleController, &out.NodeLifecycleController, s); err != nil {
@ -770,8 +769,6 @@ func autoConvert_v1alpha1_KubeControllerManagerConfiguration_To_componentconfig_
if err := Convert_v1alpha1_ServiceControllerConfiguration_To_componentconfig_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil { if err := Convert_v1alpha1_ServiceControllerConfiguration_To_componentconfig_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil {
return err return err
} }
out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers))
out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin
return nil return nil
} }
@ -781,13 +778,7 @@ func Convert_v1alpha1_KubeControllerManagerConfiguration_To_componentconfig_Kube
} }
func autoConvert_componentconfig_KubeControllerManagerConfiguration_To_v1alpha1_KubeControllerManagerConfiguration(in *componentconfig.KubeControllerManagerConfiguration, out *KubeControllerManagerConfiguration, s conversion.Scope) error { func autoConvert_componentconfig_KubeControllerManagerConfiguration_To_v1alpha1_KubeControllerManagerConfiguration(in *componentconfig.KubeControllerManagerConfiguration, out *KubeControllerManagerConfiguration, s conversion.Scope) error {
if err := Convert_componentconfig_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil { if err := Convert_componentconfig_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
return err
}
if err := configv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil {
return err
}
if err := Convert_componentconfig_GenericComponentConfiguration_To_v1alpha1_GenericComponentConfiguration(&in.GenericComponent, &out.GenericComponent, s); err != nil {
return err return err
} }
if err := Convert_componentconfig_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil { if err := Convert_componentconfig_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
@ -808,7 +799,7 @@ func autoConvert_componentconfig_KubeControllerManagerConfiguration_To_v1alpha1_
if err := Convert_componentconfig_DeprecatedControllerConfiguration_To_v1alpha1_DeprecatedControllerConfiguration(&in.DeprecatedController, &out.DeprecatedController, s); err != nil { if err := Convert_componentconfig_DeprecatedControllerConfiguration_To_v1alpha1_DeprecatedControllerConfiguration(&in.DeprecatedController, &out.DeprecatedController, s); err != nil {
return err return err
} }
if err := Convert_componentconfig_EndPointControllerConfiguration_To_v1alpha1_EndPointControllerConfiguration(&in.EndPointController, &out.EndPointController, s); err != nil { if err := Convert_componentconfig_EndpointControllerConfiguration_To_v1alpha1_EndpointControllerConfiguration(&in.EndpointController, &out.EndpointController, s); err != nil {
return err return err
} }
if err := Convert_componentconfig_GarbageCollectorControllerConfiguration_To_v1alpha1_GarbageCollectorControllerConfiguration(&in.GarbageCollectorController, &out.GarbageCollectorController, s); err != nil { if err := Convert_componentconfig_GarbageCollectorControllerConfiguration_To_v1alpha1_GarbageCollectorControllerConfiguration(&in.GarbageCollectorController, &out.GarbageCollectorController, s); err != nil {
@ -823,7 +814,7 @@ func autoConvert_componentconfig_KubeControllerManagerConfiguration_To_v1alpha1_
if err := Convert_componentconfig_NamespaceControllerConfiguration_To_v1alpha1_NamespaceControllerConfiguration(&in.NamespaceController, &out.NamespaceController, s); err != nil { if err := Convert_componentconfig_NamespaceControllerConfiguration_To_v1alpha1_NamespaceControllerConfiguration(&in.NamespaceController, &out.NamespaceController, s); err != nil {
return err return err
} }
if err := Convert_componentconfig_NodeIpamControllerConfiguration_To_v1alpha1_NodeIpamControllerConfiguration(&in.NodeIpamController, &out.NodeIpamController, s); err != nil { if err := Convert_componentconfig_NodeIPAMControllerConfiguration_To_v1alpha1_NodeIPAMControllerConfiguration(&in.NodeIPAMController, &out.NodeIPAMController, s); err != nil {
return err return err
} }
if err := Convert_componentconfig_NodeLifecycleControllerConfiguration_To_v1alpha1_NodeLifecycleControllerConfiguration(&in.NodeLifecycleController, &out.NodeLifecycleController, s); err != nil { if err := Convert_componentconfig_NodeLifecycleControllerConfiguration_To_v1alpha1_NodeLifecycleControllerConfiguration(&in.NodeLifecycleController, &out.NodeLifecycleController, s); err != nil {
@ -850,8 +841,6 @@ func autoConvert_componentconfig_KubeControllerManagerConfiguration_To_v1alpha1_
if err := Convert_componentconfig_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil { if err := Convert_componentconfig_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil {
return err return err
} }
out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers))
out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin
return nil return nil
} }
@ -882,26 +871,26 @@ func Convert_componentconfig_NamespaceControllerConfiguration_To_v1alpha1_Namesp
return autoConvert_componentconfig_NamespaceControllerConfiguration_To_v1alpha1_NamespaceControllerConfiguration(in, out, s) return autoConvert_componentconfig_NamespaceControllerConfiguration_To_v1alpha1_NamespaceControllerConfiguration(in, out, s)
} }
func autoConvert_v1alpha1_NodeIpamControllerConfiguration_To_componentconfig_NodeIpamControllerConfiguration(in *NodeIpamControllerConfiguration, out *componentconfig.NodeIpamControllerConfiguration, s conversion.Scope) error { func autoConvert_v1alpha1_NodeIPAMControllerConfiguration_To_componentconfig_NodeIPAMControllerConfiguration(in *NodeIPAMControllerConfiguration, out *componentconfig.NodeIPAMControllerConfiguration, s conversion.Scope) error {
out.ServiceCIDR = in.ServiceCIDR out.ServiceCIDR = in.ServiceCIDR
out.NodeCIDRMaskSize = in.NodeCIDRMaskSize out.NodeCIDRMaskSize = in.NodeCIDRMaskSize
return nil return nil
} }
// Convert_v1alpha1_NodeIpamControllerConfiguration_To_componentconfig_NodeIpamControllerConfiguration is an autogenerated conversion function. // Convert_v1alpha1_NodeIPAMControllerConfiguration_To_componentconfig_NodeIPAMControllerConfiguration is an autogenerated conversion function.
func Convert_v1alpha1_NodeIpamControllerConfiguration_To_componentconfig_NodeIpamControllerConfiguration(in *NodeIpamControllerConfiguration, out *componentconfig.NodeIpamControllerConfiguration, s conversion.Scope) error { func Convert_v1alpha1_NodeIPAMControllerConfiguration_To_componentconfig_NodeIPAMControllerConfiguration(in *NodeIPAMControllerConfiguration, out *componentconfig.NodeIPAMControllerConfiguration, s conversion.Scope) error {
return autoConvert_v1alpha1_NodeIpamControllerConfiguration_To_componentconfig_NodeIpamControllerConfiguration(in, out, s) return autoConvert_v1alpha1_NodeIPAMControllerConfiguration_To_componentconfig_NodeIPAMControllerConfiguration(in, out, s)
} }
func autoConvert_componentconfig_NodeIpamControllerConfiguration_To_v1alpha1_NodeIpamControllerConfiguration(in *componentconfig.NodeIpamControllerConfiguration, out *NodeIpamControllerConfiguration, s conversion.Scope) error { func autoConvert_componentconfig_NodeIPAMControllerConfiguration_To_v1alpha1_NodeIPAMControllerConfiguration(in *componentconfig.NodeIPAMControllerConfiguration, out *NodeIPAMControllerConfiguration, s conversion.Scope) error {
out.ServiceCIDR = in.ServiceCIDR out.ServiceCIDR = in.ServiceCIDR
out.NodeCIDRMaskSize = in.NodeCIDRMaskSize out.NodeCIDRMaskSize = in.NodeCIDRMaskSize
return nil return nil
} }
// Convert_componentconfig_NodeIpamControllerConfiguration_To_v1alpha1_NodeIpamControllerConfiguration is an autogenerated conversion function. // Convert_componentconfig_NodeIPAMControllerConfiguration_To_v1alpha1_NodeIPAMControllerConfiguration is an autogenerated conversion function.
func Convert_componentconfig_NodeIpamControllerConfiguration_To_v1alpha1_NodeIpamControllerConfiguration(in *componentconfig.NodeIpamControllerConfiguration, out *NodeIpamControllerConfiguration, s conversion.Scope) error { func Convert_componentconfig_NodeIPAMControllerConfiguration_To_v1alpha1_NodeIPAMControllerConfiguration(in *componentconfig.NodeIPAMControllerConfiguration, out *NodeIPAMControllerConfiguration, s conversion.Scope) error {
return autoConvert_componentconfig_NodeIpamControllerConfiguration_To_v1alpha1_NodeIpamControllerConfiguration(in, out, s) return autoConvert_componentconfig_NodeIPAMControllerConfiguration_To_v1alpha1_NodeIPAMControllerConfiguration(in, out, s)
} }
func autoConvert_v1alpha1_NodeLifecycleControllerConfiguration_To_componentconfig_NodeLifecycleControllerConfiguration(in *NodeLifecycleControllerConfiguration, out *componentconfig.NodeLifecycleControllerConfiguration, s conversion.Scope) error { func autoConvert_v1alpha1_NodeLifecycleControllerConfiguration_To_componentconfig_NodeLifecycleControllerConfiguration(in *NodeLifecycleControllerConfiguration, out *componentconfig.NodeLifecycleControllerConfiguration, s conversion.Scope) error {

View File

@ -62,9 +62,7 @@ func (in *CSRSigningControllerConfiguration) DeepCopy() *CSRSigningControllerCon
func (in *CloudControllerManagerConfiguration) DeepCopyInto(out *CloudControllerManagerConfiguration) { func (in *CloudControllerManagerConfiguration) DeepCopyInto(out *CloudControllerManagerConfiguration) {
*out = *in *out = *in
out.TypeMeta = in.TypeMeta out.TypeMeta = in.TypeMeta
out.CloudProvider = in.CloudProvider in.Generic.DeepCopyInto(&out.Generic)
out.Debugging = in.Debugging
in.GenericComponent.DeepCopyInto(&out.GenericComponent)
in.KubeCloudShared.DeepCopyInto(&out.KubeCloudShared) in.KubeCloudShared.DeepCopyInto(&out.KubeCloudShared)
out.ServiceController = in.ServiceController out.ServiceController = in.ServiceController
out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency
@ -155,17 +153,17 @@ func (in *DeprecatedControllerConfiguration) DeepCopy() *DeprecatedControllerCon
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EndPointControllerConfiguration) DeepCopyInto(out *EndPointControllerConfiguration) { func (in *EndpointControllerConfiguration) DeepCopyInto(out *EndpointControllerConfiguration) {
*out = *in *out = *in
return return
} }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndPointControllerConfiguration. // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointControllerConfiguration.
func (in *EndPointControllerConfiguration) DeepCopy() *EndPointControllerConfiguration { func (in *EndpointControllerConfiguration) DeepCopy() *EndpointControllerConfiguration {
if in == nil { if in == nil {
return nil return nil
} }
out := new(EndPointControllerConfiguration) out := new(EndpointControllerConfiguration)
in.DeepCopyInto(out) in.DeepCopyInto(out)
return out return out
} }
@ -197,20 +195,27 @@ func (in *GarbageCollectorControllerConfiguration) DeepCopy() *GarbageCollectorC
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GenericComponentConfiguration) DeepCopyInto(out *GenericComponentConfiguration) { func (in *GenericControllerManagerConfiguration) DeepCopyInto(out *GenericControllerManagerConfiguration) {
*out = *in *out = *in
out.MinResyncPeriod = in.MinResyncPeriod out.MinResyncPeriod = in.MinResyncPeriod
out.ClientConnection = in.ClientConnection
out.ControllerStartInterval = in.ControllerStartInterval out.ControllerStartInterval = in.ControllerStartInterval
in.LeaderElection.DeepCopyInto(&out.LeaderElection) in.LeaderElection.DeepCopyInto(&out.LeaderElection)
if in.Controllers != nil {
in, out := &in.Controllers, &out.Controllers
*out = make([]string, len(*in))
copy(*out, *in)
}
out.Debugging = in.Debugging
return return
} }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericComponentConfiguration. // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericControllerManagerConfiguration.
func (in *GenericComponentConfiguration) DeepCopy() *GenericComponentConfiguration { func (in *GenericControllerManagerConfiguration) DeepCopy() *GenericControllerManagerConfiguration {
if in == nil { if in == nil {
return nil return nil
} }
out := new(GenericComponentConfiguration) out := new(GenericControllerManagerConfiguration)
in.DeepCopyInto(out) in.DeepCopyInto(out)
return out return out
} }
@ -276,6 +281,7 @@ func (in *JobControllerConfiguration) DeepCopy() *JobControllerConfiguration {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) { func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) {
*out = *in *out = *in
out.CloudProvider = in.CloudProvider
out.RouteReconciliationPeriod = in.RouteReconciliationPeriod out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
out.NodeMonitorPeriod = in.NodeMonitorPeriod out.NodeMonitorPeriod = in.NodeMonitorPeriod
if in.ConfigureCloudRoutes != nil { if in.ConfigureCloudRoutes != nil {
@ -301,21 +307,19 @@ func (in *KubeCloudSharedConfiguration) DeepCopy() *KubeCloudSharedConfiguration
func (in *KubeControllerManagerConfiguration) DeepCopyInto(out *KubeControllerManagerConfiguration) { func (in *KubeControllerManagerConfiguration) DeepCopyInto(out *KubeControllerManagerConfiguration) {
*out = *in *out = *in
out.TypeMeta = in.TypeMeta out.TypeMeta = in.TypeMeta
out.CloudProvider = in.CloudProvider in.Generic.DeepCopyInto(&out.Generic)
out.Debugging = in.Debugging
in.GenericComponent.DeepCopyInto(&out.GenericComponent)
in.KubeCloudShared.DeepCopyInto(&out.KubeCloudShared) in.KubeCloudShared.DeepCopyInto(&out.KubeCloudShared)
out.AttachDetachController = in.AttachDetachController out.AttachDetachController = in.AttachDetachController
out.CSRSigningController = in.CSRSigningController out.CSRSigningController = in.CSRSigningController
out.DaemonSetController = in.DaemonSetController out.DaemonSetController = in.DaemonSetController
out.DeploymentController = in.DeploymentController out.DeploymentController = in.DeploymentController
out.DeprecatedController = in.DeprecatedController out.DeprecatedController = in.DeprecatedController
out.EndPointController = in.EndPointController out.EndpointController = in.EndpointController
in.GarbageCollectorController.DeepCopyInto(&out.GarbageCollectorController) in.GarbageCollectorController.DeepCopyInto(&out.GarbageCollectorController)
in.HPAController.DeepCopyInto(&out.HPAController) in.HPAController.DeepCopyInto(&out.HPAController)
out.JobController = in.JobController out.JobController = in.JobController
out.NamespaceController = in.NamespaceController out.NamespaceController = in.NamespaceController
out.NodeIpamController = in.NodeIpamController out.NodeIPAMController = in.NodeIPAMController
in.NodeLifecycleController.DeepCopyInto(&out.NodeLifecycleController) in.NodeLifecycleController.DeepCopyInto(&out.NodeLifecycleController)
in.PersistentVolumeBinderController.DeepCopyInto(&out.PersistentVolumeBinderController) in.PersistentVolumeBinderController.DeepCopyInto(&out.PersistentVolumeBinderController)
out.PodGCController = in.PodGCController out.PodGCController = in.PodGCController
@ -324,11 +328,6 @@ func (in *KubeControllerManagerConfiguration) DeepCopyInto(out *KubeControllerMa
out.ResourceQuotaController = in.ResourceQuotaController out.ResourceQuotaController = in.ResourceQuotaController
out.SAController = in.SAController out.SAController = in.SAController
out.ServiceController = in.ServiceController out.ServiceController = in.ServiceController
if in.Controllers != nil {
in, out := &in.Controllers, &out.Controllers
*out = make([]string, len(*in))
copy(*out, *in)
}
return return
} }
@ -368,17 +367,17 @@ func (in *NamespaceControllerConfiguration) DeepCopy() *NamespaceControllerConfi
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeIpamControllerConfiguration) DeepCopyInto(out *NodeIpamControllerConfiguration) { func (in *NodeIPAMControllerConfiguration) DeepCopyInto(out *NodeIPAMControllerConfiguration) {
*out = *in *out = *in
return return
} }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeIpamControllerConfiguration. // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeIPAMControllerConfiguration.
func (in *NodeIpamControllerConfiguration) DeepCopy() *NodeIpamControllerConfiguration { func (in *NodeIPAMControllerConfiguration) DeepCopy() *NodeIPAMControllerConfiguration {
if in == nil { if in == nil {
return nil return nil
} }
out := new(NodeIpamControllerConfiguration) out := new(NodeIPAMControllerConfiguration)
in.DeepCopyInto(out) in.DeepCopyInto(out)
return out return out
} }

View File

@ -39,13 +39,13 @@ func RegisterDefaults(scheme *runtime.Scheme) error {
func SetObjectDefaults_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration) { func SetObjectDefaults_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration) {
SetDefaults_CloudControllerManagerConfiguration(in) SetDefaults_CloudControllerManagerConfiguration(in)
SetDefaults_GenericComponentConfiguration(&in.GenericComponent) SetDefaults_GenericControllerManagerConfiguration(&in.Generic)
SetDefaults_KubeCloudSharedConfiguration(&in.KubeCloudShared) SetDefaults_KubeCloudSharedConfiguration(&in.KubeCloudShared)
} }
func SetObjectDefaults_KubeControllerManagerConfiguration(in *KubeControllerManagerConfiguration) { func SetObjectDefaults_KubeControllerManagerConfiguration(in *KubeControllerManagerConfiguration) {
SetDefaults_KubeControllerManagerConfiguration(in) SetDefaults_KubeControllerManagerConfiguration(in)
SetDefaults_GenericComponentConfiguration(&in.GenericComponent) SetDefaults_GenericControllerManagerConfiguration(&in.Generic)
SetDefaults_KubeCloudSharedConfiguration(&in.KubeCloudShared) SetDefaults_KubeCloudSharedConfiguration(&in.KubeCloudShared)
SetDefaults_VolumeConfiguration(&in.PersistentVolumeBinderController.VolumeConfiguration) SetDefaults_VolumeConfiguration(&in.PersistentVolumeBinderController.VolumeConfiguration)
SetDefaults_PersistentVolumeRecyclerConfiguration(&in.PersistentVolumeBinderController.VolumeConfiguration.PersistentVolumeRecyclerConfiguration) SetDefaults_PersistentVolumeRecyclerConfiguration(&in.PersistentVolumeBinderController.VolumeConfiguration.PersistentVolumeRecyclerConfiguration)

View File

@ -62,9 +62,7 @@ func (in *CSRSigningControllerConfiguration) DeepCopy() *CSRSigningControllerCon
func (in *CloudControllerManagerConfiguration) DeepCopyInto(out *CloudControllerManagerConfiguration) { func (in *CloudControllerManagerConfiguration) DeepCopyInto(out *CloudControllerManagerConfiguration) {
*out = *in *out = *in
out.TypeMeta = in.TypeMeta out.TypeMeta = in.TypeMeta
out.CloudProvider = in.CloudProvider in.Generic.DeepCopyInto(&out.Generic)
out.Debugging = in.Debugging
out.GenericComponent = in.GenericComponent
out.KubeCloudShared = in.KubeCloudShared out.KubeCloudShared = in.KubeCloudShared
out.ServiceController = in.ServiceController out.ServiceController = in.ServiceController
out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency
@ -155,17 +153,17 @@ func (in *DeprecatedControllerConfiguration) DeepCopy() *DeprecatedControllerCon
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EndPointControllerConfiguration) DeepCopyInto(out *EndPointControllerConfiguration) { func (in *EndpointControllerConfiguration) DeepCopyInto(out *EndpointControllerConfiguration) {
*out = *in *out = *in
return return
} }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndPointControllerConfiguration. // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointControllerConfiguration.
func (in *EndPointControllerConfiguration) DeepCopy() *EndPointControllerConfiguration { func (in *EndpointControllerConfiguration) DeepCopy() *EndpointControllerConfiguration {
if in == nil { if in == nil {
return nil return nil
} }
out := new(EndPointControllerConfiguration) out := new(EndpointControllerConfiguration)
in.DeepCopyInto(out) in.DeepCopyInto(out)
return out return out
} }
@ -192,20 +190,27 @@ func (in *GarbageCollectorControllerConfiguration) DeepCopy() *GarbageCollectorC
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GenericComponentConfiguration) DeepCopyInto(out *GenericComponentConfiguration) { func (in *GenericControllerManagerConfiguration) DeepCopyInto(out *GenericControllerManagerConfiguration) {
*out = *in *out = *in
out.MinResyncPeriod = in.MinResyncPeriod out.MinResyncPeriod = in.MinResyncPeriod
out.ClientConnection = in.ClientConnection
out.ControllerStartInterval = in.ControllerStartInterval out.ControllerStartInterval = in.ControllerStartInterval
out.LeaderElection = in.LeaderElection out.LeaderElection = in.LeaderElection
if in.Controllers != nil {
in, out := &in.Controllers, &out.Controllers
*out = make([]string, len(*in))
copy(*out, *in)
}
out.Debugging = in.Debugging
return return
} }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericComponentConfiguration. // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericControllerManagerConfiguration.
func (in *GenericComponentConfiguration) DeepCopy() *GenericComponentConfiguration { func (in *GenericControllerManagerConfiguration) DeepCopy() *GenericControllerManagerConfiguration {
if in == nil { if in == nil {
return nil return nil
} }
out := new(GenericComponentConfiguration) out := new(GenericControllerManagerConfiguration)
in.DeepCopyInto(out) in.DeepCopyInto(out)
return out return out
} }
@ -308,6 +313,7 @@ func (in *JobControllerConfiguration) DeepCopy() *JobControllerConfiguration {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) { func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) {
*out = *in *out = *in
out.CloudProvider = in.CloudProvider
out.RouteReconciliationPeriod = in.RouteReconciliationPeriod out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
out.NodeMonitorPeriod = in.NodeMonitorPeriod out.NodeMonitorPeriod = in.NodeMonitorPeriod
out.NodeSyncPeriod = in.NodeSyncPeriod out.NodeSyncPeriod = in.NodeSyncPeriod
@ -328,21 +334,19 @@ func (in *KubeCloudSharedConfiguration) DeepCopy() *KubeCloudSharedConfiguration
func (in *KubeControllerManagerConfiguration) DeepCopyInto(out *KubeControllerManagerConfiguration) { func (in *KubeControllerManagerConfiguration) DeepCopyInto(out *KubeControllerManagerConfiguration) {
*out = *in *out = *in
out.TypeMeta = in.TypeMeta out.TypeMeta = in.TypeMeta
out.CloudProvider = in.CloudProvider in.Generic.DeepCopyInto(&out.Generic)
out.Debugging = in.Debugging
out.GenericComponent = in.GenericComponent
out.KubeCloudShared = in.KubeCloudShared out.KubeCloudShared = in.KubeCloudShared
out.AttachDetachController = in.AttachDetachController out.AttachDetachController = in.AttachDetachController
out.CSRSigningController = in.CSRSigningController out.CSRSigningController = in.CSRSigningController
out.DaemonSetController = in.DaemonSetController out.DaemonSetController = in.DaemonSetController
out.DeploymentController = in.DeploymentController out.DeploymentController = in.DeploymentController
out.DeprecatedController = in.DeprecatedController out.DeprecatedController = in.DeprecatedController
out.EndPointController = in.EndPointController out.EndpointController = in.EndpointController
in.GarbageCollectorController.DeepCopyInto(&out.GarbageCollectorController) in.GarbageCollectorController.DeepCopyInto(&out.GarbageCollectorController)
out.HPAController = in.HPAController out.HPAController = in.HPAController
out.JobController = in.JobController out.JobController = in.JobController
out.NamespaceController = in.NamespaceController out.NamespaceController = in.NamespaceController
out.NodeIpamController = in.NodeIpamController out.NodeIPAMController = in.NodeIPAMController
out.NodeLifecycleController = in.NodeLifecycleController out.NodeLifecycleController = in.NodeLifecycleController
out.PersistentVolumeBinderController = in.PersistentVolumeBinderController out.PersistentVolumeBinderController = in.PersistentVolumeBinderController
out.PodGCController = in.PodGCController out.PodGCController = in.PodGCController
@ -351,11 +355,6 @@ func (in *KubeControllerManagerConfiguration) DeepCopyInto(out *KubeControllerMa
out.ResourceQuotaController = in.ResourceQuotaController out.ResourceQuotaController = in.ResourceQuotaController
out.SAController = in.SAController out.SAController = in.SAController
out.ServiceController = in.ServiceController out.ServiceController = in.ServiceController
if in.Controllers != nil {
in, out := &in.Controllers, &out.Controllers
*out = make([]string, len(*in))
copy(*out, *in)
}
return return
} }
@ -395,17 +394,17 @@ func (in *NamespaceControllerConfiguration) DeepCopy() *NamespaceControllerConfi
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeIpamControllerConfiguration) DeepCopyInto(out *NodeIpamControllerConfiguration) { func (in *NodeIPAMControllerConfiguration) DeepCopyInto(out *NodeIPAMControllerConfiguration) {
*out = *in *out = *in
return return
} }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeIpamControllerConfiguration. // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeIPAMControllerConfiguration.
func (in *NodeIpamControllerConfiguration) DeepCopy() *NodeIpamControllerConfiguration { func (in *NodeIPAMControllerConfiguration) DeepCopy() *NodeIPAMControllerConfiguration {
if in == nil { if in == nil {
return nil return nil
} }
out := new(NodeIpamControllerConfiguration) out := new(NodeIPAMControllerConfiguration)
in.DeepCopyInto(out) in.DeepCopyInto(out)
return out return out
} }