@@ -873,6 +873,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
873
873
volumepathhandler .NewBlockVolumePathHandler ())
874
874
875
875
klet .backOff = flowcontrol .NewBackOff (backOffPeriod , MaxContainerBackOff )
876
+ klet .staticBackOff = flowcontrol .NewBackOff (time .Second * 3 , time .Second * 10 )
876
877
877
878
// setup eviction manager
878
879
evictionManager , evictionAdmitHandler := eviction .NewManager (klet .resourceAnalyzer , evictionConfig ,
@@ -1259,6 +1260,8 @@ type Kubelet struct {
1259
1260
1260
1261
// Container restart Backoff
1261
1262
backOff * flowcontrol.Backoff
1263
+ // static pod Backoff
1264
+ staticBackOff * flowcontrol.Backoff
1262
1265
1263
1266
// Information about the ports which are opened by daemons on Node running this Kubelet server.
1264
1267
daemonEndpoints * v1.NodeDaemonEndpoints
@@ -1940,7 +1943,14 @@ func (kl *Kubelet) SyncPod(ctx context.Context, updateType kubetypes.SyncPodType
1940
1943
// Use WithoutCancel instead of a new context.TODO() to propagate trace context
1941
1944
// Call the container runtime's SyncPod callback
1942
1945
sctx := context .WithoutCancel (ctx )
1943
- result := kl .containerRuntime .SyncPod (sctx , pod , podStatus , pullSecrets , kl .backOff )
1946
+ backOff := kl .backOff
1947
+ if pod .Annotations != nil && pod .Annotations [kubetypes .ConfigSourceAnnotationKey ] == "file" {
1948
+ klog .V (5 ).InfoS ("use static backOff for pod. " , "pod" , klog .KObj (pod ))
1949
+ backOff = kl .staticBackOff
1950
+ } else {
1951
+ klog .V (5 ).InfoS ("use normal backOff for pod. " , "pod" , klog .KObj (pod ))
1952
+ }
1953
+ result := kl .containerRuntime .SyncPod (sctx , pod , podStatus , pullSecrets , backOff )
1944
1954
kl .reasonCache .Update (pod .UID , result )
1945
1955
if err := result .Error (); err != nil {
1946
1956
// Do not return error if the only failures were pods in backoff
0 commit comments