Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3518fb40
Commit
3518fb40
authored
Jan 13, 2019
by
stewart-yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix all reference for wrap componentconfig type
parent
5b43a243
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
98 deletions
+102
-98
options.go
cmd/cloud-controller-manager/app/options/options.go
+3
-3
options_test.go
cmd/cloud-controller-manager/app/options/options_test.go
+75
-54
options.go
cmd/kube-controller-manager/app/options/options.go
+24
-41
options_test.go
cmd/kube-controller-manager/app/options/options_test.go
+0
-0
No files found.
cmd/cloud-controller-manager/app/options/options.go
View file @
3518fb40
...
...
@@ -82,10 +82,10 @@ func NewCloudControllerManagerOptions() (*CloudControllerManagerOptions, error)
}
s
:=
CloudControllerManagerOptions
{
Generic
:
cmoptions
.
NewGenericControllerManagerConfigurationOptions
(
componentConfig
.
Generic
),
KubeCloudShared
:
cmoptions
.
NewKubeCloudSharedOptions
(
componentConfig
.
KubeCloudShared
),
Generic
:
cmoptions
.
NewGenericControllerManagerConfigurationOptions
(
&
componentConfig
.
Generic
),
KubeCloudShared
:
cmoptions
.
NewKubeCloudSharedOptions
(
&
componentConfig
.
KubeCloudShared
),
ServiceController
:
&
cmoptions
.
ServiceControllerOptions
{
ConcurrentServiceSyncs
:
componentConfig
.
ServiceController
.
ConcurrentServiceSyncs
,
ServiceControllerConfiguration
:
&
componentConfig
.
ServiceController
,
},
SecureServing
:
apiserveroptions
.
NewSecureServingOptions
()
.
WithLoopback
(),
InsecureServing
:
(
&
apiserveroptions
.
DeprecatedInsecureServingOptions
{
...
...
cmd/cloud-controller-manager/app/options/options_test.go
View file @
3518fb40
...
...
@@ -29,6 +29,7 @@ import (
apiserveroptions
"k8s.io/apiserver/pkg/server/options"
componentbaseconfig
"k8s.io/component-base/config"
cmoptions
"k8s.io/kubernetes/cmd/controller-manager/app/options"
kubectrlmgrconfig
"k8s.io/kubernetes/pkg/controller/apis/config"
)
func
TestDefaultFlags
(
t
*
testing
.
T
)
{
...
...
@@ -36,42 +37,52 @@ func TestDefaultFlags(t *testing.T) {
expected
:=
&
CloudControllerManagerOptions
{
Generic
:
&
cmoptions
.
GenericControllerManagerConfigurationOptions
{
Port
:
DefaultInsecureCloudControllerManagerPort
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address
:
"0.0.0.0"
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod
:
metav1
.
Duration
{
Duration
:
12
*
time
.
Hour
},
ClientConnection
:
componentbaseconfig
.
ClientConnectionConfiguration
{
ContentType
:
"application/vnd.kubernetes.protobuf"
,
QPS
:
20.0
,
Burst
:
30
,
},
ControllerStartInterval
:
metav1
.
Duration
{
Duration
:
0
},
LeaderElection
:
componentbaseconfig
.
LeaderElectionConfiguration
{
ResourceLock
:
"endpoints"
,
LeaderElect
:
true
,
LeaseDuration
:
metav1
.
Duration
{
Duration
:
15
*
time
.
Second
},
RenewDeadline
:
metav1
.
Duration
{
Duration
:
10
*
time
.
Second
},
RetryPeriod
:
metav1
.
Duration
{
Duration
:
2
*
time
.
Second
},
GenericControllerManagerConfiguration
:
&
kubectrlmgrconfig
.
GenericControllerManagerConfiguration
{
Port
:
DefaultInsecureCloudControllerManagerPort
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address
:
"0.0.0.0"
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod
:
metav1
.
Duration
{
Duration
:
12
*
time
.
Hour
},
ClientConnection
:
componentbaseconfig
.
ClientConnectionConfiguration
{
ContentType
:
"application/vnd.kubernetes.protobuf"
,
QPS
:
20.0
,
Burst
:
30
,
},
ControllerStartInterval
:
metav1
.
Duration
{
Duration
:
0
},
LeaderElection
:
componentbaseconfig
.
LeaderElectionConfiguration
{
ResourceLock
:
"endpoints"
,
LeaderElect
:
true
,
LeaseDuration
:
metav1
.
Duration
{
Duration
:
15
*
time
.
Second
},
RenewDeadline
:
metav1
.
Duration
{
Duration
:
10
*
time
.
Second
},
RetryPeriod
:
metav1
.
Duration
{
Duration
:
2
*
time
.
Second
},
},
Controllers
:
[]
string
{
"*"
},
},
Debugging
:
&
cmoptions
.
DebuggingOptions
{
EnableContentionProfiling
:
false
,
DebuggingConfiguration
:
&
componentbaseconfig
.
DebuggingConfiguration
{
EnableContentionProfiling
:
false
,
},
},
Controllers
:
[]
string
{
"*"
},
},
KubeCloudShared
:
&
cmoptions
.
KubeCloudSharedOptions
{
RouteReconciliationPeriod
:
metav1
.
Duration
{
Duration
:
10
*
time
.
Second
},
NodeMonitorPeriod
:
metav1
.
Duration
{
Duration
:
5
*
time
.
Second
},
ClusterName
:
"kubernetes"
,
ClusterCIDR
:
""
,
AllocateNodeCIDRs
:
false
,
CIDRAllocatorType
:
""
,
ConfigureCloudRoutes
:
true
,
KubeCloudSharedConfiguration
:
&
kubectrlmgrconfig
.
KubeCloudSharedConfiguration
{
RouteReconciliationPeriod
:
metav1
.
Duration
{
Duration
:
10
*
time
.
Second
},
NodeMonitorPeriod
:
metav1
.
Duration
{
Duration
:
5
*
time
.
Second
},
ClusterName
:
"kubernetes"
,
ClusterCIDR
:
""
,
AllocateNodeCIDRs
:
false
,
CIDRAllocatorType
:
""
,
ConfigureCloudRoutes
:
true
,
},
CloudProvider
:
&
cmoptions
.
CloudProviderOptions
{
Name
:
""
,
CloudConfigFile
:
""
,
CloudProviderConfiguration
:
&
kubectrlmgrconfig
.
CloudProviderConfiguration
{
Name
:
""
,
CloudConfigFile
:
""
,
},
},
},
ServiceController
:
&
cmoptions
.
ServiceControllerOptions
{
ConcurrentServiceSyncs
:
1
,
ServiceControllerConfiguration
:
&
kubectrlmgrconfig
.
ServiceControllerConfiguration
{
ConcurrentServiceSyncs
:
1
,
},
},
SecureServing
:
(
&
apiserveroptions
.
SecureServingOptions
{
BindPort
:
10258
,
...
...
@@ -155,42 +166,52 @@ func TestAddFlags(t *testing.T) {
expected
:=
&
CloudControllerManagerOptions
{
Generic
:
&
cmoptions
.
GenericControllerManagerConfigurationOptions
{
Port
:
DefaultInsecureCloudControllerManagerPort
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address
:
"0.0.0.0"
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod
:
metav1
.
Duration
{
Duration
:
100
*
time
.
Minute
},
ClientConnection
:
componentbaseconfig
.
ClientConnectionConfiguration
{
ContentType
:
"application/vnd.kubernetes.protobuf"
,
QPS
:
50.0
,
Burst
:
100
,
},
ControllerStartInterval
:
metav1
.
Duration
{
Duration
:
2
*
time
.
Minute
},
LeaderElection
:
componentbaseconfig
.
LeaderElectionConfiguration
{
ResourceLock
:
"configmap"
,
LeaderElect
:
false
,
LeaseDuration
:
metav1
.
Duration
{
Duration
:
30
*
time
.
Second
},
RenewDeadline
:
metav1
.
Duration
{
Duration
:
15
*
time
.
Second
},
RetryPeriod
:
metav1
.
Duration
{
Duration
:
5
*
time
.
Second
},
GenericControllerManagerConfiguration
:
&
kubectrlmgrconfig
.
GenericControllerManagerConfiguration
{
Port
:
DefaultInsecureCloudControllerManagerPort
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address
:
"0.0.0.0"
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod
:
metav1
.
Duration
{
Duration
:
100
*
time
.
Minute
},
ClientConnection
:
componentbaseconfig
.
ClientConnectionConfiguration
{
ContentType
:
"application/vnd.kubernetes.protobuf"
,
QPS
:
50.0
,
Burst
:
100
,
},
ControllerStartInterval
:
metav1
.
Duration
{
Duration
:
2
*
time
.
Minute
},
LeaderElection
:
componentbaseconfig
.
LeaderElectionConfiguration
{
ResourceLock
:
"configmap"
,
LeaderElect
:
false
,
LeaseDuration
:
metav1
.
Duration
{
Duration
:
30
*
time
.
Second
},
RenewDeadline
:
metav1
.
Duration
{
Duration
:
15
*
time
.
Second
},
RetryPeriod
:
metav1
.
Duration
{
Duration
:
5
*
time
.
Second
},
},
Controllers
:
[]
string
{
"foo"
,
"bar"
},
},
Debugging
:
&
cmoptions
.
DebuggingOptions
{
EnableContentionProfiling
:
true
,
DebuggingConfiguration
:
&
componentbaseconfig
.
DebuggingConfiguration
{
EnableContentionProfiling
:
true
,
},
},
Controllers
:
[]
string
{
"foo"
,
"bar"
},
},
KubeCloudShared
:
&
cmoptions
.
KubeCloudSharedOptions
{
KubeCloudSharedConfiguration
:
&
kubectrlmgrconfig
.
KubeCloudSharedConfiguration
{
RouteReconciliationPeriod
:
metav1
.
Duration
{
Duration
:
30
*
time
.
Second
},
NodeMonitorPeriod
:
metav1
.
Duration
{
Duration
:
5
*
time
.
Second
},
ClusterName
:
"k8s"
,
ClusterCIDR
:
"1.2.3.4/24"
,
AllocateNodeCIDRs
:
true
,
CIDRAllocatorType
:
"RangeAllocator"
,
ConfigureCloudRoutes
:
false
,
},
CloudProvider
:
&
cmoptions
.
CloudProviderOptions
{
Name
:
"gce"
,
CloudConfigFile
:
"/cloud-config"
,
CloudProviderConfiguration
:
&
kubectrlmgrconfig
.
CloudProviderConfiguration
{
Name
:
"gce"
,
CloudConfigFile
:
"/cloud-config"
,
},
},
RouteReconciliationPeriod
:
metav1
.
Duration
{
Duration
:
30
*
time
.
Second
},
NodeMonitorPeriod
:
metav1
.
Duration
{
Duration
:
5
*
time
.
Second
},
ClusterName
:
"k8s"
,
ClusterCIDR
:
"1.2.3.4/24"
,
AllocateNodeCIDRs
:
true
,
CIDRAllocatorType
:
"RangeAllocator"
,
ConfigureCloudRoutes
:
false
,
},
ServiceController
:
&
cmoptions
.
ServiceControllerOptions
{
ConcurrentServiceSyncs
:
1
,
ServiceControllerConfiguration
:
&
kubectrlmgrconfig
.
ServiceControllerConfiguration
{
ConcurrentServiceSyncs
:
1
,
},
},
SecureServing
:
(
&
apiserveroptions
.
SecureServingOptions
{
BindPort
:
10001
,
...
...
cmd/kube-controller-manager/app/options/options.go
View file @
3518fb40
...
...
@@ -96,84 +96,67 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
}
s
:=
KubeControllerManagerOptions
{
Generic
:
cmoptions
.
NewGenericControllerManagerConfigurationOptions
(
componentConfig
.
Generic
),
KubeCloudShared
:
cmoptions
.
NewKubeCloudSharedOptions
(
componentConfig
.
KubeCloudShared
),
Generic
:
cmoptions
.
NewGenericControllerManagerConfigurationOptions
(
&
componentConfig
.
Generic
),
KubeCloudShared
:
cmoptions
.
NewKubeCloudSharedOptions
(
&
componentConfig
.
KubeCloudShared
),
ServiceController
:
&
cmoptions
.
ServiceControllerOptions
{
ServiceControllerConfiguration
:
&
componentConfig
.
ServiceController
,
},
AttachDetachController
:
&
AttachDetachControllerOptions
{
ReconcilerSyncLoopPeriod
:
componentConfig
.
AttachDetachController
.
ReconcilerSyncLoopPeriod
,
&
componentConfig
.
AttachDetachController
,
},
CSRSigningController
:
&
CSRSigningControllerOptions
{
ClusterSigningCertFile
:
componentConfig
.
CSRSigningController
.
ClusterSigningCertFile
,
ClusterSigningKeyFile
:
componentConfig
.
CSRSigningController
.
ClusterSigningKeyFile
,
ClusterSigningDuration
:
componentConfig
.
CSRSigningController
.
ClusterSigningDuration
,
&
componentConfig
.
CSRSigningController
,
},
DaemonSetController
:
&
DaemonSetControllerOptions
{
ConcurrentDaemonSetSyncs
:
componentConfig
.
DaemonSetController
.
ConcurrentDaemonSetSyncs
,
&
componentConfig
.
DaemonSetController
,
},
DeploymentController
:
&
DeploymentControllerOptions
{
ConcurrentDeploymentSyncs
:
componentConfig
.
DeploymentController
.
ConcurrentDeploymentSyncs
,
DeploymentControllerSyncPeriod
:
componentConfig
.
DeploymentController
.
DeploymentControllerSyncPeriod
,
&
componentConfig
.
DeploymentController
,
},
DeprecatedFlags
:
&
DeprecatedControllerOptions
{
RegisterRetryCount
:
componentConfig
.
DeprecatedController
.
RegisterRetryCount
,
&
componentConfig
.
DeprecatedController
,
},
EndpointController
:
&
EndpointControllerOptions
{
ConcurrentEndpointSyncs
:
componentConfig
.
EndpointController
.
ConcurrentEndpointSyncs
,
&
componentConfig
.
EndpointController
,
},
GarbageCollectorController
:
&
GarbageCollectorControllerOptions
{
ConcurrentGCSyncs
:
componentConfig
.
GarbageCollectorController
.
ConcurrentGCSyncs
,
EnableGarbageCollector
:
componentConfig
.
GarbageCollectorController
.
EnableGarbageCollector
,
&
componentConfig
.
GarbageCollectorController
,
},
HPAController
:
&
HPAControllerOptions
{
HorizontalPodAutoscalerSyncPeriod
:
componentConfig
.
HPAController
.
HorizontalPodAutoscalerSyncPeriod
,
HorizontalPodAutoscalerUpscaleForbiddenWindow
:
componentConfig
.
HPAController
.
HorizontalPodAutoscalerUpscaleForbiddenWindow
,
HorizontalPodAutoscalerDownscaleForbiddenWindow
:
componentConfig
.
HPAController
.
HorizontalPodAutoscalerDownscaleForbiddenWindow
,
HorizontalPodAutoscalerDownscaleStabilizationWindow
:
componentConfig
.
HPAController
.
HorizontalPodAutoscalerDownscaleStabilizationWindow
,
HorizontalPodAutoscalerCPUInitializationPeriod
:
componentConfig
.
HPAController
.
HorizontalPodAutoscalerCPUInitializationPeriod
,
HorizontalPodAutoscalerInitialReadinessDelay
:
componentConfig
.
HPAController
.
HorizontalPodAutoscalerInitialReadinessDelay
,
HorizontalPodAutoscalerTolerance
:
componentConfig
.
HPAController
.
HorizontalPodAutoscalerTolerance
,
HorizontalPodAutoscalerUseRESTClients
:
componentConfig
.
HPAController
.
HorizontalPodAutoscalerUseRESTClients
,
&
componentConfig
.
HPAController
,
},
JobController
:
&
JobControllerOptions
{
ConcurrentJobSyncs
:
componentConfig
.
JobController
.
ConcurrentJobSyncs
,
&
componentConfig
.
JobController
,
},
NamespaceController
:
&
NamespaceControllerOptions
{
NamespaceSyncPeriod
:
componentConfig
.
NamespaceController
.
NamespaceSyncPeriod
,
ConcurrentNamespaceSyncs
:
componentConfig
.
NamespaceController
.
ConcurrentNamespaceSyncs
,
&
componentConfig
.
NamespaceController
,
},
NodeIPAMController
:
&
NodeIPAMControllerOptions
{
NodeCIDRMaskSize
:
componentConfig
.
NodeIPAMController
.
NodeCIDRMaskSize
,
&
componentConfig
.
NodeIPAMController
,
},
NodeLifecycleController
:
&
NodeLifecycleControllerOptions
{
EnableTaintManager
:
componentConfig
.
NodeLifecycleController
.
EnableTaintManager
,
NodeMonitorGracePeriod
:
componentConfig
.
NodeLifecycleController
.
NodeMonitorGracePeriod
,
NodeStartupGracePeriod
:
componentConfig
.
NodeLifecycleController
.
NodeStartupGracePeriod
,
PodEvictionTimeout
:
componentConfig
.
NodeLifecycleController
.
PodEvictionTimeout
,
&
componentConfig
.
NodeLifecycleController
,
},
PersistentVolumeBinderController
:
&
PersistentVolumeBinderControllerOptions
{
PVClaimBinderSyncPeriod
:
componentConfig
.
PersistentVolumeBinderController
.
PVClaimBinderSyncPeriod
,
VolumeConfiguration
:
componentConfig
.
PersistentVolumeBinderController
.
VolumeConfiguration
,
&
componentConfig
.
PersistentVolumeBinderController
,
},
PodGCController
:
&
PodGCControllerOptions
{
TerminatedPodGCThreshold
:
componentConfig
.
PodGCController
.
TerminatedPodGCThreshold
,
&
componentConfig
.
PodGCController
,
},
ReplicaSetController
:
&
ReplicaSetControllerOptions
{
ConcurrentRSSyncs
:
componentConfig
.
ReplicaSetController
.
ConcurrentRSSyncs
,
&
componentConfig
.
ReplicaSetController
,
},
ReplicationController
:
&
ReplicationControllerOptions
{
ConcurrentRCSyncs
:
componentConfig
.
ReplicationController
.
ConcurrentRCSyncs
,
&
componentConfig
.
ReplicationController
,
},
ResourceQuotaController
:
&
ResourceQuotaControllerOptions
{
ResourceQuotaSyncPeriod
:
componentConfig
.
ResourceQuotaController
.
ResourceQuotaSyncPeriod
,
ConcurrentResourceQuotaSyncs
:
componentConfig
.
ResourceQuotaController
.
ConcurrentResourceQuotaSyncs
,
&
componentConfig
.
ResourceQuotaController
,
},
SAController
:
&
SAControllerOptions
{
ConcurrentSATokenSyncs
:
componentConfig
.
SAController
.
ConcurrentSATokenSyncs
,
},
ServiceController
:
&
cmoptions
.
ServiceControllerOptions
{
ConcurrentServiceSyncs
:
componentConfig
.
ServiceController
.
ConcurrentServiceSyncs
,
&
componentConfig
.
SAController
,
},
TTLAfterFinishedController
:
&
TTLAfterFinishedControllerOptions
{
ConcurrentTTLSyncs
:
componentConfig
.
TTLAfterFinishedController
.
ConcurrentTTLSyncs
,
&
componentConfig
.
TTLAfterFinishedController
,
},
SecureServing
:
apiserveroptions
.
NewSecureServingOptions
()
.
WithLoopback
(),
InsecureServing
:
(
&
apiserveroptions
.
DeprecatedInsecureServingOptions
{
...
...
cmd/kube-controller-manager/app/options/options_test.go
View file @
3518fb40
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment