11b9f6f0c7d455ef2fcbda3cacba6b2c672d5a83
Two real gaps found after testing the live standby platform: 1. modules/kubernetes.py's in-cluster client (load_incluster_config()) can only ever work inside the real k8s pod. On the standby it silently returned K8S_AVAILABLE=False with zero fallback — Cluster, Containers- via-sites, and any cluster/app health data was just empty on that page, not erroring, so it was easy to miss. This holds even if the standby later runs as a pod on a *local* k3s on that server (per plan for the monitoring migration) — in-cluster config there would only ever see that local, unrelated cluster, never the main one. Fixed by adding an SSH+kubectl remote path to list_pods(), list_ deployments(), get_ingress_info(), list_deployments_for_namespace(), and get_pod_metrics(): when not RUNNING_ON_MAIN_SERVER, each runs `kubectl <verb> -o json` on the main server over the tunnel (main-to-vm-tunnel.service) instead of using the python client, parses the raw (camelCase) JSON directly rather than trying to force it through the client-library's snake_case object model, and feeds the same _pod_health/_deploy_health/_age_str helpers either way. The in-cluster path for the real main-server pod is untouched. 2. get_system_info() called psutil.* unconditionally with no RUNNING_ON_MAIN_SERVER awareness at all — on the standby it was silently reporting the VM's OWN cpu/mem/disk/hostname mislabeled as "system info" (hostname field literally showed the VM's hostname). Added _get_main_server_system_info_remote(): SSHes to the main server and gathers the same stats via vmstat/free/df/procfs (the main server's bare host has no psutil — that's only in this app's own container image — so this avoids depending on it being present remotely). Verified end-to-end on the live standby: /api/system now reports the real main server's hostname/cpu/mem/disk/uptime; /api/cluster reports real counts (19 pods, 16/16 deployments healthy, 3 degraded, plus live per-pod metrics via the metrics-server raw API); /api/sites shows real per-app container/role status. All previously silently empty.
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%