File tree 3 files changed +23
-4
lines changed
3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ func addCadvisorFlags(fs *pflag.FlagSet) {
42
42
43
43
// e2e node tests rely on this
44
44
register (global , local , "housekeeping_interval" )
45
+ register (global , local , "max_housekeeping_interval" )
45
46
46
47
// These flags were implicit from cadvisor, and are mistakes that should be registered deprecated:
47
48
const deprecated = "This is a cadvisor flag that was mistakenly registered with the Kubelet. Due to legacy concerns, it will follow the standard CLI deprecation timeline before being removed."
Original file line number Diff line number Diff line change @@ -61,10 +61,17 @@ const defaultHousekeepingInterval = 10 * time.Second
61
61
const allowDynamicHousekeeping = true
62
62
63
63
func init () {
64
+ maxHouseKeeping := maxHousekeepingInterval .String ()
65
+ if value := os .Getenv ("OPENSHIFT_MAX_HOUSEKEEPING_INTERVAL_DURATION" ); value != "" {
66
+ klog .Infof ("Detected OPENSHIFT_MAX_HOUSEKEEPING_INTERVAL_DURATION: %v" , value )
67
+ maxHouseKeeping = value
68
+ }
64
69
// Override cAdvisor flag defaults.
65
70
flagOverrides := map [string ]string {
66
71
// Override the default cAdvisor housekeeping interval.
67
72
"housekeeping_interval" : defaultHousekeepingInterval .String (),
73
+ // Override the default max cAdvisor housekeeping interval.
74
+ "max_housekeeping_interval" : maxHouseKeeping ,
68
75
// Disable event storage by default.
69
76
"event_storage_event_limit" : "default=0" ,
70
77
"event_storage_age_limit" : "default=0" ,
Original file line number Diff line number Diff line change @@ -142,10 +142,6 @@ const (
142
142
// housekeeping is running no new pods are started or deleted).
143
143
housekeepingWarningDuration = time .Second * 15
144
144
145
- // Period for performing eviction monitoring.
146
- // ensure this is kept in sync with internal cadvisor housekeeping.
147
- evictionMonitoringPeriod = time .Second * 10
148
-
149
145
// The path in containers' filesystems where the hosts file is mounted.
150
146
linuxEtcHostsPath = "/etc/hosts"
151
147
windowsEtcHostsPath = "C:\\ Windows\\ System32\\ drivers\\ etc\\ hosts"
@@ -181,6 +177,21 @@ const (
181
177
nodeLeaseRenewIntervalFraction = 0.25
182
178
)
183
179
180
+ var (
181
+ // Period for performing eviction monitoring.
182
+ // ensure this is kept in sync with internal cadvisor housekeeping.
183
+ evictionMonitoringPeriod = time .Second * 10
184
+ )
185
+
186
+ func init () {
187
+ if value := os .Getenv ("OPENSHIFT_EVICTION_MONITORING_PERIOD_DURATION" ); value != "" {
188
+ if duration , err := time .ParseDuration (value ); err == nil {
189
+ klog .Infof ("Detected OPENSHIFT_EVICTION_MONITORING_PERIOD_DURATION: %v" , value )
190
+ evictionMonitoringPeriod = duration
191
+ }
192
+ }
193
+ }
194
+
184
195
var etcHostsPath = getContainerEtcHostsPath ()
185
196
186
197
func getContainerEtcHostsPath () string {
You can’t perform that action at this time.
0 commit comments