Unverified Commit b8e97d34 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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
parents b38a8164 b17d7bf9
...@@ -102,7 +102,7 @@ the cloud specific control loops shipped with Kubernetes.`, ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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)
......
...@@ -55,6 +55,7 @@ go_test( ...@@ -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",
......
...@@ -55,9 +55,7 @@ const ( ...@@ -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) ...@@ -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) ...@@ -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 ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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 { ...@@ -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 { ...@@ -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)
} }
} }
......
...@@ -24,6 +24,7 @@ import ( ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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",
......
...@@ -14,8 +14,11 @@ go_library( ...@@ -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",
], ],
) )
......
...@@ -17,77 +17,112 @@ limitations under the License. ...@@ -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.")
leaderelectionconfig.BindFlags(&o.LeaderElection, fs) 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, 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
} }
...@@ -26,8 +26,8 @@ import ( ...@@ -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 { ...@@ -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) { ...@@ -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 ...@@ -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 { ...@@ -109,5 +114,7 @@ func (o *KubeCloudSharedOptions) Validate() []error {
} }
errs := []error{} errs := []error{}
errs = append(errs, o.CloudProvider.Validate()...)
return errs return errs
} }
...@@ -133,7 +133,7 @@ controller, and serviceaccounts controller.`, ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 ...@@ -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 ...@@ -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)
......
...@@ -96,10 +96,10 @@ func startNodeIpamController(ctx ControllerContext) (http.Handler, bool, error) ...@@ -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) ...@@ -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) ...@@ -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
} }
......
...@@ -43,7 +43,6 @@ go_library( ...@@ -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( ...@@ -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",
......
...@@ -22,13 +22,13 @@ import ( ...@@ -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) { ...@@ -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 ...@@ -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
} }
......
...@@ -22,14 +22,14 @@ import ( ...@@ -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) { ...@@ -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 ...@@ -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
} }
......
...@@ -25,6 +25,7 @@ import ( ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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"),
......
...@@ -18,6 +18,7 @@ go_library( ...@@ -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",
......
...@@ -17,6 +17,7 @@ limitations under the License. ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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. // 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
...@@ -98,16 +94,6 @@ type KubeControllerManagerConfiguration struct { ...@@ -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 { ...@@ -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 { ...@@ -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. // port is the port that the controller-manager's http service runs on.
Name string Port int32
// cloudConfigFile is the path to the cloud provider configuration file. // address is the IP address to serve on (set to 0.0.0.0 for all interfaces).
CloudConfigFile string Address string
}
type GenericComponentConfiguration struct {
// minResyncPeriod is the resync period in reflectors; will be random between // minResyncPeriod is the resync period in reflectors; will be random between
// minResyncPeriod and 2*minResyncPeriod. // minResyncPeriod and 2*minResyncPeriod.
MinResyncPeriod metav1.Duration MinResyncPeriod metav1.Duration
// contentType is contentType of requests sent to apiserver. // ClientConnection specifies the kubeconfig file and client connection
ContentType string // settings for the proxy server to use when communicating with the apiserver.
// kubeAPIQPS is the QPS to use while talking with kubernetes apiserver. ClientConnection apimachineryconfig.ClientConnectionConfiguration
KubeAPIQPS float32
// kubeAPIBurst is the burst to use while talking with kubernetes apiserver.
KubeAPIBurst int32
// How long to wait between starting controller managers // How long to wait between starting controller managers
ControllerStartInterval metav1.Duration ControllerStartInterval metav1.Duration
// leaderElection defines the configuration of leader election client. // leaderElection defines the configuration of leader election client.
LeaderElection apiserverconfig.LeaderElectionConfiguration 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 { type KubeCloudSharedConfiguration struct {
// port is the port that the controller-manager's http service runs on. // CloudProviderConfiguration holds configuration for CloudProvider related features.
Port int32 CloudProvider CloudProviderConfiguration
// address is the IP address to serve on (set to 0.0.0.0 for all interfaces). // externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
Address string // 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 { ...@@ -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 { ...@@ -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 { ...@@ -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.
......
...@@ -20,6 +20,7 @@ go_library( ...@@ -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",
......
...@@ -19,6 +19,7 @@ package v1alpha1 ...@@ -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 { ...@@ -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 ...@@ -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 ...@@ -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.MinResyncPeriod == zero { if obj.ServiceController.ConcurrentServiceSyncs == 0 {
obj.MinResyncPeriod = metav1.Duration{Duration: 12 * time.Hour} obj.ServiceController.ConcurrentServiceSyncs = 1
} }
if obj.ContentType == "" { if obj.NodeStatusUpdateFrequency == zero {
obj.ContentType = "application/vnd.kubernetes.protobuf" obj.NodeStatusUpdateFrequency = metav1.Duration{Duration: 5 * time.Minute}
} }
if obj.KubeAPIQPS == 0 { // These defaults override the recommended defaults from the apimachineryconfigv1alpha1 package that are applied automatically
obj.KubeAPIQPS = 20.0 // These client-connection defaults are specific to the cloud-controller-manager
if obj.Generic.ClientConnection.QPS == 0 {
obj.Generic.ClientConnection.QPS = 20
} }
if obj.KubeAPIBurst == 0 { if obj.Generic.ClientConnection.Burst == 0 {
obj.KubeAPIBurst = 30 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 {
obj.MinResyncPeriod = metav1.Duration{Duration: 12 * time.Hour}
} }
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) ...@@ -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) {
......
...@@ -17,6 +17,7 @@ limitations under the License. ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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. // port is the port that the controller-manager's http service runs on.
Name string Port int32
// cloudConfigFile is the path to the cloud provider configuration file. // address is the IP address to serve on (set to 0.0.0.0 for all interfaces).
CloudConfigFile string Address string
}
type GenericComponentConfiguration struct {
// minResyncPeriod is the resync period in reflectors; will be random between // minResyncPeriod is the resync period in reflectors; will be random between
// minResyncPeriod and 2*minResyncPeriod. // minResyncPeriod and 2*minResyncPeriod.
MinResyncPeriod metav1.Duration MinResyncPeriod metav1.Duration
// contentType is contentType of requests sent to apiserver. // ClientConnection specifies the kubeconfig file and client connection
ContentType string // settings for the proxy server to use when communicating with the apiserver.
// kubeAPIQPS is the QPS to use while talking with kubernetes apiserver. ClientConnection apimachineryconfigv1alpha1.ClientConnectionConfiguration
KubeAPIQPS float32
// kubeAPIBurst is the burst to use while talking with kubernetes apiserver.
KubeAPIBurst int32
// How long to wait between starting controller managers // How long to wait between starting controller managers
ControllerStartInterval metav1.Duration ControllerStartInterval metav1.Duration
// leaderElection defines the configuration of leader election client. // leaderElection defines the configuration of leader election client.
LeaderElection apiserverconfigv1alpha1.LeaderElectionConfiguration 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 { type KubeCloudSharedConfiguration struct {
// port is the port that the controller-manager's http service runs on. // CloudProviderConfiguration holds configuration for CloudProvider related features.
Port int32 CloudProvider CloudProviderConfiguration
// address is the IP address to serve on (set to 0.0.0.0 for all interfaces). // externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
Address string // 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 { ...@@ -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 { ...@@ -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 { ...@@ -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.
......
...@@ -62,9 +62,7 @@ func (in *CSRSigningControllerConfiguration) DeepCopy() *CSRSigningControllerCon ...@@ -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 ...@@ -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 ...@@ -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 { ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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
} }
......
...@@ -39,13 +39,13 @@ func RegisterDefaults(scheme *runtime.Scheme) error { ...@@ -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)
......
...@@ -62,9 +62,7 @@ func (in *CSRSigningControllerConfiguration) DeepCopy() *CSRSigningControllerCon ...@@ -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 ...@@ -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 ...@@ -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 { ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment