Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTLY-3934 - add timestamp to scripts #54

Merged
merged 1 commit into from
Jan 21, 2020

Conversation

KevFan
Copy link
Contributor

@KevFan KevFan commented Jan 16, 2020

Description

Adds timestamps to the relevant echo logs to have a better idea on timing / duration when performing a backup

Jira

Verification

  • Provision integreatly workshop with OS3 installed
  • Run the install_backup from the installation repo to install the backup cronjobs
ansible-playbook playbooks/install_backups.yml -e backup_s3_aws_access_key=<YOUR_S3_ACCESS_KEY> -e backup_s3_aws_secret_key=<YOUR_S3_SECRET_KEY> -e backup_s3_aws_bucket=<YOUR_S3_NAME> -e 'ns_prefix=' -e backup_image=quay.io/kevfan/backup-container:latest
  • Scale down the ups operator to 0 to prevent it from reconciling back to hardcoded value
oc edit deployment unifiedpush-operator -n mobile-unifiedpush
  • Edit the cronjob in the ups namespace to use quay.io/kevfan/backup-container:latest
oc edit cronjob ups-daily-at-midnight -n mobile-unifiedpush
  • Scale down the sso operator to 0 to prevent it from reconciling back to hardcoded value
oc edit deployment keycloak-operator -n sso
  • Edit the cronjob in the sso namespace to use quay.io/kevfan/backup-container:latest
 oc edit cronjob daily-at-midnight-sso -n sso
  • Run the following backup jobs (taken from backup SOPs, ensuring the there is now some timestamps to the logs and finishes successfully uploading the backup without error
oc create job 3scale-mysql-backup-$(date +"%Y-%m-%d-%H%M%S") --from=cronjob/3scale-mysql-backup -n openshift-integreatly-backups
oc create job 3scale-postgres-backup-$(date +"%Y-%m-%d-%H%M%S") --from=cronjob/3scale-postgres-backup -n openshift-integreatly-backups
oc create job 3scale-redis-backup-$(date +"%Y-%m-%d-%H%M%S") --from=cronjob/3scale-redis-backup -n openshift-integreatly-backups
oc create job enmasse-postgres-backup-$(date +"%Y-%m-%d-%H%M%S") --from=cronjob/enmasse-postgres-backup -n openshift-integreatly-backups
oc create job enmasse-pv-backup-$(date +"%Y-%m-%d-%H%M%S") --from=cronjob/enmasse-pv-backup -n openshift-integreatly-backups
oc create job codeready-postgres-backup-$(date +"%Y-%m-%d-%H%M%S") --from=cronjob/codeready-postgres-backup -n openshift-integreatly-backups
oc create job codeready-pv-backup-$(date +"%Y-%m-%d-%H%M%S") --from=cronjob/codeready-pv-backup -n openshift-integreatly-backups
oc create job fuse-postgres-backup-$(date +"%Y-%m-%d-%H%M%S") --from=cronjob/fuse-postgres-backup -n openshift-integreatly-backups
oc create job launcher-postgres-backup-$(date +"%Y-%m-%d-%H%M%S") --from=cronjob/launcher-postgres-backup -n openshift-integreatly-backups
oc create job resources-backup-$(date +"%Y-%m-%d-%H%M%S") --from=cronjob/resources-backup -n openshift-integreatly-backups
oc create job ups-postgres-backup-$(date +"%Y-%m-%d-%H%M%S") --from=cronjob/ups-daily-at-midnight -n openshift-mobile-unifiedpush

@KevFan KevFan changed the title [WIP] INTLY-3934 - add timestamp to scripts INTLY-3934 - add timestamp to scripts Jan 17, 2020
@KevFan KevFan requested a review from alanmoran January 20, 2020 14:20
Copy link

@dimitraz dimitraz left a comment

Choose a reason for hiding this comment

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

Verified, the pod logs contain timestamps as expected.

Example logs from the launcher-postgres-backup job:

2020-01-21 12:13:55 ==> Upload /tmp/intly/archives/launcher.root-12_13_53.pg_dump.gz completed
2020-01-21 12:13:55 ==> [2020/01/21] Backup completed
2020-01-21 12:13:55 ==> Finished Backup

@jessesarn
Copy link
Contributor

/lgtm
/approve

@jessesarn jessesarn merged commit 0d0fb63 into integr8ly:master Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants