fix all reference for wrap componentconfig type

pull/564/head
stewart-yu 2019-01-13 15:04:36 +08:00
parent 5b43a24318
commit 3518fb400c
4 changed files with 236 additions and 184 deletions

View File

@ -82,10 +82,10 @@ func NewCloudControllerManagerOptions() (*CloudControllerManagerOptions, error)
} }
s := CloudControllerManagerOptions{ s := CloudControllerManagerOptions{
Generic: cmoptions.NewGenericControllerManagerConfigurationOptions(componentConfig.Generic), Generic: cmoptions.NewGenericControllerManagerConfigurationOptions(&componentConfig.Generic),
KubeCloudShared: cmoptions.NewKubeCloudSharedOptions(componentConfig.KubeCloudShared), KubeCloudShared: cmoptions.NewKubeCloudSharedOptions(&componentConfig.KubeCloudShared),
ServiceController: &cmoptions.ServiceControllerOptions{ ServiceController: &cmoptions.ServiceControllerOptions{
ConcurrentServiceSyncs: componentConfig.ServiceController.ConcurrentServiceSyncs, ServiceControllerConfiguration: &componentConfig.ServiceController,
}, },
SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(), SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(),
InsecureServing: (&apiserveroptions.DeprecatedInsecureServingOptions{ InsecureServing: (&apiserveroptions.DeprecatedInsecureServingOptions{

View File

@ -29,6 +29,7 @@ import (
apiserveroptions "k8s.io/apiserver/pkg/server/options" apiserveroptions "k8s.io/apiserver/pkg/server/options"
componentbaseconfig "k8s.io/component-base/config" componentbaseconfig "k8s.io/component-base/config"
cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options" cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
) )
func TestDefaultFlags(t *testing.T) { func TestDefaultFlags(t *testing.T) {
@ -36,42 +37,52 @@ func TestDefaultFlags(t *testing.T) {
expected := &CloudControllerManagerOptions{ expected := &CloudControllerManagerOptions{
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{ Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config GenericControllerManagerConfiguration: &kubectrlmgrconfig.GenericControllerManagerConfiguration{
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour}, Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour},
ContentType: "application/vnd.kubernetes.protobuf", ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
QPS: 20.0, ContentType: "application/vnd.kubernetes.protobuf",
Burst: 30, QPS: 20.0,
}, Burst: 30,
ControllerStartInterval: metav1.Duration{Duration: 0}, },
LeaderElection: componentbaseconfig.LeaderElectionConfiguration{ ControllerStartInterval: metav1.Duration{Duration: 0},
ResourceLock: "endpoints", LeaderElection: componentbaseconfig.LeaderElectionConfiguration{
LeaderElect: true, ResourceLock: "endpoints",
LeaseDuration: metav1.Duration{Duration: 15 * time.Second}, LeaderElect: true,
RenewDeadline: metav1.Duration{Duration: 10 * time.Second}, LeaseDuration: metav1.Duration{Duration: 15 * time.Second},
RetryPeriod: metav1.Duration{Duration: 2 * time.Second}, RenewDeadline: metav1.Duration{Duration: 10 * time.Second},
RetryPeriod: metav1.Duration{Duration: 2 * time.Second},
},
Controllers: []string{"*"},
}, },
Debugging: &cmoptions.DebuggingOptions{ Debugging: &cmoptions.DebuggingOptions{
EnableContentionProfiling: false, DebuggingConfiguration: &componentbaseconfig.DebuggingConfiguration{
EnableContentionProfiling: false,
},
}, },
Controllers: []string{"*"},
}, },
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{ KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
RouteReconciliationPeriod: metav1.Duration{Duration: 10 * time.Second}, KubeCloudSharedConfiguration: &kubectrlmgrconfig.KubeCloudSharedConfiguration{
NodeMonitorPeriod: metav1.Duration{Duration: 5 * time.Second}, RouteReconciliationPeriod: metav1.Duration{Duration: 10 * time.Second},
ClusterName: "kubernetes", NodeMonitorPeriod: metav1.Duration{Duration: 5 * time.Second},
ClusterCIDR: "", ClusterName: "kubernetes",
AllocateNodeCIDRs: false, ClusterCIDR: "",
CIDRAllocatorType: "", AllocateNodeCIDRs: false,
ConfigureCloudRoutes: true, CIDRAllocatorType: "",
ConfigureCloudRoutes: true,
},
CloudProvider: &cmoptions.CloudProviderOptions{ CloudProvider: &cmoptions.CloudProviderOptions{
Name: "", CloudProviderConfiguration: &kubectrlmgrconfig.CloudProviderConfiguration{
CloudConfigFile: "", Name: "",
CloudConfigFile: "",
},
}, },
}, },
ServiceController: &cmoptions.ServiceControllerOptions{ ServiceController: &cmoptions.ServiceControllerOptions{
ConcurrentServiceSyncs: 1, ServiceControllerConfiguration: &kubectrlmgrconfig.ServiceControllerConfiguration{
ConcurrentServiceSyncs: 1,
},
}, },
SecureServing: (&apiserveroptions.SecureServingOptions{ SecureServing: (&apiserveroptions.SecureServingOptions{
BindPort: 10258, BindPort: 10258,
@ -155,42 +166,52 @@ func TestAddFlags(t *testing.T) {
expected := &CloudControllerManagerOptions{ expected := &CloudControllerManagerOptions{
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{ Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config GenericControllerManagerConfiguration: &kubectrlmgrconfig.GenericControllerManagerConfiguration{
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod: metav1.Duration{Duration: 100 * time.Minute}, Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ MinResyncPeriod: metav1.Duration{Duration: 100 * time.Minute},
ContentType: "application/vnd.kubernetes.protobuf", ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
QPS: 50.0, ContentType: "application/vnd.kubernetes.protobuf",
Burst: 100, QPS: 50.0,
}, Burst: 100,
ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute}, },
LeaderElection: componentbaseconfig.LeaderElectionConfiguration{ ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute},
ResourceLock: "configmap", LeaderElection: componentbaseconfig.LeaderElectionConfiguration{
LeaderElect: false, ResourceLock: "configmap",
LeaseDuration: metav1.Duration{Duration: 30 * time.Second}, LeaderElect: false,
RenewDeadline: metav1.Duration{Duration: 15 * time.Second}, LeaseDuration: metav1.Duration{Duration: 30 * time.Second},
RetryPeriod: metav1.Duration{Duration: 5 * time.Second}, RenewDeadline: metav1.Duration{Duration: 15 * time.Second},
RetryPeriod: metav1.Duration{Duration: 5 * time.Second},
},
Controllers: []string{"foo", "bar"},
}, },
Debugging: &cmoptions.DebuggingOptions{ Debugging: &cmoptions.DebuggingOptions{
EnableContentionProfiling: true, DebuggingConfiguration: &componentbaseconfig.DebuggingConfiguration{
EnableContentionProfiling: true,
},
}, },
Controllers: []string{"foo", "bar"},
}, },
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{ KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
CloudProvider: &cmoptions.CloudProviderOptions{ KubeCloudSharedConfiguration: &kubectrlmgrconfig.KubeCloudSharedConfiguration{
Name: "gce", RouteReconciliationPeriod: metav1.Duration{Duration: 30 * time.Second},
CloudConfigFile: "/cloud-config", NodeMonitorPeriod: metav1.Duration{Duration: 5 * time.Second},
ClusterName: "k8s",
ClusterCIDR: "1.2.3.4/24",
AllocateNodeCIDRs: true,
CIDRAllocatorType: "RangeAllocator",
ConfigureCloudRoutes: false,
},
CloudProvider: &cmoptions.CloudProviderOptions{
CloudProviderConfiguration: &kubectrlmgrconfig.CloudProviderConfiguration{
Name: "gce",
CloudConfigFile: "/cloud-config",
},
}, },
RouteReconciliationPeriod: metav1.Duration{Duration: 30 * time.Second},
NodeMonitorPeriod: metav1.Duration{Duration: 5 * time.Second},
ClusterName: "k8s",
ClusterCIDR: "1.2.3.4/24",
AllocateNodeCIDRs: true,
CIDRAllocatorType: "RangeAllocator",
ConfigureCloudRoutes: false,
}, },
ServiceController: &cmoptions.ServiceControllerOptions{ ServiceController: &cmoptions.ServiceControllerOptions{
ConcurrentServiceSyncs: 1, ServiceControllerConfiguration: &kubectrlmgrconfig.ServiceControllerConfiguration{
ConcurrentServiceSyncs: 1,
},
}, },
SecureServing: (&apiserveroptions.SecureServingOptions{ SecureServing: (&apiserveroptions.SecureServingOptions{
BindPort: 10001, BindPort: 10001,

View File

@ -96,84 +96,67 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
} }
s := KubeControllerManagerOptions{ s := KubeControllerManagerOptions{
Generic: cmoptions.NewGenericControllerManagerConfigurationOptions(componentConfig.Generic), Generic: cmoptions.NewGenericControllerManagerConfigurationOptions(&componentConfig.Generic),
KubeCloudShared: cmoptions.NewKubeCloudSharedOptions(componentConfig.KubeCloudShared), KubeCloudShared: cmoptions.NewKubeCloudSharedOptions(&componentConfig.KubeCloudShared),
ServiceController: &cmoptions.ServiceControllerOptions{
ServiceControllerConfiguration: &componentConfig.ServiceController,
},
AttachDetachController: &AttachDetachControllerOptions{ AttachDetachController: &AttachDetachControllerOptions{
ReconcilerSyncLoopPeriod: componentConfig.AttachDetachController.ReconcilerSyncLoopPeriod, &componentConfig.AttachDetachController,
}, },
CSRSigningController: &CSRSigningControllerOptions{ CSRSigningController: &CSRSigningControllerOptions{
ClusterSigningCertFile: componentConfig.CSRSigningController.ClusterSigningCertFile, &componentConfig.CSRSigningController,
ClusterSigningKeyFile: componentConfig.CSRSigningController.ClusterSigningKeyFile,
ClusterSigningDuration: componentConfig.CSRSigningController.ClusterSigningDuration,
}, },
DaemonSetController: &DaemonSetControllerOptions{ DaemonSetController: &DaemonSetControllerOptions{
ConcurrentDaemonSetSyncs: componentConfig.DaemonSetController.ConcurrentDaemonSetSyncs, &componentConfig.DaemonSetController,
}, },
DeploymentController: &DeploymentControllerOptions{ DeploymentController: &DeploymentControllerOptions{
ConcurrentDeploymentSyncs: componentConfig.DeploymentController.ConcurrentDeploymentSyncs, &componentConfig.DeploymentController,
DeploymentControllerSyncPeriod: componentConfig.DeploymentController.DeploymentControllerSyncPeriod,
}, },
DeprecatedFlags: &DeprecatedControllerOptions{ DeprecatedFlags: &DeprecatedControllerOptions{
RegisterRetryCount: componentConfig.DeprecatedController.RegisterRetryCount, &componentConfig.DeprecatedController,
}, },
EndpointController: &EndpointControllerOptions{ EndpointController: &EndpointControllerOptions{
ConcurrentEndpointSyncs: componentConfig.EndpointController.ConcurrentEndpointSyncs, &componentConfig.EndpointController,
}, },
GarbageCollectorController: &GarbageCollectorControllerOptions{ GarbageCollectorController: &GarbageCollectorControllerOptions{
ConcurrentGCSyncs: componentConfig.GarbageCollectorController.ConcurrentGCSyncs, &componentConfig.GarbageCollectorController,
EnableGarbageCollector: componentConfig.GarbageCollectorController.EnableGarbageCollector,
}, },
HPAController: &HPAControllerOptions{ HPAController: &HPAControllerOptions{
HorizontalPodAutoscalerSyncPeriod: componentConfig.HPAController.HorizontalPodAutoscalerSyncPeriod, &componentConfig.HPAController,
HorizontalPodAutoscalerUpscaleForbiddenWindow: componentConfig.HPAController.HorizontalPodAutoscalerUpscaleForbiddenWindow,
HorizontalPodAutoscalerDownscaleForbiddenWindow: componentConfig.HPAController.HorizontalPodAutoscalerDownscaleForbiddenWindow,
HorizontalPodAutoscalerDownscaleStabilizationWindow: componentConfig.HPAController.HorizontalPodAutoscalerDownscaleStabilizationWindow,
HorizontalPodAutoscalerCPUInitializationPeriod: componentConfig.HPAController.HorizontalPodAutoscalerCPUInitializationPeriod,
HorizontalPodAutoscalerInitialReadinessDelay: componentConfig.HPAController.HorizontalPodAutoscalerInitialReadinessDelay,
HorizontalPodAutoscalerTolerance: componentConfig.HPAController.HorizontalPodAutoscalerTolerance,
HorizontalPodAutoscalerUseRESTClients: componentConfig.HPAController.HorizontalPodAutoscalerUseRESTClients,
}, },
JobController: &JobControllerOptions{ JobController: &JobControllerOptions{
ConcurrentJobSyncs: componentConfig.JobController.ConcurrentJobSyncs, &componentConfig.JobController,
}, },
NamespaceController: &NamespaceControllerOptions{ NamespaceController: &NamespaceControllerOptions{
NamespaceSyncPeriod: componentConfig.NamespaceController.NamespaceSyncPeriod, &componentConfig.NamespaceController,
ConcurrentNamespaceSyncs: componentConfig.NamespaceController.ConcurrentNamespaceSyncs,
}, },
NodeIPAMController: &NodeIPAMControllerOptions{ NodeIPAMController: &NodeIPAMControllerOptions{
NodeCIDRMaskSize: componentConfig.NodeIPAMController.NodeCIDRMaskSize, &componentConfig.NodeIPAMController,
}, },
NodeLifecycleController: &NodeLifecycleControllerOptions{ NodeLifecycleController: &NodeLifecycleControllerOptions{
EnableTaintManager: componentConfig.NodeLifecycleController.EnableTaintManager, &componentConfig.NodeLifecycleController,
NodeMonitorGracePeriod: componentConfig.NodeLifecycleController.NodeMonitorGracePeriod,
NodeStartupGracePeriod: componentConfig.NodeLifecycleController.NodeStartupGracePeriod,
PodEvictionTimeout: componentConfig.NodeLifecycleController.PodEvictionTimeout,
}, },
PersistentVolumeBinderController: &PersistentVolumeBinderControllerOptions{ PersistentVolumeBinderController: &PersistentVolumeBinderControllerOptions{
PVClaimBinderSyncPeriod: componentConfig.PersistentVolumeBinderController.PVClaimBinderSyncPeriod, &componentConfig.PersistentVolumeBinderController,
VolumeConfiguration: componentConfig.PersistentVolumeBinderController.VolumeConfiguration,
}, },
PodGCController: &PodGCControllerOptions{ PodGCController: &PodGCControllerOptions{
TerminatedPodGCThreshold: componentConfig.PodGCController.TerminatedPodGCThreshold, &componentConfig.PodGCController,
}, },
ReplicaSetController: &ReplicaSetControllerOptions{ ReplicaSetController: &ReplicaSetControllerOptions{
ConcurrentRSSyncs: componentConfig.ReplicaSetController.ConcurrentRSSyncs, &componentConfig.ReplicaSetController,
}, },
ReplicationController: &ReplicationControllerOptions{ ReplicationController: &ReplicationControllerOptions{
ConcurrentRCSyncs: componentConfig.ReplicationController.ConcurrentRCSyncs, &componentConfig.ReplicationController,
}, },
ResourceQuotaController: &ResourceQuotaControllerOptions{ ResourceQuotaController: &ResourceQuotaControllerOptions{
ResourceQuotaSyncPeriod: componentConfig.ResourceQuotaController.ResourceQuotaSyncPeriod, &componentConfig.ResourceQuotaController,
ConcurrentResourceQuotaSyncs: componentConfig.ResourceQuotaController.ConcurrentResourceQuotaSyncs,
}, },
SAController: &SAControllerOptions{ SAController: &SAControllerOptions{
ConcurrentSATokenSyncs: componentConfig.SAController.ConcurrentSATokenSyncs, &componentConfig.SAController,
},
ServiceController: &cmoptions.ServiceControllerOptions{
ConcurrentServiceSyncs: componentConfig.ServiceController.ConcurrentServiceSyncs,
}, },
TTLAfterFinishedController: &TTLAfterFinishedControllerOptions{ TTLAfterFinishedController: &TTLAfterFinishedControllerOptions{
ConcurrentTTLSyncs: componentConfig.TTLAfterFinishedController.ConcurrentTTLSyncs, &componentConfig.TTLAfterFinishedController,
}, },
SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(), SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(),
InsecureServing: (&apiserveroptions.DeprecatedInsecureServingOptions{ InsecureServing: (&apiserveroptions.DeprecatedInsecureServingOptions{

View File

@ -124,139 +124,187 @@ func TestAddFlags(t *testing.T) {
expected := &KubeControllerManagerOptions{ expected := &KubeControllerManagerOptions{
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{ Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
Port: 10252, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config GenericControllerManagerConfiguration: &kubectrlmgrconfig.GenericControllerManagerConfiguration{
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Port: 10252, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod: metav1.Duration{Duration: 8 * time.Hour}, Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ MinResyncPeriod: metav1.Duration{Duration: 8 * time.Hour},
ContentType: "application/json", ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
QPS: 50.0, ContentType: "application/json",
Burst: 100, QPS: 50.0,
}, Burst: 100,
ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute}, },
LeaderElection: componentbaseconfig.LeaderElectionConfiguration{ ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute},
ResourceLock: "configmap", LeaderElection: componentbaseconfig.LeaderElectionConfiguration{
LeaderElect: false, ResourceLock: "configmap",
LeaseDuration: metav1.Duration{Duration: 30 * time.Second}, LeaderElect: false,
RenewDeadline: metav1.Duration{Duration: 15 * time.Second}, LeaseDuration: metav1.Duration{Duration: 30 * time.Second},
RetryPeriod: metav1.Duration{Duration: 5 * time.Second}, RenewDeadline: metav1.Duration{Duration: 15 * time.Second},
RetryPeriod: metav1.Duration{Duration: 5 * time.Second},
},
Controllers: []string{"foo", "bar"},
}, },
Debugging: &cmoptions.DebuggingOptions{ Debugging: &cmoptions.DebuggingOptions{
EnableProfiling: false, DebuggingConfiguration: &componentbaseconfig.DebuggingConfiguration{
EnableContentionProfiling: true, EnableProfiling: false,
EnableContentionProfiling: true,
},
}, },
Controllers: []string{"foo", "bar"},
}, },
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{ KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
UseServiceAccountCredentials: true, KubeCloudSharedConfiguration: &kubectrlmgrconfig.KubeCloudSharedConfiguration{
RouteReconciliationPeriod: metav1.Duration{Duration: 30 * time.Second}, UseServiceAccountCredentials: true,
NodeMonitorPeriod: metav1.Duration{Duration: 10 * time.Second}, RouteReconciliationPeriod: metav1.Duration{Duration: 30 * time.Second},
ClusterName: "k8s", NodeMonitorPeriod: metav1.Duration{Duration: 10 * time.Second},
ClusterCIDR: "1.2.3.4/24", ClusterName: "k8s",
AllocateNodeCIDRs: true, ClusterCIDR: "1.2.3.4/24",
CIDRAllocatorType: "CloudAllocator", AllocateNodeCIDRs: true,
ConfigureCloudRoutes: false, CIDRAllocatorType: "CloudAllocator",
ConfigureCloudRoutes: false,
},
CloudProvider: &cmoptions.CloudProviderOptions{ CloudProvider: &cmoptions.CloudProviderOptions{
Name: "gce", CloudProviderConfiguration: &kubectrlmgrconfig.CloudProviderConfiguration{
CloudConfigFile: "/cloud-config", Name: "gce",
CloudConfigFile: "/cloud-config",
},
},
},
ServiceController: &cmoptions.ServiceControllerOptions{
ServiceControllerConfiguration: &kubectrlmgrconfig.ServiceControllerConfiguration{
ConcurrentServiceSyncs: 2,
}, },
}, },
AttachDetachController: &AttachDetachControllerOptions{ AttachDetachController: &AttachDetachControllerOptions{
ReconcilerSyncLoopPeriod: metav1.Duration{Duration: 30 * time.Second}, &kubectrlmgrconfig.AttachDetachControllerConfiguration{
DisableAttachDetachReconcilerSync: true, ReconcilerSyncLoopPeriod: metav1.Duration{Duration: 30 * time.Second},
DisableAttachDetachReconcilerSync: true,
},
}, },
CSRSigningController: &CSRSigningControllerOptions{ CSRSigningController: &CSRSigningControllerOptions{
ClusterSigningCertFile: "/cluster-signing-cert", &kubectrlmgrconfig.CSRSigningControllerConfiguration{
ClusterSigningKeyFile: "/cluster-signing-key", ClusterSigningCertFile: "/cluster-signing-cert",
ClusterSigningDuration: metav1.Duration{Duration: 10 * time.Hour}, ClusterSigningKeyFile: "/cluster-signing-key",
ClusterSigningDuration: metav1.Duration{Duration: 10 * time.Hour},
},
}, },
DaemonSetController: &DaemonSetControllerOptions{ DaemonSetController: &DaemonSetControllerOptions{
ConcurrentDaemonSetSyncs: 2, &kubectrlmgrconfig.DaemonSetControllerConfiguration{
ConcurrentDaemonSetSyncs: 2,
},
}, },
DeploymentController: &DeploymentControllerOptions{ DeploymentController: &DeploymentControllerOptions{
ConcurrentDeploymentSyncs: 10, &kubectrlmgrconfig.DeploymentControllerConfiguration{
DeploymentControllerSyncPeriod: metav1.Duration{Duration: 45 * time.Second}, ConcurrentDeploymentSyncs: 10,
DeploymentControllerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
},
}, },
DeprecatedFlags: &DeprecatedControllerOptions{ DeprecatedFlags: &DeprecatedControllerOptions{
DeletingPodsQPS: 0.1, &kubectrlmgrconfig.DeprecatedControllerConfiguration{
RegisterRetryCount: 10, DeletingPodsQPS: 0.1,
RegisterRetryCount: 10,
},
}, },
EndpointController: &EndpointControllerOptions{ EndpointController: &EndpointControllerOptions{
ConcurrentEndpointSyncs: 10, &kubectrlmgrconfig.EndpointControllerConfiguration{
ConcurrentEndpointSyncs: 10,
},
}, },
GarbageCollectorController: &GarbageCollectorControllerOptions{ GarbageCollectorController: &GarbageCollectorControllerOptions{
ConcurrentGCSyncs: 30, &kubectrlmgrconfig.GarbageCollectorControllerConfiguration{
GCIgnoredResources: []kubectrlmgrconfig.GroupResource{ ConcurrentGCSyncs: 30,
{Group: "", Resource: "events"}, GCIgnoredResources: []kubectrlmgrconfig.GroupResource{
{Group: "", Resource: "events"},
},
EnableGarbageCollector: false,
}, },
EnableGarbageCollector: false,
}, },
HPAController: &HPAControllerOptions{ HPAController: &HPAControllerOptions{
HorizontalPodAutoscalerSyncPeriod: metav1.Duration{Duration: 45 * time.Second}, &kubectrlmgrconfig.HPAControllerConfiguration{
HorizontalPodAutoscalerUpscaleForbiddenWindow: metav1.Duration{Duration: 1 * time.Minute}, HorizontalPodAutoscalerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
HorizontalPodAutoscalerDownscaleForbiddenWindow: metav1.Duration{Duration: 2 * time.Minute}, HorizontalPodAutoscalerUpscaleForbiddenWindow: metav1.Duration{Duration: 1 * time.Minute},
HorizontalPodAutoscalerDownscaleStabilizationWindow: metav1.Duration{Duration: 3 * time.Minute}, HorizontalPodAutoscalerDownscaleForbiddenWindow: metav1.Duration{Duration: 2 * time.Minute},
HorizontalPodAutoscalerCPUInitializationPeriod: metav1.Duration{Duration: 90 * time.Second}, HorizontalPodAutoscalerDownscaleStabilizationWindow: metav1.Duration{Duration: 3 * time.Minute},
HorizontalPodAutoscalerInitialReadinessDelay: metav1.Duration{Duration: 50 * time.Second}, HorizontalPodAutoscalerCPUInitializationPeriod: metav1.Duration{Duration: 90 * time.Second},
HorizontalPodAutoscalerTolerance: 0.1, HorizontalPodAutoscalerInitialReadinessDelay: metav1.Duration{Duration: 50 * time.Second},
HorizontalPodAutoscalerUseRESTClients: true, HorizontalPodAutoscalerTolerance: 0.1,
HorizontalPodAutoscalerUseRESTClients: true,
},
}, },
JobController: &JobControllerOptions{ JobController: &JobControllerOptions{
ConcurrentJobSyncs: 5, &kubectrlmgrconfig.JobControllerConfiguration{
ConcurrentJobSyncs: 5,
},
}, },
NamespaceController: &NamespaceControllerOptions{ NamespaceController: &NamespaceControllerOptions{
NamespaceSyncPeriod: metav1.Duration{Duration: 10 * time.Minute}, &kubectrlmgrconfig.NamespaceControllerConfiguration{
ConcurrentNamespaceSyncs: 20, NamespaceSyncPeriod: metav1.Duration{Duration: 10 * time.Minute},
ConcurrentNamespaceSyncs: 20,
},
}, },
NodeIPAMController: &NodeIPAMControllerOptions{ NodeIPAMController: &NodeIPAMControllerOptions{
NodeCIDRMaskSize: 48, &kubectrlmgrconfig.NodeIPAMControllerConfiguration{
NodeCIDRMaskSize: 48,
},
}, },
NodeLifecycleController: &NodeLifecycleControllerOptions{ NodeLifecycleController: &NodeLifecycleControllerOptions{
EnableTaintManager: false, &kubectrlmgrconfig.NodeLifecycleControllerConfiguration{
NodeEvictionRate: 0.2, EnableTaintManager: false,
SecondaryNodeEvictionRate: 0.05, NodeEvictionRate: 0.2,
NodeMonitorGracePeriod: metav1.Duration{Duration: 30 * time.Second}, SecondaryNodeEvictionRate: 0.05,
NodeStartupGracePeriod: metav1.Duration{Duration: 30 * time.Second}, NodeMonitorGracePeriod: metav1.Duration{Duration: 30 * time.Second},
PodEvictionTimeout: metav1.Duration{Duration: 2 * time.Minute}, NodeStartupGracePeriod: metav1.Duration{Duration: 30 * time.Second},
LargeClusterSizeThreshold: 100, PodEvictionTimeout: metav1.Duration{Duration: 2 * time.Minute},
UnhealthyZoneThreshold: 0.6, LargeClusterSizeThreshold: 100,
UnhealthyZoneThreshold: 0.6,
},
}, },
PersistentVolumeBinderController: &PersistentVolumeBinderControllerOptions{ PersistentVolumeBinderController: &PersistentVolumeBinderControllerOptions{
PVClaimBinderSyncPeriod: metav1.Duration{Duration: 30 * time.Second}, &kubectrlmgrconfig.PersistentVolumeBinderControllerConfiguration{
VolumeConfiguration: kubectrlmgrconfig.VolumeConfiguration{ PVClaimBinderSyncPeriod: metav1.Duration{Duration: 30 * time.Second},
EnableDynamicProvisioning: false, VolumeConfiguration: kubectrlmgrconfig.VolumeConfiguration{
EnableHostPathProvisioning: true, EnableDynamicProvisioning: false,
FlexVolumePluginDir: "/flex-volume-plugin", EnableHostPathProvisioning: true,
PersistentVolumeRecyclerConfiguration: kubectrlmgrconfig.PersistentVolumeRecyclerConfiguration{ FlexVolumePluginDir: "/flex-volume-plugin",
MaximumRetry: 3, PersistentVolumeRecyclerConfiguration: kubectrlmgrconfig.PersistentVolumeRecyclerConfiguration{
MinimumTimeoutNFS: 200, MaximumRetry: 3,
IncrementTimeoutNFS: 45, MinimumTimeoutNFS: 200,
MinimumTimeoutHostPath: 45, IncrementTimeoutNFS: 45,
IncrementTimeoutHostPath: 45, MinimumTimeoutHostPath: 45,
IncrementTimeoutHostPath: 45,
},
}, },
}, },
}, },
PodGCController: &PodGCControllerOptions{ PodGCController: &PodGCControllerOptions{
TerminatedPodGCThreshold: 12000, &kubectrlmgrconfig.PodGCControllerConfiguration{
TerminatedPodGCThreshold: 12000,
},
}, },
ReplicaSetController: &ReplicaSetControllerOptions{ ReplicaSetController: &ReplicaSetControllerOptions{
ConcurrentRSSyncs: 10, &kubectrlmgrconfig.ReplicaSetControllerConfiguration{
ConcurrentRSSyncs: 10,
},
}, },
ReplicationController: &ReplicationControllerOptions{ ReplicationController: &ReplicationControllerOptions{
ConcurrentRCSyncs: 10, &kubectrlmgrconfig.ReplicationControllerConfiguration{
ConcurrentRCSyncs: 10,
},
}, },
ResourceQuotaController: &ResourceQuotaControllerOptions{ ResourceQuotaController: &ResourceQuotaControllerOptions{
ResourceQuotaSyncPeriod: metav1.Duration{Duration: 10 * time.Minute}, &kubectrlmgrconfig.ResourceQuotaControllerConfiguration{
ConcurrentResourceQuotaSyncs: 10, ResourceQuotaSyncPeriod: metav1.Duration{Duration: 10 * time.Minute},
ConcurrentResourceQuotaSyncs: 10,
},
}, },
SAController: &SAControllerOptions{ SAController: &SAControllerOptions{
ServiceAccountKeyFile: "/service-account-private-key", &kubectrlmgrconfig.SAControllerConfiguration{
ConcurrentSATokenSyncs: 10, ServiceAccountKeyFile: "/service-account-private-key",
}, ConcurrentSATokenSyncs: 10,
ServiceController: &cmoptions.ServiceControllerOptions{ },
ConcurrentServiceSyncs: 2,
}, },
TTLAfterFinishedController: &TTLAfterFinishedControllerOptions{ TTLAfterFinishedController: &TTLAfterFinishedControllerOptions{
ConcurrentTTLSyncs: 8, &kubectrlmgrconfig.TTLAfterFinishedControllerConfiguration{
ConcurrentTTLSyncs: 8,
},
}, },
SecureServing: (&apiserveroptions.SecureServingOptions{ SecureServing: (&apiserveroptions.SecureServingOptions{
BindPort: 10001, BindPort: 10001,