-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
openshiftcontrolplane_default.go
57 lines (45 loc) · 2.46 KB
/
openshiftcontrolplane_default.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package configdefault
import (
"time"
openshiftcontrolplanev1 "github.com/openshift/api/openshiftcontrolplane/v1"
"github.com/openshift/library-go/pkg/config/configdefaults"
leaderelectionconverter "github.com/openshift/library-go/pkg/config/leaderelection"
)
func SetRecommendedOpenShiftControllerConfigDefaults(config *openshiftcontrolplanev1.OpenShiftControllerManagerConfig) {
configdefaults.SetRecommendedHTTPServingInfoDefaults(config.ServingInfo)
configdefaults.SetRecommendedKubeClientConfigDefaults(&config.KubeClientConfig)
config.LeaderElection = leaderelectionconverter.LeaderElectionDefaulting(config.LeaderElection, "kube-system", "openshift-master-controllers")
configdefaults.DefaultStringSlice(&config.Controllers, []string{"*"})
configdefaults.DefaultString(&config.Network.ServiceNetworkCIDR, "10.0.0.0/24")
if config.ImageImport.MaxScheduledImageImportsPerMinute == 0 {
config.ImageImport.MaxScheduledImageImportsPerMinute = 60
}
if config.ImageImport.ScheduledImageImportMinimumIntervalSeconds == 0 {
config.ImageImport.ScheduledImageImportMinimumIntervalSeconds = 15 * 60
}
configdefaults.DefaultString(&config.SecurityAllocator.UIDAllocatorRange, "1000000000-1999999999/10000")
configdefaults.DefaultString(&config.SecurityAllocator.MCSAllocatorRange, "s0:/2")
if config.SecurityAllocator.MCSLabelsPerProject == 0 {
config.SecurityAllocator.MCSLabelsPerProject = 5
}
if config.ResourceQuota.MinResyncPeriod.Duration == 0 {
config.ResourceQuota.MinResyncPeriod.Duration = 5 * time.Minute
}
if config.ResourceQuota.SyncPeriod.Duration == 0 {
config.ResourceQuota.SyncPeriod.Duration = 12 * time.Hour
}
if config.ResourceQuota.ConcurrentSyncs == 0 {
config.ResourceQuota.ConcurrentSyncs = 5
}
if config.ImageImport.MaxScheduledImageImportsPerMinute == 0 {
config.ImageImport.MaxScheduledImageImportsPerMinute = 60
}
if config.ImageImport.ScheduledImageImportMinimumIntervalSeconds == 0 {
config.ImageImport.ScheduledImageImportMinimumIntervalSeconds = 15 * 60 // 15 minutes
}
configdefaults.DefaultStringSlice(&config.ServiceAccount.ManagedNames, []string{"builder", "deployer"})
// TODO this default is WRONG, but it appears to work
configdefaults.DefaultString(&config.Deployer.ImageTemplateFormat.Format, "quay.io/openshift/origin-${component}:${version}")
// TODO this default is WRONG, but it appears to work
configdefaults.DefaultString(&config.Build.ImageTemplateFormat.Format, "quay.io/openshift/origin-${component}:${version}")
}