rancher / rancher

Complete container management platform
http://rancher.com
Apache License 2.0
23.35k stars 2.97k forks source link

Bug: cluster yaml etcd "snapshot" setting always false #22884

Open patrick0057 opened 5 years ago

patrick0057 commented 5 years ago

What kind of request is this (question/bug/enhancement/feature request): Bug

Steps to reproduce (least amount of steps as possible):

  1. Create a new cluster of any provider type except imported.
  2. Edit cluster, then edit cluster as YAML.
  3. Scroll down to the etcd service section and observe that snapshot is set to false

Result: If you make any changes to the snapshot settings in the form, "snapshot" is always set to false in the YAML. This is a problem as the etcd-rolling-snapshots container will be deleted next time you make changes to the snapshot settings in the form. The only way to get the container back is to manually edit the cluster as YAML and set this to true.

Other details that may be helpful:

Environment information

Cluster information

alena1108 commented 5 years ago

@patrick0057 "Snapshot" has become a legacy flag when we enabled an ability to define recurring snapshots via Rancher UI - v2.2.0 - and is left around for rke cli use only:

https://github.com/rancher/types/blob/master/apis/management.cattle.io/v3/rke_types.go#L253

Starting v2.2.0, the indication of recurring snapshots being enabled, is as follows:

services: 
  etcd: 
    backup_config: 
      enabled: true
      interval_hours: 12
      retention: 6

The functionality for taking a recurring snapshots was moved to Rancher server side as we display the snapshot objects in Rancher API now. Based on the schedule, Rancher would contact RKE to take a one time local snapshot (and back it up to the s3 if the endpoint is configured), therefore you won't see etcd-rolling-snapshots container running.