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

[kots]: allow for backup of resources in KOTS #11971

Merged
merged 2 commits into from
Aug 16, 2022
Merged

[kots]: allow for backup of resources in KOTS #11971

merged 2 commits into from
Aug 16, 2022

Conversation

mrsimonemms
Copy link
Contributor

@mrsimonemms mrsimonemms commented Aug 8, 2022

Description

Allows for triggering snapshots of your application in KOTS.

IMPORTANT this only backs up the KOTS application status. It does NOT backup data in your Gitpod database, registry or object storage. For production instances, we always recommend using external cloud resources - consult with your provider for advice on backing up those resources.

See docs ticket

Related Issue(s)

Fixes #9926

How to test

  • Install via KOTS
  • Create your Velero instance (see below or I can help with this)
  • Create a backup
  • Delete Gitpod/KOTS from your cluster
  • Restore it to your cluster

Creating your Velero instance

Velero maintains AWS, GCP and Azure as first-class citizens

  1. Following the GCP setup instructions
  2. The velero install command in the docs needs to have --use-restic appended to it, ie
velero install \                                           
    --provider gcp \
    --plugins velero/velero-plugin-for-gcp:v1.5.0 \
    --bucket $BUCKET \
    --secret-file ./credentials-velero \
    --use-restic \
    --wait

Create a backup

Either:

  • In the KOTS Dashboard, click "full snapshot"
  • In the CLI, run kubectl kots backup -n gitpod

Restoring a Backup

  1. Ensure you have no gitpod or velero namespace on your cluster (this simulates a fresh cluster)
  2. Install Velero using the velero install command above
  3. Run kubectl kots backup ls and select the backup ID you want
  4. Run kubectl kots restore --from-backup <backup-id>
  5. Run kubectl kots admin-console -n gitpod
  6. In your KOTS Dashboard, hit "redeploy"

After a few minutes, you should have everything restored.

Release Notes

[kots]: allow for backup of resources in KOTS

Documentation

Werft options:

  • /werft with-preview

@gitguardian
Copy link

gitguardian bot commented Aug 9, 2022

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@mrsimonemms mrsimonemms changed the title Sje/kots backup [kots]: allow for backing of resources in KOTS Aug 9, 2022
@mrsimonemms mrsimonemms force-pushed the sje/kots-backup branch 2 times, most recently from 21026b8 to 3dbdd28 Compare August 9, 2022 11:33
@mrsimonemms mrsimonemms changed the title [kots]: allow for backing of resources in KOTS [kots]: allow for backup of resources in KOTS Aug 9, 2022
@mrsimonemms mrsimonemms force-pushed the sje/kots-backup branch 5 times, most recently from f1d5213 to 03f891b Compare August 9, 2022 13:29
@mrsimonemms mrsimonemms force-pushed the sje/kots-backup branch 4 times, most recently from 722b03b to 1788313 Compare August 10, 2022 11:13
@mrsimonemms mrsimonemms mentioned this pull request Aug 10, 2022
1 task
@roboquat roboquat added size/S and removed size/XXL labels Aug 10, 2022
@mrsimonemms mrsimonemms marked this pull request as ready for review August 11, 2022 08:45
@mrsimonemms mrsimonemms requested a review from a team August 11, 2022 08:45
@github-actions github-actions bot added the team: delivery Issue belongs to the self-hosted team label Aug 11, 2022
Copy link
Contributor

@corneliusludmann corneliusludmann left a comment

Choose a reason for hiding this comment

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

Looks good. Small change, big impact. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note size/S team: delivery Issue belongs to the self-hosted team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow for Replicated Snapshot, Rollback, & Restore
3 participants