Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Enmasse backup #430

Merged
merged 4 commits into from
Mar 8, 2019
Merged

Enmasse backup #430

merged 4 commits into from
Mar 8, 2019

Conversation

pb82
Copy link
Contributor

@pb82 pb82 commented Mar 6, 2019

Creates the enmasse backup cronjob.

Sets up a CronJob to backup the kubernetes resources.

Verification:

To test that the files in the PV are backed up you need a brokered AMQ:

  1. Go to the service catalog and select AMQ Online (brokered). Pick the enmasse namespace and a name and provision the brokered quee.
  2. In your enmasse namespace you should see an additional pod for the brokered queue.
  3. Open the terminal of this pod and go to /var/run/artemis
  4. Create a file in the, like echo "test" > /var/run/artemis/test.txt

Then you can verify the backup using:

  1. Make sure that the s3-credentials secret exists in the default namespace
  2. Update the master URL in managed.template and set core_install=false if you've already setup integreatly
  3. Set backup_schedule in manifest.yaml to '*/1 * * * *' to run each minute
  4. Run: ansible-playbook -i inventories/managed.template playbooks/managed/install.yml
  5. Wait a minute

In the enmasse namespace
1.1 Ensure the postgres-backup Pod succeeds
1.1 Ensure the PV backup succeeds and the archive contains the file generated for the brokered pod.
1.1 Check S3 and ensure the archives have been pushed up.
1.1 Delete the CronJobs in all namespaces


# Delete the old backup cronjob in case this is a re-installation
- name: Remove old cronjob
shell: oc delete cronjob {{ enmasse_backup_cronjob_name }} --ignore-not-found -n {{ enmasse_namespace }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pb82 I'd prefer to avoid this pattern during install.
If the install failed for some reason, and had to be re-run, it should be idempotent i.e. not remove or recreate anything, but create anything that is missing.

This has caused issues for us in the past e.g. #73 & #402

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, the idea was to make sure the job gets updated when the properties change but for that we can use apply. Will update this.

@pb82 pb82 force-pushed the enmasse-backup branch 2 times, most recently from 19f87c5 to b78940a Compare March 7, 2019 14:02
@matskiv
Copy link
Contributor

matskiv commented Mar 7, 2019

👀

enmasse_backup_postgres_secret: 'enmasse-postgres-secret'
enmasse_postgres_cronjob_name: 'postgres-backup'
enmasse_pv_cronjob_name: 'pv-backup'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are creating all CronJobs in default namespace, two names above should be prepended with 'enmasse-', just to avoid any ambiguity.

Copy link
Contributor

@matskiv matskiv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Verified

@pb82 pb82 merged commit b78fa73 into integr8ly:master Mar 8, 2019
@pb82 pb82 deleted the enmasse-backup branch March 8, 2019 10:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants