mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
KEP-4603: Refactor various hardcoded backoffs into separate constants (#128369)
* Refactor various hardcoded backoffs into separate constants Signed-off-by: Laura Lorenz <lauralorenz@google.com> * Fix comment formatting Signed-off-by: Laura Lorenz <lauralorenz@google.com> --------- Signed-off-by: Laura Lorenz <lauralorenz@google.com>
This commit is contained in:
parent
e5a31e8bbc
commit
4965a7a8a0
@ -144,9 +144,12 @@ const (
|
|||||||
// DefaultContainerLogsDir is the location of container logs.
|
// DefaultContainerLogsDir is the location of container logs.
|
||||||
DefaultContainerLogsDir = "/var/log/containers"
|
DefaultContainerLogsDir = "/var/log/containers"
|
||||||
|
|
||||||
// MaxContainerBackOff is the max backoff period, exported for the e2e test
|
// MaxContainerBackOff is the max backoff period for container restarts, exported for the e2e test
|
||||||
MaxContainerBackOff = 300 * time.Second
|
MaxContainerBackOff = 300 * time.Second
|
||||||
|
|
||||||
|
// MaxImageBackOff is the max backoff period for image pulls, exported for the e2e test
|
||||||
|
MaxImageBackOff = 300 * time.Second
|
||||||
|
|
||||||
// Period for performing global cleanup tasks.
|
// Period for performing global cleanup tasks.
|
||||||
housekeepingPeriod = time.Second * 2
|
housekeepingPeriod = time.Second * 2
|
||||||
|
|
||||||
@ -189,10 +192,15 @@ const (
|
|||||||
eventedPlegMaxStreamRetries = 5
|
eventedPlegMaxStreamRetries = 5
|
||||||
|
|
||||||
// backOffPeriod is the period to back off when pod syncing results in an
|
// backOffPeriod is the period to back off when pod syncing results in an
|
||||||
// error. It is also used as the base period for the exponential backoff
|
// error.
|
||||||
// container restarts and image pulls.
|
|
||||||
backOffPeriod = time.Second * 10
|
backOffPeriod = time.Second * 10
|
||||||
|
|
||||||
|
// Initial period for the exponential backoff for container restarts.
|
||||||
|
containerBackOffPeriod = time.Second * 10
|
||||||
|
|
||||||
|
// Initial period for the exponential backoff for image pulls.
|
||||||
|
imageBackOffPeriod = time.Second * 10
|
||||||
|
|
||||||
// ContainerGCPeriod is the period for performing container garbage collection.
|
// ContainerGCPeriod is the period for performing container garbage collection.
|
||||||
ContainerGCPeriod = time.Minute
|
ContainerGCPeriod = time.Minute
|
||||||
// ImageGCPeriod is the period for performing image garbage collection.
|
// ImageGCPeriod is the period for performing image garbage collection.
|
||||||
@ -615,7 +623,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
machineInfo.Timestamp = time.Time{}
|
machineInfo.Timestamp = time.Time{}
|
||||||
klet.setCachedMachineInfo(machineInfo)
|
klet.setCachedMachineInfo(machineInfo)
|
||||||
|
|
||||||
imageBackOff := flowcontrol.NewBackOff(backOffPeriod, MaxContainerBackOff)
|
imageBackOff := flowcontrol.NewBackOff(imageBackOffPeriod, MaxImageBackOff)
|
||||||
|
|
||||||
klet.livenessManager = proberesults.NewManager()
|
klet.livenessManager = proberesults.NewManager()
|
||||||
klet.readinessManager = proberesults.NewManager()
|
klet.readinessManager = proberesults.NewManager()
|
||||||
@ -874,7 +882,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
kubeDeps.Recorder,
|
kubeDeps.Recorder,
|
||||||
volumepathhandler.NewBlockVolumePathHandler())
|
volumepathhandler.NewBlockVolumePathHandler())
|
||||||
|
|
||||||
klet.backOff = flowcontrol.NewBackOff(backOffPeriod, MaxContainerBackOff)
|
klet.backOff = flowcontrol.NewBackOff(containerBackOffPeriod, MaxContainerBackOff)
|
||||||
|
|
||||||
// setup eviction manager
|
// setup eviction manager
|
||||||
evictionManager, evictionAdmitHandler := eviction.NewManager(klet.resourceAnalyzer, evictionConfig,
|
evictionManager, evictionAdmitHandler := eviction.NewManager(klet.resourceAnalyzer, evictionConfig,
|
||||||
|
Loading…
Reference in New Issue
Block a user