054a9e1fcb5c8f3a91fba31f4156c2f4e1373c12
restore-k8s-apps.sh's own header explicitly scoped out fresh-cluster
provisioning ("assumes the target cluster/namespaces/PVCs already
exist"). This adds exactly that missing piece as an Ansible playbook
rather than another bash script — a better fit for "provision a target
into a working state" than for the actual data-restore logic, which stays
in restore-k8s-apps.sh unchanged and is just invoked as the final step.
dr-bootstrap.yml, given an app name + a backup archive:
1. Checks the target's environment (disk/mem/cpu) against k3s minimums
before touching anything
2. Installs k3s only if not already present (checked, not assumed)
3. Creates the namespace, PVC(s), Secret, and Deployments/Services/
Ingress from the backup's captured manifests — sanitized first
(sanitize_k8s_manifest.py strips resourceVersion/uid/status/
volumeName, the same class of bug as the earlier Secret-apply fix,
generalized) since a raw `kubectl get -o yaml` dump can't be
reapplied to a different cluster as-is
4. Hands off to the existing, already-validated restore-k8s-apps.sh for
the actual data population
backup-k8s-apps.sh gets a small but necessary addition: PVC specs were
never captured at all before (only Deployment/Service/ConfigMap/Ingress),
so there was nothing for a fresh-cluster bootstrap to provision the PVC
from. Captured with the same label selector as the existing manifests
capture, so it stays in lockstep automatically.
Verified for real, not just syntax-checked: ran the full playbook against
the standby VM (freshly installed k3s, empty namespace) using a live n8n
backup. Namespace/PVCs/Secret/Deployments provisioned from nothing, data
restored, pod healthy, and the workflow count in the restored Postgres DB
(11) matched the real source server exactly.
CloudOps - Infrastructure Management & Disaster Recovery Platform
Overview
This repository contains the complete infrastructure code for Navitrends' backup and disaster recovery platform.
Components
- Platform: Flask web application for backup/restore management
- Scripts: Backup, restore, and sync scripts
- Docker Compose: Configuration for all 5 applications
Applications Managed
- Nextcloud (File sharing)
- Odoo (ERP/CRM)
- Frappe/ERPNext
- Mautic (Marketing automation)
- n8n (Workflow automation)
Servers
- Main Server: 173.249.20.244
- Backup VM: 192.168.152.128
Description
Languages
PHP
66.6%
JavaScript
15.8%
Twig
8.6%
CSS
4.4%
Less
2.1%
Other
2.4%