mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Adjust the sync/backoff period
Set resyncInterval to one minute now that we rely on the generic pleg to trigger pod syncs on container events. When there is an error during syncing, pod workers need to wake up sooner to retry. Set the sync error backoff period to 10 second in this case.
This commit is contained in:
parent
bc6414a873
commit
ac778e8203
@ -216,7 +216,7 @@ func NewKubeletServer() *KubeletServer {
|
||||
RootDirectory: defaultRootDir,
|
||||
SerializeImagePulls: true,
|
||||
StreamingConnectionIdleTimeout: 5 * time.Minute,
|
||||
SyncFrequency: 10 * time.Second,
|
||||
SyncFrequency: 1 * time.Minute,
|
||||
SystemContainer: "",
|
||||
ReconcileCIDR: true,
|
||||
KubeAPIQPS: 5.0,
|
||||
|
@ -131,13 +131,13 @@ kubelet
|
||||
--runonce[=false]: If true, exit after spawning pods from local manifests or remote urls. Exclusive with --api-servers, and --enable-server
|
||||
--serialize-image-pulls[=true]: Pull images one at a time. We recommend *not* changing the default value on nodes that run docker daemon with version < 1.9 or an Aufs storage backend. Issue #10959 has more details. [default=true]
|
||||
--streaming-connection-idle-timeout=5m0s: Maximum time a streaming connection can be idle before the connection is automatically closed. Example: '5m'
|
||||
--sync-frequency=10s: Max period between synchronizing running containers and config
|
||||
--sync-frequency=1m0s: Max period between synchronizing running containers and config
|
||||
--system-container="": Optional resource-only container in which to place all non-kernel processes that are not already in a container. Empty for no container. Rolling back the flag requires a reboot. (Default: "").
|
||||
--tls-cert-file="": File containing x509 Certificate for HTTPS. (CA cert, if any, concatenated after server cert). If --tls-cert-file and --tls-private-key-file are not provided, a self-signed certificate and key are generated for the public address and saved to the directory passed to --cert-dir.
|
||||
--tls-private-key-file="": File containing x509 private key matching --tls-cert-file.
|
||||
```
|
||||
|
||||
###### Auto generated by spf13/cobra on 10-Nov-2015
|
||||
###### Auto generated by spf13/cobra on 11-Nov-2015
|
||||
|
||||
|
||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||
|
@ -117,10 +117,14 @@ const (
|
||||
// is a bit arbitrary and may be adjusted in the future.
|
||||
plegChannelCapacity = 1000
|
||||
|
||||
// Relisting is used to discover missing container events.
|
||||
// Use a shorter period because generic PLEG relies on relisting for
|
||||
// container events.
|
||||
// Generic PLEG relies on relisting for discovering container events.
|
||||
// The period directly affects the response time of kubelet.
|
||||
plegRelistPeriod = time.Second * 3
|
||||
|
||||
// backOffPeriod is the period to back off when pod syncing resulting in an
|
||||
// error. It is also used as the base period for the exponential backoff
|
||||
// container restarts and image pulls.
|
||||
backOffPeriod = time.Second * 10
|
||||
)
|
||||
|
||||
var (
|
||||
@ -437,11 +441,9 @@ func NewMainKubelet(
|
||||
}
|
||||
klet.runtimeCache = runtimeCache
|
||||
klet.workQueue = queue.NewBasicWorkQueue()
|
||||
// TODO(yujuhong): backoff and resync interval should be set differently
|
||||
// once we switch to using pod event generator.
|
||||
klet.podWorkers = newPodWorkers(runtimeCache, klet.syncPod, recorder, klet.workQueue, klet.resyncInterval, klet.resyncInterval)
|
||||
klet.podWorkers = newPodWorkers(runtimeCache, klet.syncPod, recorder, klet.workQueue, klet.resyncInterval, backOffPeriod)
|
||||
|
||||
klet.backOff = util.NewBackOff(resyncInterval, MaxContainerBackOff)
|
||||
klet.backOff = util.NewBackOff(backOffPeriod, MaxContainerBackOff)
|
||||
klet.podKillingCh = make(chan *kubecontainer.Pod, podKillingChannelCapacity)
|
||||
klet.sourcesSeen = sets.NewString()
|
||||
return klet, nil
|
||||
|
Loading…
Reference in New Issue
Block a user