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

feat: velero implementation #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions docs/operators_guide/backups/backups_management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Backup Management

Our platform uses [Velero](https://velero.io/) for backup and recovery operations. Velero provides a simple and reliable way to back up and restore Kubernetes cluster resources and persistent volumes.

## Automated Backups with Velero

By default, Velero is configured to automatically back up specific namespaces every day at 02:00 UTC, with a retention policy of 7 days. The namespaces included in the default backup schedule are:

- `harbor`
- `vault`

The backup schedule is defined in the following file:

```markdown
gitops-pipelines/delivery/clusters/cc-cluster/core-services/components/velero/backup-schedule.yaml
```


### Customizing Backup Schedules

To add more namespaces to the backup schedule or adjust the backup settings, you can update the existing `backup-schedule.yaml` file or create a new one. Changes made to this file will be detected by ArgoCD and applied automatically, ensuring your backups are always up to date.

## Restoring from Backup

In the event that you need to restore from a backup, follow the steps below.

### Disable ArgoCD Auto-Sync

Before initiating a restore, it's important to disable ArgoCD's auto-sync feature to prevent it from overwriting the restored resources. You can disable auto-sync by:

- Editing the ArgoCD application manifest in the GitOps repository.
- Using the ArgoCD UI.
- Using the ArgoCD CLI.

> **Recommended Approach:** Update the ArgoCD application file in the GitOps repository. This method ensures that changes are version-controlled and easily trackable.

### Install and Configure Velero Locally

1. **Install Velero CLI:**

Follow the [official Velero installation guide](https://velero.io/docs/main/basic-install/) to install the Velero CLI on your local machine.

2. **Configure Cluster Context:**

Ensure your kubeconfig is set to the cluster you wish to restore:

```bash
kubectl config use-context <your-cluster-context>

3. **Validate Velero Access:**

Verify that Velero can communicate with your cluster:

```bash
velero version
```


### Perform the Restore

1. **List Available Backups:**

View all available backups to find the one you need:

```bash
velero backup get
```
2. **Initiate the Restore:**

Use the following command to start the restore process::

```bash
velero restore create --from-backup <backup-name>
```
Replace <backup-name> with the name of the backup you wish to restore. For example:

```bash
velero restore create --from-backup daily-backup-20241120020019
```
3. **Monitor the Restore Process:**

Check the status of the restore:

```bash
velero restore get
```
For detailed information:
```bash
velero restore describe <restore-name>
```
Replace <restore-name> with the name of the restore operation initiated.

### Re-enable ArgoCD Auto-Sync

After confirming that the restore was successful and the cluster is functioning as expected, re-enable ArgoCD's auto-sync feature to maintain the desired state of the cluster.

## Additional Considerations

- **Data Consistency:** Ensure that no conflicting operations are occurring during the restore to prevent data inconsistencies.
- **Resource Quotas:** Verify that resource quotas and limits are sufficient for the restored resources.

## References

- [Velero Documentation](https://velero.io/docs/)
- [ArgoCD Documentation](https://argo-cd.readthedocs.io/en/stable/)

---

By following these steps, you can effectively manage backups and restores within your Kubernetes clusters, ensuring data integrity and continuity of service.
1 change: 1 addition & 0 deletions docs/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ This page is dedicated to giving those projects credit for their incredible offe
- [Prometheus](https://github.com/prometheus/prometheus) ([Apache 2.0](https://github.com/prometheus/prometheus/blob/main/LICENSE))
- [Reloader](https://github.com/stakater/Reloader) ([Apache 2.0](https://github.com/stakater/Reloader/blob/master/LICENSE))
- [SonarQube](https://github.com/SonarSource/sonarqube) ([GNU 3.0](https://github.com/SonarSource/sonarqube/blob/master/LICENSE.txt))
- [Velero](https://github.com/vmware-tanzu/velero) ([Apache 2.0](https://github.com/vmware-tanzu/velero/blob/main/LICENSE))