Rke: RKE doesn't Backup ETCD to S3

Created on 11 Apr 2019  路  2Comments  路  Source: rancher/rke

Hi, I using v0.2.1 in two different clusters.
I configured the etcd backup to S3 as follow:

services:
  etcd:
    snapshot: true
    creation: 6h
    retention: 24h
    s3backupconfig:
      access_key: ACCESSKEY
      secret_key: SECRETKEY
      bucket_name: k8s-etcd-snapshots
      region: "eu-west-1"
      endpoint: s3.amazonaws.com

The problem is that the bucket is empty, after several days.

I checked on 3 hosts of one cluster the logs of etcd-rolling-snapshots containers and this is the results for last run:

HOST1:

time="2019-04-11T10:25:52Z" level=info msg="Created backup" name="2019-04-11T10:25:51Z_etcd" runtime=270.700035ms
time="2019-04-11T10:25:52Z" level=info msg="Deleted backup" name="2019-04-10T10:25:51Z_etcd" runtime=2.944169ms
time="2019-04-11T10:25:52Z" level=warning msg="Couldn't parse backup" error="parsing time \"pki.bundle.tar.gz\" as \"2006-01-02T15:04:05Z07:00\": cannot parse \"pki.bundle.tar.gz\" as \"2006\"" name=pki.bundle.tar.gz

HOST2:

time="2019-04-11T10:25:43Z" level=info msg="Created backup" name="2019-04-11T10:25:42Z_etcd" runtime=217.591421ms
time="2019-04-11T10:25:43Z" level=info msg="Deleted backup" name="2019-04-10T10:25:42Z_etcd" runtime=9.864486ms

HOST3:

time="2019-04-11T10:25:34Z" level=info msg="Created backup" name="2019-04-11T10:25:34Z_etcd" runtime=187.34845ms
time="2019-04-11T10:25:34Z" level=info msg="Deleted backup" name="2019-04-10T10:25:34Z_etcd" runtime=2.715149ms
time="2019-04-11T10:25:34Z" level=warning msg="Couldn't parse backup" error="parsing time \"pki.bundle.tar.gz\" as \"2006-01-02T15:04:05Z07:00\": cannot parse \"pki.bundle.tar.gz\" as \"2006\"" name=pki.bundle.tar.gz

I tried also the manual snapshot passing all values with parameters and it works fine.

Thanks

kinbug

Most helpful comment

Thanks @galal-hussein I enabled the new config and I'm waiting for a first backup.
One question:
Does bucket_name support a folder inside the bucket? something like: "s3-bucket-name/cluster1/"

Thanks

All 2 comments

@Leen15 The problem is that you are using a legacy backup according to the docs the new backup config should be the following:

services:
  etcd:
    backup_config:
      interval_hours: 12
      retention: 6
      s3backupconfig:
        access_key: S3_ACCESS_KEY
        secret_key: S3_SECRET_KEY
        bucket_name: s3-bucket-name
        region: ""
        endpoint: s3.amazonaws.com

This backup config should work properly, for more information please refer to the docs https://rancher.com/docs/rke/latest/en/etcd-snapshots/#options-for-the-etcd-snapshot-service

Thanks @galal-hussein I enabled the new config and I'm waiting for a first backup.
One question:
Does bucket_name support a folder inside the bucket? something like: "s3-bucket-name/cluster1/"

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nheinemans picture nheinemans  路  15Comments

HighwayofLife picture HighwayofLife  路  29Comments

niko-lay picture niko-lay  路  14Comments

superseb picture superseb  路  16Comments

bootc picture bootc  路  18Comments