Merge pull request #72800 from stewart-yu/stewart-component-base

Move config local to every controller in KCM
This commit is contained in:
Kubernetes Prow Robot
2019-03-21 19:26:19 -07:00
committed by GitHub
288 changed files with 8730 additions and 1757 deletions

View File

@@ -73,6 +73,7 @@ go_library(
"//pkg/controller/volume/attachdetach:go_default_library",
"//pkg/controller/volume/expand:go_default_library",
"//pkg/controller/volume/persistentvolume:go_default_library",
"//pkg/controller/volume/persistentvolume/config:go_default_library",
"//pkg/controller/volume/pvcprotection:go_default_library",
"//pkg/controller/volume/pvprotection:go_default_library",
"//pkg/features:go_default_library",

View File

@@ -36,7 +36,25 @@ go_library(
"//cmd/kube-controller-manager/app/config:go_default_library",
"//pkg/controller/apis/config:go_default_library",
"//pkg/controller/apis/config/scheme:go_default_library",
"//pkg/controller/certificates/signer/config:go_default_library",
"//pkg/controller/daemon/config:go_default_library",
"//pkg/controller/deployment/config:go_default_library",
"//pkg/controller/endpoint/config:go_default_library",
"//pkg/controller/garbagecollector:go_default_library",
"//pkg/controller/garbagecollector/config:go_default_library",
"//pkg/controller/job/config:go_default_library",
"//pkg/controller/namespace/config:go_default_library",
"//pkg/controller/nodeipam/config:go_default_library",
"//pkg/controller/nodelifecycle/config:go_default_library",
"//pkg/controller/podautoscaler/config:go_default_library",
"//pkg/controller/podgc/config:go_default_library",
"//pkg/controller/replicaset/config:go_default_library",
"//pkg/controller/replication/config:go_default_library",
"//pkg/controller/resourcequota/config:go_default_library",
"//pkg/controller/serviceaccount/config:go_default_library",
"//pkg/controller/ttlafterfinished/config:go_default_library",
"//pkg/controller/volume/attachdetach/config:go_default_library",
"//pkg/controller/volume/persistentvolume/config:go_default_library",
"//pkg/features:go_default_library",
"//pkg/master/ports:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
@@ -76,6 +94,25 @@ go_test(
deps = [
"//cmd/controller-manager/app/options:go_default_library",
"//pkg/controller/apis/config:go_default_library",
"//pkg/controller/certificates/signer/config:go_default_library",
"//pkg/controller/daemon/config:go_default_library",
"//pkg/controller/deployment/config:go_default_library",
"//pkg/controller/endpoint/config:go_default_library",
"//pkg/controller/garbagecollector/config:go_default_library",
"//pkg/controller/job/config:go_default_library",
"//pkg/controller/namespace/config:go_default_library",
"//pkg/controller/nodeipam/config:go_default_library",
"//pkg/controller/nodelifecycle/config:go_default_library",
"//pkg/controller/podautoscaler/config:go_default_library",
"//pkg/controller/podgc/config:go_default_library",
"//pkg/controller/replicaset/config:go_default_library",
"//pkg/controller/replication/config:go_default_library",
"//pkg/controller/resourcequota/config:go_default_library",
"//pkg/controller/service/config:go_default_library",
"//pkg/controller/serviceaccount/config:go_default_library",
"//pkg/controller/ttlafterfinished/config:go_default_library",
"//pkg/controller/volume/attachdetach/config:go_default_library",
"//pkg/controller/volume/persistentvolume/config: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/apiserver/pkg/server/options:go_default_library",

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
attachdetachconfig "k8s.io/kubernetes/pkg/controller/volume/attachdetach/config"
)
// AttachDetachControllerOptions holds the AttachDetachController options.
type AttachDetachControllerOptions struct {
*kubectrlmgrconfig.AttachDetachControllerConfiguration
*attachdetachconfig.AttachDetachControllerConfiguration
}
// AddFlags adds flags related to AttachDetachController for controller manager to the specified FlagSet.
@@ -38,7 +38,7 @@ func (o *AttachDetachControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up AttachDetachController config with options.
func (o *AttachDetachControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.AttachDetachControllerConfiguration) error {
func (o *AttachDetachControllerOptions) ApplyTo(cfg *attachdetachconfig.AttachDetachControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,7 +19,7 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
csrsigningconfig "k8s.io/kubernetes/pkg/controller/certificates/signer/config"
)
const (
@@ -34,7 +34,7 @@ const (
// CSRSigningControllerOptions holds the CSRSigningController options.
type CSRSigningControllerOptions struct {
*kubectrlmgrconfig.CSRSigningControllerConfiguration
*csrsigningconfig.CSRSigningControllerConfiguration
}
// AddFlags adds flags related to CSRSigningController for controller manager to the specified FlagSet.
@@ -49,7 +49,7 @@ func (o *CSRSigningControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up CSRSigningController config with options.
func (o *CSRSigningControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.CSRSigningControllerConfiguration) error {
func (o *CSRSigningControllerOptions) ApplyTo(cfg *csrsigningconfig.CSRSigningControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
daemonconfig "k8s.io/kubernetes/pkg/controller/daemon/config"
)
// DaemonSetControllerOptions holds the DaemonSetController options.
type DaemonSetControllerOptions struct {
*kubectrlmgrconfig.DaemonSetControllerConfiguration
*daemonconfig.DaemonSetControllerConfiguration
}
// AddFlags adds flags related to DaemonSetController for controller manager to the specified FlagSet.
@@ -35,7 +35,7 @@ func (o *DaemonSetControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up DaemonSetController config with options.
func (o *DaemonSetControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.DaemonSetControllerConfiguration) error {
func (o *DaemonSetControllerOptions) ApplyTo(cfg *daemonconfig.DaemonSetControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
deploymentconfig "k8s.io/kubernetes/pkg/controller/deployment/config"
)
// DeploymentControllerOptions holds the DeploymentController options.
type DeploymentControllerOptions struct {
*kubectrlmgrconfig.DeploymentControllerConfiguration
*deploymentconfig.DeploymentControllerConfiguration
}
// AddFlags adds flags related to DeploymentController for controller manager to the specified FlagSet.
@@ -38,7 +38,7 @@ func (o *DeploymentControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up DeploymentController config with options.
func (o *DeploymentControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.DeploymentControllerConfiguration) error {
func (o *DeploymentControllerOptions) ApplyTo(cfg *deploymentconfig.DeploymentControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
endpointconfig "k8s.io/kubernetes/pkg/controller/endpoint/config"
)
// EndpointControllerOptions holds the EndPointController options.
type EndpointControllerOptions struct {
*kubectrlmgrconfig.EndpointControllerConfiguration
*endpointconfig.EndpointControllerConfiguration
}
// AddFlags adds flags related to EndPointController for controller manager to the specified FlagSet.
@@ -37,7 +37,7 @@ func (o *EndpointControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up EndPointController config with options.
func (o *EndpointControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.EndpointControllerConfiguration) error {
func (o *EndpointControllerOptions) ApplyTo(cfg *endpointconfig.EndpointControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
garbagecollectorconfig "k8s.io/kubernetes/pkg/controller/garbagecollector/config"
)
// GarbageCollectorControllerOptions holds the GarbageCollectorController options.
type GarbageCollectorControllerOptions struct {
*kubectrlmgrconfig.GarbageCollectorControllerConfiguration
*garbagecollectorconfig.GarbageCollectorControllerConfiguration
}
// AddFlags adds flags related to GarbageCollectorController for controller manager to the specified FlagSet.
@@ -38,7 +38,7 @@ func (o *GarbageCollectorControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up GarbageCollectorController config with options.
func (o *GarbageCollectorControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.GarbageCollectorControllerConfiguration) error {
func (o *GarbageCollectorControllerOptions) ApplyTo(cfg *garbagecollectorconfig.GarbageCollectorControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
poautosclerconfig "k8s.io/kubernetes/pkg/controller/podautoscaler/config"
)
// HPAControllerOptions holds the HPAController options.
type HPAControllerOptions struct {
*kubectrlmgrconfig.HPAControllerConfiguration
*poautosclerconfig.HPAControllerConfiguration
}
// AddFlags adds flags related to HPAController for controller manager to the specified FlagSet.
@@ -47,7 +47,7 @@ func (o *HPAControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up HPAController config with options.
func (o *HPAControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.HPAControllerConfiguration) error {
func (o *HPAControllerOptions) ApplyTo(cfg *poautosclerconfig.HPAControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
jobconfig "k8s.io/kubernetes/pkg/controller/job/config"
)
// JobControllerOptions holds the JobController options.
type JobControllerOptions struct {
*kubectrlmgrconfig.JobControllerConfiguration
*jobconfig.JobControllerConfiguration
}
// AddFlags adds flags related to JobController for controller manager to the specified FlagSet.
@@ -35,7 +35,7 @@ func (o *JobControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up JobController config with options.
func (o *JobControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.JobControllerConfiguration) error {
func (o *JobControllerOptions) ApplyTo(cfg *jobconfig.JobControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
namespaceconfig "k8s.io/kubernetes/pkg/controller/namespace/config"
)
// NamespaceControllerOptions holds the NamespaceController options.
type NamespaceControllerOptions struct {
*kubectrlmgrconfig.NamespaceControllerConfiguration
*namespaceconfig.NamespaceControllerConfiguration
}
// AddFlags adds flags related to NamespaceController for controller manager to the specified FlagSet.
@@ -38,7 +38,7 @@ func (o *NamespaceControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up NamespaceController config with options.
func (o *NamespaceControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.NamespaceControllerConfiguration) error {
func (o *NamespaceControllerOptions) ApplyTo(cfg *namespaceconfig.NamespaceControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
nodeipamconfig "k8s.io/kubernetes/pkg/controller/nodeipam/config"
)
// NodeIPAMControllerOptions holds the NodeIpamController options.
type NodeIPAMControllerOptions struct {
*kubectrlmgrconfig.NodeIPAMControllerConfiguration
*nodeipamconfig.NodeIPAMControllerConfiguration
}
// AddFlags adds flags related to NodeIpamController for controller manager to the specified FlagSet.
@@ -38,7 +38,7 @@ func (o *NodeIPAMControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up NodeIpamController config with options.
func (o *NodeIPAMControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.NodeIPAMControllerConfiguration) error {
func (o *NodeIPAMControllerOptions) ApplyTo(cfg *nodeipamconfig.NodeIPAMControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
nodelifecycleconfig "k8s.io/kubernetes/pkg/controller/nodelifecycle/config"
)
// NodeLifecycleControllerOptions holds the NodeLifecycleController options.
type NodeLifecycleControllerOptions struct {
*kubectrlmgrconfig.NodeLifecycleControllerConfiguration
*nodelifecycleconfig.NodeLifecycleControllerConfiguration
}
// AddFlags adds flags related to NodeLifecycleController for controller manager to the specified FlagSet.
@@ -48,7 +48,7 @@ func (o *NodeLifecycleControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up NodeLifecycleController config with options.
func (o *NodeLifecycleControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.NodeLifecycleControllerConfiguration) error {
func (o *NodeLifecycleControllerOptions) ApplyTo(cfg *nodelifecycleconfig.NodeLifecycleControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -39,6 +39,7 @@ import (
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
kubectrlmgrconfigscheme "k8s.io/kubernetes/pkg/controller/apis/config/scheme"
"k8s.io/kubernetes/pkg/controller/garbagecollector"
garbagecollectorconfig "k8s.io/kubernetes/pkg/controller/garbagecollector/config"
"k8s.io/kubernetes/pkg/master/ports"
// add the kubernetes feature gates
@@ -177,9 +178,9 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
s.SecureServing.ServerCert.PairName = "kube-controller-manager"
s.SecureServing.BindPort = ports.KubeControllerManagerPort
gcIgnoredResources := make([]kubectrlmgrconfig.GroupResource, 0, len(garbagecollector.DefaultIgnoredResources()))
gcIgnoredResources := make([]garbagecollectorconfig.GroupResource, 0, len(garbagecollector.DefaultIgnoredResources()))
for r := range garbagecollector.DefaultIgnoredResources() {
gcIgnoredResources = append(gcIgnoredResources, kubectrlmgrconfig.GroupResource{Group: r.Group, Resource: r.Resource})
gcIgnoredResources = append(gcIgnoredResources, garbagecollectorconfig.GroupResource{Group: r.Group, Resource: r.Resource})
}
s.GarbageCollectorController.GCIgnoredResources = gcIgnoredResources

View File

@@ -31,6 +31,25 @@ import (
componentbaseconfig "k8s.io/component-base/config"
cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
csrsigningconfig "k8s.io/kubernetes/pkg/controller/certificates/signer/config"
daemonconfig "k8s.io/kubernetes/pkg/controller/daemon/config"
deploymentconfig "k8s.io/kubernetes/pkg/controller/deployment/config"
endpointconfig "k8s.io/kubernetes/pkg/controller/endpoint/config"
garbagecollectorconfig "k8s.io/kubernetes/pkg/controller/garbagecollector/config"
jobconfig "k8s.io/kubernetes/pkg/controller/job/config"
namespaceconfig "k8s.io/kubernetes/pkg/controller/namespace/config"
nodeipamconfig "k8s.io/kubernetes/pkg/controller/nodeipam/config"
nodelifecycleconfig "k8s.io/kubernetes/pkg/controller/nodelifecycle/config"
poautosclerconfig "k8s.io/kubernetes/pkg/controller/podautoscaler/config"
podgcconfig "k8s.io/kubernetes/pkg/controller/podgc/config"
replicasetconfig "k8s.io/kubernetes/pkg/controller/replicaset/config"
replicationconfig "k8s.io/kubernetes/pkg/controller/replication/config"
resourcequotaconfig "k8s.io/kubernetes/pkg/controller/resourcequota/config"
serviceconfig "k8s.io/kubernetes/pkg/controller/service/config"
serviceaccountconfig "k8s.io/kubernetes/pkg/controller/serviceaccount/config"
ttlafterfinishedconfig "k8s.io/kubernetes/pkg/controller/ttlafterfinished/config"
attachdetachconfig "k8s.io/kubernetes/pkg/controller/volume/attachdetach/config"
persistentvolumeconfig "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/config"
)
func TestAddFlags(t *testing.T) {
@@ -169,30 +188,30 @@ func TestAddFlags(t *testing.T) {
},
},
ServiceController: &cmoptions.ServiceControllerOptions{
ServiceControllerConfiguration: &kubectrlmgrconfig.ServiceControllerConfiguration{
ServiceControllerConfiguration: &serviceconfig.ServiceControllerConfiguration{
ConcurrentServiceSyncs: 2,
},
},
AttachDetachController: &AttachDetachControllerOptions{
&kubectrlmgrconfig.AttachDetachControllerConfiguration{
&attachdetachconfig.AttachDetachControllerConfiguration{
ReconcilerSyncLoopPeriod: metav1.Duration{Duration: 30 * time.Second},
DisableAttachDetachReconcilerSync: true,
},
},
CSRSigningController: &CSRSigningControllerOptions{
&kubectrlmgrconfig.CSRSigningControllerConfiguration{
&csrsigningconfig.CSRSigningControllerConfiguration{
ClusterSigningCertFile: "/cluster-signing-cert",
ClusterSigningKeyFile: "/cluster-signing-key",
ClusterSigningDuration: metav1.Duration{Duration: 10 * time.Hour},
},
},
DaemonSetController: &DaemonSetControllerOptions{
&kubectrlmgrconfig.DaemonSetControllerConfiguration{
&daemonconfig.DaemonSetControllerConfiguration{
ConcurrentDaemonSetSyncs: 2,
},
},
DeploymentController: &DeploymentControllerOptions{
&kubectrlmgrconfig.DeploymentControllerConfiguration{
&deploymentconfig.DeploymentControllerConfiguration{
ConcurrentDeploymentSyncs: 10,
DeploymentControllerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
},
@@ -204,21 +223,21 @@ func TestAddFlags(t *testing.T) {
},
},
EndpointController: &EndpointControllerOptions{
&kubectrlmgrconfig.EndpointControllerConfiguration{
&endpointconfig.EndpointControllerConfiguration{
ConcurrentEndpointSyncs: 10,
},
},
GarbageCollectorController: &GarbageCollectorControllerOptions{
&kubectrlmgrconfig.GarbageCollectorControllerConfiguration{
&garbagecollectorconfig.GarbageCollectorControllerConfiguration{
ConcurrentGCSyncs: 30,
GCIgnoredResources: []kubectrlmgrconfig.GroupResource{
GCIgnoredResources: []garbagecollectorconfig.GroupResource{
{Group: "", Resource: "events"},
},
EnableGarbageCollector: false,
},
},
HPAController: &HPAControllerOptions{
&kubectrlmgrconfig.HPAControllerConfiguration{
&poautosclerconfig.HPAControllerConfiguration{
HorizontalPodAutoscalerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
HorizontalPodAutoscalerUpscaleForbiddenWindow: metav1.Duration{Duration: 1 * time.Minute},
HorizontalPodAutoscalerDownscaleForbiddenWindow: metav1.Duration{Duration: 2 * time.Minute},
@@ -230,23 +249,23 @@ func TestAddFlags(t *testing.T) {
},
},
JobController: &JobControllerOptions{
&kubectrlmgrconfig.JobControllerConfiguration{
&jobconfig.JobControllerConfiguration{
ConcurrentJobSyncs: 5,
},
},
NamespaceController: &NamespaceControllerOptions{
&kubectrlmgrconfig.NamespaceControllerConfiguration{
&namespaceconfig.NamespaceControllerConfiguration{
NamespaceSyncPeriod: metav1.Duration{Duration: 10 * time.Minute},
ConcurrentNamespaceSyncs: 20,
},
},
NodeIPAMController: &NodeIPAMControllerOptions{
&kubectrlmgrconfig.NodeIPAMControllerConfiguration{
&nodeipamconfig.NodeIPAMControllerConfiguration{
NodeCIDRMaskSize: 48,
},
},
NodeLifecycleController: &NodeLifecycleControllerOptions{
&kubectrlmgrconfig.NodeLifecycleControllerConfiguration{
&nodelifecycleconfig.NodeLifecycleControllerConfiguration{
EnableTaintManager: false,
NodeEvictionRate: 0.2,
SecondaryNodeEvictionRate: 0.05,
@@ -258,13 +277,13 @@ func TestAddFlags(t *testing.T) {
},
},
PersistentVolumeBinderController: &PersistentVolumeBinderControllerOptions{
&kubectrlmgrconfig.PersistentVolumeBinderControllerConfiguration{
&persistentvolumeconfig.PersistentVolumeBinderControllerConfiguration{
PVClaimBinderSyncPeriod: metav1.Duration{Duration: 30 * time.Second},
VolumeConfiguration: kubectrlmgrconfig.VolumeConfiguration{
VolumeConfiguration: persistentvolumeconfig.VolumeConfiguration{
EnableDynamicProvisioning: false,
EnableHostPathProvisioning: true,
FlexVolumePluginDir: "/flex-volume-plugin",
PersistentVolumeRecyclerConfiguration: kubectrlmgrconfig.PersistentVolumeRecyclerConfiguration{
PersistentVolumeRecyclerConfiguration: persistentvolumeconfig.PersistentVolumeRecyclerConfiguration{
MaximumRetry: 3,
MinimumTimeoutNFS: 200,
IncrementTimeoutNFS: 45,
@@ -275,34 +294,34 @@ func TestAddFlags(t *testing.T) {
},
},
PodGCController: &PodGCControllerOptions{
&kubectrlmgrconfig.PodGCControllerConfiguration{
&podgcconfig.PodGCControllerConfiguration{
TerminatedPodGCThreshold: 12000,
},
},
ReplicaSetController: &ReplicaSetControllerOptions{
&kubectrlmgrconfig.ReplicaSetControllerConfiguration{
&replicasetconfig.ReplicaSetControllerConfiguration{
ConcurrentRSSyncs: 10,
},
},
ReplicationController: &ReplicationControllerOptions{
&kubectrlmgrconfig.ReplicationControllerConfiguration{
&replicationconfig.ReplicationControllerConfiguration{
ConcurrentRCSyncs: 10,
},
},
ResourceQuotaController: &ResourceQuotaControllerOptions{
&kubectrlmgrconfig.ResourceQuotaControllerConfiguration{
&resourcequotaconfig.ResourceQuotaControllerConfiguration{
ResourceQuotaSyncPeriod: metav1.Duration{Duration: 10 * time.Minute},
ConcurrentResourceQuotaSyncs: 10,
},
},
SAController: &SAControllerOptions{
&kubectrlmgrconfig.SAControllerConfiguration{
&serviceaccountconfig.SAControllerConfiguration{
ServiceAccountKeyFile: "/service-account-private-key",
ConcurrentSATokenSyncs: 10,
},
},
TTLAfterFinishedController: &TTLAfterFinishedControllerOptions{
&kubectrlmgrconfig.TTLAfterFinishedControllerConfiguration{
&ttlafterfinishedconfig.TTLAfterFinishedControllerConfiguration{
ConcurrentTTLSyncs: 8,
},
},
@@ -349,7 +368,7 @@ func TestAddFlags(t *testing.T) {
}
}
type sortedGCIgnoredResources []kubectrlmgrconfig.GroupResource
type sortedGCIgnoredResources []garbagecollectorconfig.GroupResource
func (r sortedGCIgnoredResources) Len() int {
return len(r)

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
persistentvolumeconfig "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/config"
)
// PersistentVolumeBinderControllerOptions holds the PersistentVolumeBinderController options.
type PersistentVolumeBinderControllerOptions struct {
*kubectrlmgrconfig.PersistentVolumeBinderControllerConfiguration
*persistentvolumeconfig.PersistentVolumeBinderControllerConfiguration
}
// AddFlags adds flags related to PersistentVolumeBinderController for controller manager to the specified FlagSet.
@@ -46,7 +46,7 @@ func (o *PersistentVolumeBinderControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up PersistentVolumeBinderController config with options.
func (o *PersistentVolumeBinderControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.PersistentVolumeBinderControllerConfiguration) error {
func (o *PersistentVolumeBinderControllerOptions) ApplyTo(cfg *persistentvolumeconfig.PersistentVolumeBinderControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
podgcconfig "k8s.io/kubernetes/pkg/controller/podgc/config"
)
// PodGCControllerOptions holds the PodGCController options.
type PodGCControllerOptions struct {
*kubectrlmgrconfig.PodGCControllerConfiguration
*podgcconfig.PodGCControllerConfiguration
}
// AddFlags adds flags related to PodGCController for controller manager to the specified FlagSet.
@@ -37,7 +37,7 @@ func (o *PodGCControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up PodGCController config with options.
func (o *PodGCControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.PodGCControllerConfiguration) error {
func (o *PodGCControllerOptions) ApplyTo(cfg *podgcconfig.PodGCControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
replicasetconfig "k8s.io/kubernetes/pkg/controller/replicaset/config"
)
// ReplicaSetControllerOptions holds the ReplicaSetController options.
type ReplicaSetControllerOptions struct {
*kubectrlmgrconfig.ReplicaSetControllerConfiguration
*replicasetconfig.ReplicaSetControllerConfiguration
}
// AddFlags adds flags related to ReplicaSetController for controller manager to the specified FlagSet.
@@ -37,7 +37,7 @@ func (o *ReplicaSetControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up ReplicaSetController config with options.
func (o *ReplicaSetControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.ReplicaSetControllerConfiguration) error {
func (o *ReplicaSetControllerOptions) ApplyTo(cfg *replicasetconfig.ReplicaSetControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
replicationconfig "k8s.io/kubernetes/pkg/controller/replication/config"
)
// ReplicationControllerOptions holds the ReplicationController options.
type ReplicationControllerOptions struct {
*kubectrlmgrconfig.ReplicationControllerConfiguration
*replicationconfig.ReplicationControllerConfiguration
}
// AddFlags adds flags related to ReplicationController for controller manager to the specified FlagSet.
@@ -37,7 +37,7 @@ func (o *ReplicationControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up ReplicationController config with options.
func (o *ReplicationControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.ReplicationControllerConfiguration) error {
func (o *ReplicationControllerOptions) ApplyTo(cfg *replicationconfig.ReplicationControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
resourcequotaconfig "k8s.io/kubernetes/pkg/controller/resourcequota/config"
)
// ResourceQuotaControllerOptions holds the ResourceQuotaController options.
type ResourceQuotaControllerOptions struct {
*kubectrlmgrconfig.ResourceQuotaControllerConfiguration
*resourcequotaconfig.ResourceQuotaControllerConfiguration
}
// AddFlags adds flags related to ResourceQuotaController for controller manager to the specified FlagSet.
@@ -38,7 +38,7 @@ func (o *ResourceQuotaControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up ResourceQuotaController config with options.
func (o *ResourceQuotaControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.ResourceQuotaControllerConfiguration) error {
func (o *ResourceQuotaControllerOptions) ApplyTo(cfg *resourcequotaconfig.ResourceQuotaControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
serviceaccountconfig "k8s.io/kubernetes/pkg/controller/serviceaccount/config"
)
// SAControllerOptions holds the ServiceAccountController options.
type SAControllerOptions struct {
*kubectrlmgrconfig.SAControllerConfiguration
*serviceaccountconfig.SAControllerConfiguration
}
// AddFlags adds flags related to ServiceAccountController for controller manager to the specified FlagSet
@@ -39,7 +39,7 @@ func (o *SAControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up ServiceAccountController config with options.
func (o *SAControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.SAControllerConfiguration) error {
func (o *SAControllerOptions) ApplyTo(cfg *serviceaccountconfig.SAControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -19,12 +19,12 @@ package options
import (
"github.com/spf13/pflag"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
ttlafterfinishedconfig "k8s.io/kubernetes/pkg/controller/ttlafterfinished/config"
)
// TTLAfterFinishedControllerOptions holds the TTLAfterFinishedController options.
type TTLAfterFinishedControllerOptions struct {
*kubectrlmgrconfig.TTLAfterFinishedControllerConfiguration
*ttlafterfinishedconfig.TTLAfterFinishedControllerConfiguration
}
// AddFlags adds flags related to TTLAfterFinishedController for controller manager to the specified FlagSet.
@@ -37,7 +37,7 @@ func (o *TTLAfterFinishedControllerOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up TTLAfterFinishedController config with options.
func (o *TTLAfterFinishedControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.TTLAfterFinishedControllerConfiguration) error {
func (o *TTLAfterFinishedControllerOptions) ApplyTo(cfg *ttlafterfinishedconfig.TTLAfterFinishedControllerConfiguration) error {
if o == nil {
return nil
}

View File

@@ -54,7 +54,7 @@ import (
"k8s.io/kubernetes/pkg/volume/vsphere_volume"
utilfeature "k8s.io/apiserver/pkg/util/feature"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
persistentvolumeconfig "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/config"
"k8s.io/kubernetes/pkg/features"
"k8s.io/utils/exec"
)
@@ -87,12 +87,12 @@ func ProbeAttachableVolumePlugins() []volume.VolumePlugin {
// GetDynamicPluginProber gets the probers of dynamically discoverable plugins
// for the attach/detach controller.
// Currently only Flexvolume plugins are dynamically discoverable.
func GetDynamicPluginProber(config kubectrlmgrconfig.VolumeConfiguration) volume.DynamicPluginProber {
func GetDynamicPluginProber(config persistentvolumeconfig.VolumeConfiguration) volume.DynamicPluginProber {
return flexvolume.GetDynamicPluginProber(config.FlexVolumePluginDir, exec.New() /*exec.Interface*/)
}
// ProbeExpandableVolumePlugins returns volume plugins which are expandable
func ProbeExpandableVolumePlugins(config kubectrlmgrconfig.VolumeConfiguration) []volume.VolumePlugin {
func ProbeExpandableVolumePlugins(config persistentvolumeconfig.VolumeConfiguration) []volume.VolumePlugin {
allPlugins := []volume.VolumePlugin{}
allPlugins = append(allPlugins, awsebs.ProbeVolumePlugins()...)
@@ -114,7 +114,7 @@ func ProbeExpandableVolumePlugins(config kubectrlmgrconfig.VolumeConfiguration)
// ProbeControllerVolumePlugins collects all persistent volume plugins into an
// easy to use list. Only volume plugins that implement any of
// provisioner/recycler/deleter interface should be returned.
func ProbeControllerVolumePlugins(cloud cloudprovider.Interface, config kubectrlmgrconfig.VolumeConfiguration) []volume.VolumePlugin {
func ProbeControllerVolumePlugins(cloud cloudprovider.Interface, config persistentvolumeconfig.VolumeConfiguration) []volume.VolumePlugin {
allPlugins := []volume.VolumePlugin{}
// The list of plugins to probe is decided by this binary, not