mirror of https://github.com/k3s-io/k3s
fix all reference for wrap componentconfig type
parent
5b43a24318
commit
3518fb400c
|
@ -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{
|
||||||
|
|
|
@ -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,6 +37,7 @@ func TestDefaultFlags(t *testing.T) {
|
||||||
|
|
||||||
expected := &CloudControllerManagerOptions{
|
expected := &CloudControllerManagerOptions{
|
||||||
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
|
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
|
||||||
|
GenericControllerManagerConfiguration: &kubectrlmgrconfig.GenericControllerManagerConfiguration{
|
||||||
Port: DefaultInsecureCloudControllerManagerPort, // 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
|
||||||
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
|
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},
|
MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour},
|
||||||
|
@ -52,12 +54,16 @@ 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{"*"},
|
Controllers: []string{"*"},
|
||||||
},
|
},
|
||||||
|
Debugging: &cmoptions.DebuggingOptions{
|
||||||
|
DebuggingConfiguration: &componentbaseconfig.DebuggingConfiguration{
|
||||||
|
EnableContentionProfiling: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
|
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
|
||||||
|
KubeCloudSharedConfiguration: &kubectrlmgrconfig.KubeCloudSharedConfiguration{
|
||||||
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",
|
||||||
|
@ -65,14 +71,19 @@ func TestDefaultFlags(t *testing.T) {
|
||||||
AllocateNodeCIDRs: false,
|
AllocateNodeCIDRs: false,
|
||||||
CIDRAllocatorType: "",
|
CIDRAllocatorType: "",
|
||||||
ConfigureCloudRoutes: true,
|
ConfigureCloudRoutes: true,
|
||||||
|
},
|
||||||
CloudProvider: &cmoptions.CloudProviderOptions{
|
CloudProvider: &cmoptions.CloudProviderOptions{
|
||||||
|
CloudProviderConfiguration: &kubectrlmgrconfig.CloudProviderConfiguration{
|
||||||
Name: "",
|
Name: "",
|
||||||
CloudConfigFile: "",
|
CloudConfigFile: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
ServiceController: &cmoptions.ServiceControllerOptions{
|
ServiceController: &cmoptions.ServiceControllerOptions{
|
||||||
|
ServiceControllerConfiguration: &kubectrlmgrconfig.ServiceControllerConfiguration{
|
||||||
ConcurrentServiceSyncs: 1,
|
ConcurrentServiceSyncs: 1,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
SecureServing: (&apiserveroptions.SecureServingOptions{
|
SecureServing: (&apiserveroptions.SecureServingOptions{
|
||||||
BindPort: 10258,
|
BindPort: 10258,
|
||||||
BindAddress: net.ParseIP("0.0.0.0"),
|
BindAddress: net.ParseIP("0.0.0.0"),
|
||||||
|
@ -155,6 +166,7 @@ func TestAddFlags(t *testing.T) {
|
||||||
|
|
||||||
expected := &CloudControllerManagerOptions{
|
expected := &CloudControllerManagerOptions{
|
||||||
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
|
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
|
||||||
|
GenericControllerManagerConfiguration: &kubectrlmgrconfig.GenericControllerManagerConfiguration{
|
||||||
Port: DefaultInsecureCloudControllerManagerPort, // 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
|
||||||
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component 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},
|
MinResyncPeriod: metav1.Duration{Duration: 100 * time.Minute},
|
||||||
|
@ -171,16 +183,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{"foo", "bar"},
|
Controllers: []string{"foo", "bar"},
|
||||||
},
|
},
|
||||||
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
|
Debugging: &cmoptions.DebuggingOptions{
|
||||||
CloudProvider: &cmoptions.CloudProviderOptions{
|
DebuggingConfiguration: &componentbaseconfig.DebuggingConfiguration{
|
||||||
Name: "gce",
|
EnableContentionProfiling: true,
|
||||||
CloudConfigFile: "/cloud-config",
|
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
|
||||||
|
KubeCloudSharedConfiguration: &kubectrlmgrconfig.KubeCloudSharedConfiguration{
|
||||||
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",
|
||||||
|
@ -189,9 +201,18 @@ func TestAddFlags(t *testing.T) {
|
||||||
CIDRAllocatorType: "RangeAllocator",
|
CIDRAllocatorType: "RangeAllocator",
|
||||||
ConfigureCloudRoutes: false,
|
ConfigureCloudRoutes: false,
|
||||||
},
|
},
|
||||||
|
CloudProvider: &cmoptions.CloudProviderOptions{
|
||||||
|
CloudProviderConfiguration: &kubectrlmgrconfig.CloudProviderConfiguration{
|
||||||
|
Name: "gce",
|
||||||
|
CloudConfigFile: "/cloud-config",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
ServiceController: &cmoptions.ServiceControllerOptions{
|
ServiceController: &cmoptions.ServiceControllerOptions{
|
||||||
|
ServiceControllerConfiguration: &kubectrlmgrconfig.ServiceControllerConfiguration{
|
||||||
ConcurrentServiceSyncs: 1,
|
ConcurrentServiceSyncs: 1,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
SecureServing: (&apiserveroptions.SecureServingOptions{
|
SecureServing: (&apiserveroptions.SecureServingOptions{
|
||||||
BindPort: 10001,
|
BindPort: 10001,
|
||||||
BindAddress: net.ParseIP("192.168.4.21"),
|
BindAddress: net.ParseIP("192.168.4.21"),
|
||||||
|
|
|
@ -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{
|
||||||
|
|
|
@ -124,6 +124,7 @@ func TestAddFlags(t *testing.T) {
|
||||||
|
|
||||||
expected := &KubeControllerManagerOptions{
|
expected := &KubeControllerManagerOptions{
|
||||||
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
|
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
|
||||||
|
GenericControllerManagerConfiguration: &kubectrlmgrconfig.GenericControllerManagerConfiguration{
|
||||||
Port: 10252, // 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
|
||||||
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component 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},
|
MinResyncPeriod: metav1.Duration{Duration: 8 * time.Hour},
|
||||||
|
@ -140,13 +141,17 @@ 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},
|
||||||
},
|
},
|
||||||
|
Controllers: []string{"foo", "bar"},
|
||||||
|
},
|
||||||
Debugging: &cmoptions.DebuggingOptions{
|
Debugging: &cmoptions.DebuggingOptions{
|
||||||
|
DebuggingConfiguration: &componentbaseconfig.DebuggingConfiguration{
|
||||||
EnableProfiling: false,
|
EnableProfiling: false,
|
||||||
EnableContentionProfiling: true,
|
EnableContentionProfiling: true,
|
||||||
},
|
},
|
||||||
Controllers: []string{"foo", "bar"},
|
},
|
||||||
},
|
},
|
||||||
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
|
KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
|
||||||
|
KubeCloudSharedConfiguration: &kubectrlmgrconfig.KubeCloudSharedConfiguration{
|
||||||
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},
|
||||||
|
@ -155,42 +160,65 @@ func TestAddFlags(t *testing.T) {
|
||||||
AllocateNodeCIDRs: true,
|
AllocateNodeCIDRs: true,
|
||||||
CIDRAllocatorType: "CloudAllocator",
|
CIDRAllocatorType: "CloudAllocator",
|
||||||
ConfigureCloudRoutes: false,
|
ConfigureCloudRoutes: false,
|
||||||
|
},
|
||||||
CloudProvider: &cmoptions.CloudProviderOptions{
|
CloudProvider: &cmoptions.CloudProviderOptions{
|
||||||
|
CloudProviderConfiguration: &kubectrlmgrconfig.CloudProviderConfiguration{
|
||||||
Name: "gce",
|
Name: "gce",
|
||||||
CloudConfigFile: "/cloud-config",
|
CloudConfigFile: "/cloud-config",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
ServiceController: &cmoptions.ServiceControllerOptions{
|
||||||
|
ServiceControllerConfiguration: &kubectrlmgrconfig.ServiceControllerConfiguration{
|
||||||
|
ConcurrentServiceSyncs: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
AttachDetachController: &AttachDetachControllerOptions{
|
AttachDetachController: &AttachDetachControllerOptions{
|
||||||
|
&kubectrlmgrconfig.AttachDetachControllerConfiguration{
|
||||||
ReconcilerSyncLoopPeriod: metav1.Duration{Duration: 30 * time.Second},
|
ReconcilerSyncLoopPeriod: metav1.Duration{Duration: 30 * time.Second},
|
||||||
DisableAttachDetachReconcilerSync: true,
|
DisableAttachDetachReconcilerSync: true,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
CSRSigningController: &CSRSigningControllerOptions{
|
CSRSigningController: &CSRSigningControllerOptions{
|
||||||
|
&kubectrlmgrconfig.CSRSigningControllerConfiguration{
|
||||||
ClusterSigningCertFile: "/cluster-signing-cert",
|
ClusterSigningCertFile: "/cluster-signing-cert",
|
||||||
ClusterSigningKeyFile: "/cluster-signing-key",
|
ClusterSigningKeyFile: "/cluster-signing-key",
|
||||||
ClusterSigningDuration: metav1.Duration{Duration: 10 * time.Hour},
|
ClusterSigningDuration: metav1.Duration{Duration: 10 * time.Hour},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
DaemonSetController: &DaemonSetControllerOptions{
|
DaemonSetController: &DaemonSetControllerOptions{
|
||||||
|
&kubectrlmgrconfig.DaemonSetControllerConfiguration{
|
||||||
ConcurrentDaemonSetSyncs: 2,
|
ConcurrentDaemonSetSyncs: 2,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
DeploymentController: &DeploymentControllerOptions{
|
DeploymentController: &DeploymentControllerOptions{
|
||||||
|
&kubectrlmgrconfig.DeploymentControllerConfiguration{
|
||||||
ConcurrentDeploymentSyncs: 10,
|
ConcurrentDeploymentSyncs: 10,
|
||||||
DeploymentControllerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
|
DeploymentControllerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
DeprecatedFlags: &DeprecatedControllerOptions{
|
DeprecatedFlags: &DeprecatedControllerOptions{
|
||||||
|
&kubectrlmgrconfig.DeprecatedControllerConfiguration{
|
||||||
DeletingPodsQPS: 0.1,
|
DeletingPodsQPS: 0.1,
|
||||||
RegisterRetryCount: 10,
|
RegisterRetryCount: 10,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
EndpointController: &EndpointControllerOptions{
|
EndpointController: &EndpointControllerOptions{
|
||||||
|
&kubectrlmgrconfig.EndpointControllerConfiguration{
|
||||||
ConcurrentEndpointSyncs: 10,
|
ConcurrentEndpointSyncs: 10,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
GarbageCollectorController: &GarbageCollectorControllerOptions{
|
GarbageCollectorController: &GarbageCollectorControllerOptions{
|
||||||
|
&kubectrlmgrconfig.GarbageCollectorControllerConfiguration{
|
||||||
ConcurrentGCSyncs: 30,
|
ConcurrentGCSyncs: 30,
|
||||||
GCIgnoredResources: []kubectrlmgrconfig.GroupResource{
|
GCIgnoredResources: []kubectrlmgrconfig.GroupResource{
|
||||||
{Group: "", Resource: "events"},
|
{Group: "", Resource: "events"},
|
||||||
},
|
},
|
||||||
EnableGarbageCollector: false,
|
EnableGarbageCollector: false,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
HPAController: &HPAControllerOptions{
|
HPAController: &HPAControllerOptions{
|
||||||
|
&kubectrlmgrconfig.HPAControllerConfiguration{
|
||||||
HorizontalPodAutoscalerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
|
HorizontalPodAutoscalerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
|
||||||
HorizontalPodAutoscalerUpscaleForbiddenWindow: metav1.Duration{Duration: 1 * time.Minute},
|
HorizontalPodAutoscalerUpscaleForbiddenWindow: metav1.Duration{Duration: 1 * time.Minute},
|
||||||
HorizontalPodAutoscalerDownscaleForbiddenWindow: metav1.Duration{Duration: 2 * time.Minute},
|
HorizontalPodAutoscalerDownscaleForbiddenWindow: metav1.Duration{Duration: 2 * time.Minute},
|
||||||
|
@ -200,17 +228,25 @@ func TestAddFlags(t *testing.T) {
|
||||||
HorizontalPodAutoscalerTolerance: 0.1,
|
HorizontalPodAutoscalerTolerance: 0.1,
|
||||||
HorizontalPodAutoscalerUseRESTClients: true,
|
HorizontalPodAutoscalerUseRESTClients: true,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
JobController: &JobControllerOptions{
|
JobController: &JobControllerOptions{
|
||||||
|
&kubectrlmgrconfig.JobControllerConfiguration{
|
||||||
ConcurrentJobSyncs: 5,
|
ConcurrentJobSyncs: 5,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
NamespaceController: &NamespaceControllerOptions{
|
NamespaceController: &NamespaceControllerOptions{
|
||||||
|
&kubectrlmgrconfig.NamespaceControllerConfiguration{
|
||||||
NamespaceSyncPeriod: metav1.Duration{Duration: 10 * time.Minute},
|
NamespaceSyncPeriod: metav1.Duration{Duration: 10 * time.Minute},
|
||||||
ConcurrentNamespaceSyncs: 20,
|
ConcurrentNamespaceSyncs: 20,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
NodeIPAMController: &NodeIPAMControllerOptions{
|
NodeIPAMController: &NodeIPAMControllerOptions{
|
||||||
|
&kubectrlmgrconfig.NodeIPAMControllerConfiguration{
|
||||||
NodeCIDRMaskSize: 48,
|
NodeCIDRMaskSize: 48,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
NodeLifecycleController: &NodeLifecycleControllerOptions{
|
NodeLifecycleController: &NodeLifecycleControllerOptions{
|
||||||
|
&kubectrlmgrconfig.NodeLifecycleControllerConfiguration{
|
||||||
EnableTaintManager: false,
|
EnableTaintManager: false,
|
||||||
NodeEvictionRate: 0.2,
|
NodeEvictionRate: 0.2,
|
||||||
SecondaryNodeEvictionRate: 0.05,
|
SecondaryNodeEvictionRate: 0.05,
|
||||||
|
@ -220,7 +256,9 @@ func TestAddFlags(t *testing.T) {
|
||||||
LargeClusterSizeThreshold: 100,
|
LargeClusterSizeThreshold: 100,
|
||||||
UnhealthyZoneThreshold: 0.6,
|
UnhealthyZoneThreshold: 0.6,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
PersistentVolumeBinderController: &PersistentVolumeBinderControllerOptions{
|
PersistentVolumeBinderController: &PersistentVolumeBinderControllerOptions{
|
||||||
|
&kubectrlmgrconfig.PersistentVolumeBinderControllerConfiguration{
|
||||||
PVClaimBinderSyncPeriod: metav1.Duration{Duration: 30 * time.Second},
|
PVClaimBinderSyncPeriod: metav1.Duration{Duration: 30 * time.Second},
|
||||||
VolumeConfiguration: kubectrlmgrconfig.VolumeConfiguration{
|
VolumeConfiguration: kubectrlmgrconfig.VolumeConfiguration{
|
||||||
EnableDynamicProvisioning: false,
|
EnableDynamicProvisioning: false,
|
||||||
|
@ -235,29 +273,39 @@ func TestAddFlags(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
PodGCController: &PodGCControllerOptions{
|
PodGCController: &PodGCControllerOptions{
|
||||||
|
&kubectrlmgrconfig.PodGCControllerConfiguration{
|
||||||
TerminatedPodGCThreshold: 12000,
|
TerminatedPodGCThreshold: 12000,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
ReplicaSetController: &ReplicaSetControllerOptions{
|
ReplicaSetController: &ReplicaSetControllerOptions{
|
||||||
|
&kubectrlmgrconfig.ReplicaSetControllerConfiguration{
|
||||||
ConcurrentRSSyncs: 10,
|
ConcurrentRSSyncs: 10,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
ReplicationController: &ReplicationControllerOptions{
|
ReplicationController: &ReplicationControllerOptions{
|
||||||
|
&kubectrlmgrconfig.ReplicationControllerConfiguration{
|
||||||
ConcurrentRCSyncs: 10,
|
ConcurrentRCSyncs: 10,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
ResourceQuotaController: &ResourceQuotaControllerOptions{
|
ResourceQuotaController: &ResourceQuotaControllerOptions{
|
||||||
|
&kubectrlmgrconfig.ResourceQuotaControllerConfiguration{
|
||||||
ResourceQuotaSyncPeriod: metav1.Duration{Duration: 10 * time.Minute},
|
ResourceQuotaSyncPeriod: metav1.Duration{Duration: 10 * time.Minute},
|
||||||
ConcurrentResourceQuotaSyncs: 10,
|
ConcurrentResourceQuotaSyncs: 10,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
SAController: &SAControllerOptions{
|
SAController: &SAControllerOptions{
|
||||||
|
&kubectrlmgrconfig.SAControllerConfiguration{
|
||||||
ServiceAccountKeyFile: "/service-account-private-key",
|
ServiceAccountKeyFile: "/service-account-private-key",
|
||||||
ConcurrentSATokenSyncs: 10,
|
ConcurrentSATokenSyncs: 10,
|
||||||
},
|
},
|
||||||
ServiceController: &cmoptions.ServiceControllerOptions{
|
|
||||||
ConcurrentServiceSyncs: 2,
|
|
||||||
},
|
},
|
||||||
TTLAfterFinishedController: &TTLAfterFinishedControllerOptions{
|
TTLAfterFinishedController: &TTLAfterFinishedControllerOptions{
|
||||||
|
&kubectrlmgrconfig.TTLAfterFinishedControllerConfiguration{
|
||||||
ConcurrentTTLSyncs: 8,
|
ConcurrentTTLSyncs: 8,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
SecureServing: (&apiserveroptions.SecureServingOptions{
|
SecureServing: (&apiserveroptions.SecureServingOptions{
|
||||||
BindPort: 10001,
|
BindPort: 10001,
|
||||||
BindAddress: net.ParseIP("192.168.4.21"),
|
BindAddress: net.ParseIP("192.168.4.21"),
|
||||||
|
|
Loading…
Reference in New Issue