Uploaded image for project: 'OpenShift Etcd'
  1. OpenShift Etcd
  2. ETCD-443

Add controller for periodic etcd backups

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Critical Critical
    • None
    • None
    • None
    • BU Product Work
    • 5
    • False
    • None
    • False
    • OCPSTRAT-403 - Automated backups of etcd (local destination)
    • ETCD Sprint 239, ETCD Sprint 240

      Given that we have a controller that processes one time etcd backup requests via the "operator.openshift.io/v1alpha1 EtcdBackup" CR, we need another controller that processes the "config.openshift.io/v1alpha1 Backup" CR so we can have periodic backups according the the schedule in the CR spec.

      See https://github.com/openshift/api/pull/1482 for the APIs

      The workflow for this controller should roughly be:

      • Watches the `config.openshift.io/v1alpha1 Backup` CR as created by an admin
      • Creates a CronJob for the specified schedule and timezone that would in turn create `operator.openshift.io/v1alpha1 EtcdBackup` CRs at the desired schedule
      • Updates the CronJob for any changes in the schedule or timezone

      Along with this controller we would also need to provide the workload or Go command for the pod that is created periodically by the CronJob. This cmd e.g "create-etcdbackup-cr" effectively creates a new `operator.openshift.io/v1alpha1 EtcdBackup` CR via the following workflow:

      • Read the Backup CR to get the pvcName (and anything else) required to populate an `EtcdBackup` CR
      • Create the `operator.openshift.io/v1alpha1 EtcdBackup` CR

      Lastly to fulfill the retention policy (None, number of backups saved, or total size of backups), we can employ the following workflow:

      • Have another command e.g "prune-backups" cmd that runs prior to the "create-etcdbackup-cr" command that deletes existing backups per the retention policy.
      • This cmd is run before the cmd to create the etcdbackup CR. This could be done via an init container on the CronJob execution pod.
      • This would require the backup controller to populate the CronJob spec with the pvc name from the Backup spec that would allowing mounting the PV on the execution pod for pruning the backups in the init container.

              tjungblu@redhat.com Thomas Jungblut
              rhn-coreos-htariq Haseeb Tariq
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: