mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-08-03 08:19:43 +00:00
Address issues with etcd snapshots
* Increase the default snapshot timeout. The timeout is not currently configurable from Rancher, and larger clusters are frequently seeing uploads fail at 30 seconds. * Enable compression for scheduled snapshots if enabled on the command-line. The CLI flag was not being passed into the etcd config. * Only set the S3 content-type to application/zip if the file is zipped. * Don't run more than one snapshot at once, to prevent misconfigured etcd snapshot cron schedules from stacking up. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
committed by
Brad Davidson
parent
167ed19d22
commit
ffe72eecc4
@@ -95,7 +95,7 @@ var EtcdSnapshotFlags = []cli.Flag{
|
||||
Name: "s3-timeout,etcd-s3-timeout",
|
||||
Usage: "(db) S3 timeout",
|
||||
Destination: &ServerConfig.EtcdS3Timeout,
|
||||
Value: 30 * time.Second,
|
||||
Value: 5 * time.Minute,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -381,7 +381,7 @@ var ServerFlags = []cli.Flag{
|
||||
Name: "etcd-s3-timeout",
|
||||
Usage: "(db) S3 timeout",
|
||||
Destination: &ServerConfig.EtcdS3Timeout,
|
||||
Value: 30 * time.Second,
|
||||
Value: 5 * time.Minute,
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "default-local-storage-path",
|
||||
|
||||
@@ -152,6 +152,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
|
||||
serverConfig.ControlConfig.EtcdDisableSnapshots = cfg.EtcdDisableSnapshots
|
||||
|
||||
if !cfg.EtcdDisableSnapshots {
|
||||
serverConfig.ControlConfig.EtcdSnapshotCompress = cfg.EtcdSnapshotCompress
|
||||
serverConfig.ControlConfig.EtcdSnapshotName = cfg.EtcdSnapshotName
|
||||
serverConfig.ControlConfig.EtcdSnapshotCron = cfg.EtcdSnapshotCron
|
||||
serverConfig.ControlConfig.EtcdSnapshotDir = cfg.EtcdSnapshotDir
|
||||
|
||||
Reference in New Issue
Block a user