mirror of https://github.com/k3s-io/k3s
move some option struct from controller manager to kube-controller manager
parent
b005f2fba3
commit
4f06f9906f
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
"k8s.io/kubernetes/pkg/client/leaderelectionconfig"
|
||||
|
|
|
@ -21,6 +21,7 @@ import (
|
|||
"net"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/apiserver/pkg/server/options"
|
||||
genericcontrollermanager "k8s.io/kubernetes/cmd/controller-manager/app"
|
||||
)
|
||||
|
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import (
|
|||
"github.com/golang/glog"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options"
|
||||
kubeoptions "k8s.io/kubernetes/cmd/kube-controller-manager/app/options"
|
||||
"k8s.io/kubernetes/pkg/controller/certificates/approver"
|
||||
"k8s.io/kubernetes/pkg/controller/certificates/cleaner"
|
||||
"k8s.io/kubernetes/pkg/controller/certificates/signer"
|
||||
|
@ -55,12 +55,12 @@ func startCSRSigningController(ctx ControllerContext) (bool, error) {
|
|||
_, err := os.Stat(ctx.ComponentConfig.CSRSigningController.ClusterSigningCertFile)
|
||||
certFileExists = !os.IsNotExist(err)
|
||||
|
||||
certUsesDefault = (ctx.ComponentConfig.CSRSigningController.ClusterSigningCertFile == cmoptions.DefaultClusterSigningCertFile)
|
||||
certUsesDefault = (ctx.ComponentConfig.CSRSigningController.ClusterSigningCertFile == kubeoptions.DefaultClusterSigningCertFile)
|
||||
|
||||
_, err = os.Stat(ctx.ComponentConfig.CSRSigningController.ClusterSigningKeyFile)
|
||||
keyFileExists = !os.IsNotExist(err)
|
||||
|
||||
keyUsesDefault = (ctx.ComponentConfig.CSRSigningController.ClusterSigningKeyFile == cmoptions.DefaultClusterSigningKeyFile)
|
||||
keyUsesDefault = (ctx.ComponentConfig.CSRSigningController.ClusterSigningKeyFile == kubeoptions.DefaultClusterSigningKeyFile)
|
||||
|
||||
switch {
|
||||
case (keyFileExists && keyUsesDefault) || (certFileExists && certUsesDefault):
|
||||
|
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
|
@ -18,10 +18,12 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
||||
// DeprecatedControllerOptions holds the DeprecatedController options, those option are deprecated.
|
||||
// TODO remove these fields once the deprecated flags are removed.
|
||||
type DeprecatedControllerOptions struct {
|
||||
DeletingPodsQPS float32
|
||||
DeletingPodsBurst int32
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
|
@ -49,33 +49,38 @@ import (
|
|||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
const (
|
||||
// KubeControllerManagerUserAgent is the userAgent name when starting kube-controller managers.
|
||||
KubeControllerManagerUserAgent = "kube-controller-manager"
|
||||
)
|
||||
|
||||
// KubeControllerManagerOptions is the main context object for the kube-controller manager.
|
||||
type KubeControllerManagerOptions struct {
|
||||
CloudProvider *cmoptions.CloudProviderOptions
|
||||
Debugging *cmoptions.DebuggingOptions
|
||||
GenericComponent *cmoptions.GenericComponentConfigOptions
|
||||
KubeCloudShared *cmoptions.KubeCloudSharedOptions
|
||||
|
||||
AttachDetachController *cmoptions.AttachDetachControllerOptions
|
||||
CSRSigningController *cmoptions.CSRSigningControllerOptions
|
||||
DaemonSetController *cmoptions.DaemonSetControllerOptions
|
||||
DeploymentController *cmoptions.DeploymentControllerOptions
|
||||
DeprecatedFlags *cmoptions.DeprecatedControllerOptions
|
||||
EndPointController *cmoptions.EndPointControllerOptions
|
||||
GarbageCollectorController *cmoptions.GarbageCollectorControllerOptions
|
||||
HPAController *cmoptions.HPAControllerOptions
|
||||
JobController *cmoptions.JobControllerOptions
|
||||
NamespaceController *cmoptions.NamespaceControllerOptions
|
||||
NodeIpamController *cmoptions.NodeIpamControllerOptions
|
||||
NodeLifecycleController *cmoptions.NodeLifecycleControllerOptions
|
||||
PersistentVolumeBinderController *cmoptions.PersistentVolumeBinderControllerOptions
|
||||
PodGCController *cmoptions.PodGCControllerOptions
|
||||
ReplicaSetController *cmoptions.ReplicaSetControllerOptions
|
||||
ReplicationController *cmoptions.ReplicationControllerOptions
|
||||
ResourceQuotaController *cmoptions.ResourceQuotaControllerOptions
|
||||
SAController *cmoptions.SAControllerOptions
|
||||
ServiceController *cmoptions.ServiceControllerOptions
|
||||
|
||||
AttachDetachController *AttachDetachControllerOptions
|
||||
CSRSigningController *CSRSigningControllerOptions
|
||||
DaemonSetController *DaemonSetControllerOptions
|
||||
DeploymentController *DeploymentControllerOptions
|
||||
DeprecatedFlags *DeprecatedControllerOptions
|
||||
EndPointController *EndPointControllerOptions
|
||||
GarbageCollectorController *GarbageCollectorControllerOptions
|
||||
HPAController *HPAControllerOptions
|
||||
JobController *JobControllerOptions
|
||||
NamespaceController *NamespaceControllerOptions
|
||||
NodeIpamController *NodeIpamControllerOptions
|
||||
NodeLifecycleController *NodeLifecycleControllerOptions
|
||||
PersistentVolumeBinderController *PersistentVolumeBinderControllerOptions
|
||||
PodGCController *PodGCControllerOptions
|
||||
ReplicaSetController *ReplicaSetControllerOptions
|
||||
ReplicationController *ReplicationControllerOptions
|
||||
ResourceQuotaController *ResourceQuotaControllerOptions
|
||||
SAController *SAControllerOptions
|
||||
|
||||
Controllers []string
|
||||
ExternalCloudVolumePlugin string
|
||||
|
||||
|
@ -101,72 +106,72 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
|
|||
Debugging: &cmoptions.DebuggingOptions{},
|
||||
GenericComponent: cmoptions.NewGenericComponentConfigOptions(componentConfig.GenericComponent),
|
||||
KubeCloudShared: cmoptions.NewKubeCloudSharedOptions(componentConfig.KubeCloudShared),
|
||||
AttachDetachController: &cmoptions.AttachDetachControllerOptions{
|
||||
AttachDetachController: &AttachDetachControllerOptions{
|
||||
ReconcilerSyncLoopPeriod: componentConfig.AttachDetachController.ReconcilerSyncLoopPeriod,
|
||||
},
|
||||
CSRSigningController: &cmoptions.CSRSigningControllerOptions{
|
||||
CSRSigningController: &CSRSigningControllerOptions{
|
||||
ClusterSigningCertFile: componentConfig.CSRSigningController.ClusterSigningCertFile,
|
||||
ClusterSigningKeyFile: componentConfig.CSRSigningController.ClusterSigningKeyFile,
|
||||
ClusterSigningDuration: componentConfig.CSRSigningController.ClusterSigningDuration,
|
||||
},
|
||||
DaemonSetController: &cmoptions.DaemonSetControllerOptions{
|
||||
DaemonSetController: &DaemonSetControllerOptions{
|
||||
ConcurrentDaemonSetSyncs: componentConfig.DaemonSetController.ConcurrentDaemonSetSyncs,
|
||||
},
|
||||
DeploymentController: &cmoptions.DeploymentControllerOptions{
|
||||
DeploymentController: &DeploymentControllerOptions{
|
||||
ConcurrentDeploymentSyncs: componentConfig.DeploymentController.ConcurrentDeploymentSyncs,
|
||||
DeploymentControllerSyncPeriod: componentConfig.DeploymentController.DeploymentControllerSyncPeriod,
|
||||
},
|
||||
DeprecatedFlags: &cmoptions.DeprecatedControllerOptions{
|
||||
DeprecatedFlags: &DeprecatedControllerOptions{
|
||||
RegisterRetryCount: componentConfig.DeprecatedController.RegisterRetryCount,
|
||||
},
|
||||
EndPointController: &cmoptions.EndPointControllerOptions{
|
||||
EndPointController: &EndPointControllerOptions{
|
||||
ConcurrentEndpointSyncs: componentConfig.EndPointController.ConcurrentEndpointSyncs,
|
||||
},
|
||||
GarbageCollectorController: &cmoptions.GarbageCollectorControllerOptions{
|
||||
GarbageCollectorController: &GarbageCollectorControllerOptions{
|
||||
ConcurrentGCSyncs: componentConfig.GarbageCollectorController.ConcurrentGCSyncs,
|
||||
EnableGarbageCollector: componentConfig.GarbageCollectorController.EnableGarbageCollector,
|
||||
},
|
||||
HPAController: &cmoptions.HPAControllerOptions{
|
||||
HPAController: &HPAControllerOptions{
|
||||
HorizontalPodAutoscalerSyncPeriod: componentConfig.HPAController.HorizontalPodAutoscalerSyncPeriod,
|
||||
HorizontalPodAutoscalerUpscaleForbiddenWindow: componentConfig.HPAController.HorizontalPodAutoscalerUpscaleForbiddenWindow,
|
||||
HorizontalPodAutoscalerDownscaleForbiddenWindow: componentConfig.HPAController.HorizontalPodAutoscalerDownscaleForbiddenWindow,
|
||||
HorizontalPodAutoscalerTolerance: componentConfig.HPAController.HorizontalPodAutoscalerTolerance,
|
||||
HorizontalPodAutoscalerUseRESTClients: componentConfig.HPAController.HorizontalPodAutoscalerUseRESTClients,
|
||||
},
|
||||
JobController: &cmoptions.JobControllerOptions{
|
||||
JobController: &JobControllerOptions{
|
||||
ConcurrentJobSyncs: componentConfig.JobController.ConcurrentJobSyncs,
|
||||
},
|
||||
NamespaceController: &cmoptions.NamespaceControllerOptions{
|
||||
NamespaceController: &NamespaceControllerOptions{
|
||||
NamespaceSyncPeriod: componentConfig.NamespaceController.NamespaceSyncPeriod,
|
||||
ConcurrentNamespaceSyncs: componentConfig.NamespaceController.ConcurrentNamespaceSyncs,
|
||||
},
|
||||
NodeIpamController: &cmoptions.NodeIpamControllerOptions{
|
||||
NodeIpamController: &NodeIpamControllerOptions{
|
||||
NodeCIDRMaskSize: componentConfig.NodeIpamController.NodeCIDRMaskSize,
|
||||
},
|
||||
NodeLifecycleController: &cmoptions.NodeLifecycleControllerOptions{
|
||||
NodeLifecycleController: &NodeLifecycleControllerOptions{
|
||||
EnableTaintManager: componentConfig.NodeLifecycleController.EnableTaintManager,
|
||||
NodeMonitorGracePeriod: componentConfig.NodeLifecycleController.NodeMonitorGracePeriod,
|
||||
NodeStartupGracePeriod: componentConfig.NodeLifecycleController.NodeStartupGracePeriod,
|
||||
PodEvictionTimeout: componentConfig.NodeLifecycleController.PodEvictionTimeout,
|
||||
},
|
||||
PersistentVolumeBinderController: &cmoptions.PersistentVolumeBinderControllerOptions{
|
||||
PersistentVolumeBinderController: &PersistentVolumeBinderControllerOptions{
|
||||
PVClaimBinderSyncPeriod: componentConfig.PersistentVolumeBinderController.PVClaimBinderSyncPeriod,
|
||||
VolumeConfiguration: componentConfig.PersistentVolumeBinderController.VolumeConfiguration,
|
||||
},
|
||||
PodGCController: &cmoptions.PodGCControllerOptions{
|
||||
PodGCController: &PodGCControllerOptions{
|
||||
TerminatedPodGCThreshold: componentConfig.PodGCController.TerminatedPodGCThreshold,
|
||||
},
|
||||
ReplicaSetController: &cmoptions.ReplicaSetControllerOptions{
|
||||
ReplicaSetController: &ReplicaSetControllerOptions{
|
||||
ConcurrentRSSyncs: componentConfig.ReplicaSetController.ConcurrentRSSyncs,
|
||||
},
|
||||
ReplicationController: &cmoptions.ReplicationControllerOptions{
|
||||
ReplicationController: &ReplicationControllerOptions{
|
||||
ConcurrentRCSyncs: componentConfig.ReplicationController.ConcurrentRCSyncs,
|
||||
},
|
||||
ResourceQuotaController: &cmoptions.ResourceQuotaControllerOptions{
|
||||
ResourceQuotaController: &ResourceQuotaControllerOptions{
|
||||
ResourceQuotaSyncPeriod: componentConfig.ResourceQuotaController.ResourceQuotaSyncPeriod,
|
||||
ConcurrentResourceQuotaSyncs: componentConfig.ResourceQuotaController.ConcurrentResourceQuotaSyncs,
|
||||
},
|
||||
SAController: &cmoptions.SAControllerOptions{
|
||||
SAController: &SAControllerOptions{
|
||||
ConcurrentSATokenSyncs: componentConfig.SAController.ConcurrentSATokenSyncs,
|
||||
},
|
||||
ServiceController: &cmoptions.ServiceControllerOptions{
|
||||
|
@ -263,7 +268,7 @@ func (s *KubeControllerManagerOptions) AddFlags(fs *pflag.FlagSet, allController
|
|||
}
|
||||
|
||||
// ApplyTo fills up controller manager config with options.
|
||||
func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config, userAgent string) error {
|
||||
func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config) error {
|
||||
if err := s.CloudProvider.ApplyTo(&c.ComponentConfig.CloudProvider); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -347,32 +352,14 @@ func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config, u
|
|||
}
|
||||
|
||||
// sync back to component config
|
||||
// TODO: find more elegant way than synching back the values.
|
||||
// TODO: find more elegant way than syncing back the values.
|
||||
c.ComponentConfig.KubeCloudShared.Port = int32(s.InsecureServing.BindPort)
|
||||
c.ComponentConfig.KubeCloudShared.Address = s.InsecureServing.BindAddress.String()
|
||||
|
||||
var err error
|
||||
c.Kubeconfig, err = clientcmd.BuildConfigFromFlags(s.Master, s.Kubeconfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Kubeconfig.ContentConfig.ContentType = s.GenericComponent.ContentType
|
||||
c.Kubeconfig.QPS = s.GenericComponent.KubeAPIQPS
|
||||
c.Kubeconfig.Burst = int(s.GenericComponent.KubeAPIBurst)
|
||||
|
||||
c.Client, err = clientset.NewForConfig(restclient.AddUserAgent(c.Kubeconfig, userAgent))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c.LeaderElectionClient = clientset.NewForConfigOrDie(restclient.AddUserAgent(c.Kubeconfig, "leader-election"))
|
||||
|
||||
c.EventRecorder = createRecorder(c.Client, userAgent)
|
||||
|
||||
c.ComponentConfig.Controllers = s.Controllers
|
||||
c.ComponentConfig.ExternalCloudVolumePlugin = s.ExternalCloudVolumePlugin
|
||||
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
// Validate is used to validate the options and config before launching the controller manager
|
||||
|
@ -432,8 +419,30 @@ func (s KubeControllerManagerOptions) Config(allControllers []string, disabledBy
|
|||
return nil, err
|
||||
}
|
||||
|
||||
c := &kubecontrollerconfig.Config{}
|
||||
if err := s.ApplyTo(c, "kube-controller-manager"); err != nil {
|
||||
kubeconfig, err := clientcmd.BuildConfigFromFlags(s.Master, s.Kubeconfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
kubeconfig.ContentConfig.ContentType = s.GenericComponent.ContentType
|
||||
kubeconfig.QPS = s.GenericComponent.KubeAPIQPS
|
||||
kubeconfig.Burst = int(s.GenericComponent.KubeAPIBurst)
|
||||
|
||||
client, err := clientset.NewForConfig(restclient.AddUserAgent(kubeconfig, KubeControllerManagerUserAgent))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
leaderElectionClient := clientset.NewForConfigOrDie(restclient.AddUserAgent(kubeconfig, "leader-election"))
|
||||
|
||||
eventRecorder := createRecorder(client, KubeControllerManagerUserAgent)
|
||||
|
||||
c := &kubecontrollerconfig.Config{
|
||||
Client: client,
|
||||
Kubeconfig: kubeconfig,
|
||||
EventRecorder: eventRecorder,
|
||||
LeaderElectionClient: leaderElectionClient,
|
||||
}
|
||||
if err := s.ApplyTo(c); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
@ -444,5 +453,6 @@ func createRecorder(kubeClient kubernetes.Interface, userAgent string) record.Ev
|
|||
eventBroadcaster := record.NewBroadcaster()
|
||||
eventBroadcaster.StartLogging(glog.Infof)
|
||||
eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: kubeClient.CoreV1().Events("")})
|
||||
// TODO: remove dependency on the legacyscheme
|
||||
return eventBroadcaster.NewRecorder(legacyscheme.Scheme, v1.EventSource{Component: userAgent})
|
||||
}
|
||||
|
|
|
@ -150,30 +150,30 @@ func TestAddFlags(t *testing.T) {
|
|||
CIDRAllocatorType: "CloudAllocator",
|
||||
ConfigureCloudRoutes: false,
|
||||
},
|
||||
AttachDetachController: &cmoptions.AttachDetachControllerOptions{
|
||||
AttachDetachController: &AttachDetachControllerOptions{
|
||||
ReconcilerSyncLoopPeriod: metav1.Duration{Duration: 30 * time.Second},
|
||||
DisableAttachDetachReconcilerSync: true,
|
||||
},
|
||||
CSRSigningController: &cmoptions.CSRSigningControllerOptions{
|
||||
CSRSigningController: &CSRSigningControllerOptions{
|
||||
ClusterSigningCertFile: "/cluster-signing-cert",
|
||||
ClusterSigningKeyFile: "/cluster-signing-key",
|
||||
ClusterSigningDuration: metav1.Duration{Duration: 10 * time.Hour},
|
||||
},
|
||||
DaemonSetController: &cmoptions.DaemonSetControllerOptions{
|
||||
DaemonSetController: &DaemonSetControllerOptions{
|
||||
ConcurrentDaemonSetSyncs: 2,
|
||||
},
|
||||
DeploymentController: &cmoptions.DeploymentControllerOptions{
|
||||
DeploymentController: &DeploymentControllerOptions{
|
||||
ConcurrentDeploymentSyncs: 10,
|
||||
DeploymentControllerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
|
||||
},
|
||||
DeprecatedFlags: &cmoptions.DeprecatedControllerOptions{
|
||||
DeprecatedFlags: &DeprecatedControllerOptions{
|
||||
DeletingPodsQPS: 0.1,
|
||||
RegisterRetryCount: 10,
|
||||
},
|
||||
EndPointController: &cmoptions.EndPointControllerOptions{
|
||||
EndPointController: &EndPointControllerOptions{
|
||||
ConcurrentEndpointSyncs: 10,
|
||||
},
|
||||
GarbageCollectorController: &cmoptions.GarbageCollectorControllerOptions{
|
||||
GarbageCollectorController: &GarbageCollectorControllerOptions{
|
||||
ConcurrentGCSyncs: 30,
|
||||
GCIgnoredResources: []componentconfig.GroupResource{
|
||||
{Group: "extensions", Resource: "replicationcontrollers"},
|
||||
|
@ -190,24 +190,24 @@ func TestAddFlags(t *testing.T) {
|
|||
},
|
||||
EnableGarbageCollector: false,
|
||||
},
|
||||
HPAController: &cmoptions.HPAControllerOptions{
|
||||
HPAController: &HPAControllerOptions{
|
||||
HorizontalPodAutoscalerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
|
||||
HorizontalPodAutoscalerUpscaleForbiddenWindow: metav1.Duration{Duration: 1 * time.Minute},
|
||||
HorizontalPodAutoscalerDownscaleForbiddenWindow: metav1.Duration{Duration: 2 * time.Minute},
|
||||
HorizontalPodAutoscalerTolerance: 0.1,
|
||||
HorizontalPodAutoscalerUseRESTClients: true,
|
||||
},
|
||||
JobController: &cmoptions.JobControllerOptions{
|
||||
JobController: &JobControllerOptions{
|
||||
ConcurrentJobSyncs: 5,
|
||||
},
|
||||
NamespaceController: &cmoptions.NamespaceControllerOptions{
|
||||
NamespaceController: &NamespaceControllerOptions{
|
||||
NamespaceSyncPeriod: metav1.Duration{Duration: 10 * time.Minute},
|
||||
ConcurrentNamespaceSyncs: 20,
|
||||
},
|
||||
NodeIpamController: &cmoptions.NodeIpamControllerOptions{
|
||||
NodeIpamController: &NodeIpamControllerOptions{
|
||||
NodeCIDRMaskSize: 48,
|
||||
},
|
||||
NodeLifecycleController: &cmoptions.NodeLifecycleControllerOptions{
|
||||
NodeLifecycleController: &NodeLifecycleControllerOptions{
|
||||
EnableTaintManager: false,
|
||||
NodeEvictionRate: 0.2,
|
||||
SecondaryNodeEvictionRate: 0.05,
|
||||
|
@ -217,7 +217,7 @@ func TestAddFlags(t *testing.T) {
|
|||
LargeClusterSizeThreshold: 100,
|
||||
UnhealthyZoneThreshold: 0.6,
|
||||
},
|
||||
PersistentVolumeBinderController: &cmoptions.PersistentVolumeBinderControllerOptions{
|
||||
PersistentVolumeBinderController: &PersistentVolumeBinderControllerOptions{
|
||||
PVClaimBinderSyncPeriod: metav1.Duration{Duration: 30 * time.Second},
|
||||
VolumeConfiguration: componentconfig.VolumeConfiguration{
|
||||
EnableDynamicProvisioning: false,
|
||||
|
@ -232,20 +232,20 @@ func TestAddFlags(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
PodGCController: &cmoptions.PodGCControllerOptions{
|
||||
PodGCController: &PodGCControllerOptions{
|
||||
TerminatedPodGCThreshold: 12000,
|
||||
},
|
||||
ReplicaSetController: &cmoptions.ReplicaSetControllerOptions{
|
||||
ReplicaSetController: &ReplicaSetControllerOptions{
|
||||
ConcurrentRSSyncs: 10,
|
||||
},
|
||||
ReplicationController: &cmoptions.ReplicationControllerOptions{
|
||||
ReplicationController: &ReplicationControllerOptions{
|
||||
ConcurrentRCSyncs: 10,
|
||||
},
|
||||
ResourceQuotaController: &cmoptions.ResourceQuotaControllerOptions{
|
||||
ResourceQuotaController: &ResourceQuotaControllerOptions{
|
||||
ResourceQuotaSyncPeriod: metav1.Duration{Duration: 10 * time.Minute},
|
||||
ConcurrentResourceQuotaSyncs: 10,
|
||||
},
|
||||
SAController: &cmoptions.SAControllerOptions{
|
||||
SAController: &SAControllerOptions{
|
||||
ServiceAccountKeyFile: "/service-account-private-key",
|
||||
ConcurrentSATokenSyncs: 10,
|
||||
},
|
||||
|
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
|
@ -18,6 +18,7 @@ package options
|
|||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
)
|
||||
|
Loading…
Reference in New Issue