> ## Documentation Index
> Fetch the complete documentation index at: https://autopilot.docs.xano.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Disaster Recovery

> Emergency procedures — disable all operations, force a node count, and stop rebalancing.

## Emergency: disable all Autopilot operations

<Warning>
  These procedures stop Autopilot from making any further changes. CRDs and their resources
  are preserved — the controller simply stops reconciling them.
</Warning>

**Option 1 — Scale to zero (fastest):**

```bash theme={null}
kubectl -n ops-ai-system scale deploy/ops-ai-controller --replicas=0
kubectl -n ops-ai-system scale deploy/ops-ai-autoscaler --replicas=0
```

**Option 2 — Enable global dry-run:**

```bash theme={null}
helm upgrade ops-ai-controller deploy/helm/ops-ai-controller \
  --namespace ops-ai-system --reuse-values --set controller.dryRun=true

helm upgrade ops-ai-autoscaler deploy/helm/ops-ai-autoscaler \
  --namespace ops-ai-system --reuse-values --set autoscaler.dryRun=true
```

**Option 3 — Delete the Helm releases entirely:**

```bash theme={null}
helm uninstall ops-ai-controller -n ops-ai-system
helm uninstall ops-ai-autoscaler -n ops-ai-system
```

CRDs and their resources are preserved after a Helm uninstall.

## Manual override: force node count

If the autoscaler has scaled to an unwanted number of nodes:

1. Disable the autoscaler first (see above).

2. Manually resize the node pool via `gcloud`:

   ```bash theme={null}
   gcloud container clusters resize CLUSTER_NAME \
     --node-pool POOL_NAME \
     --num-nodes NUM \
     --zone ZONE
   ```

3. Verify nodes are in the desired state.

4. Re-enable the autoscaler with corrected thresholds.

## Manual override: stop rebalancing

Set all RebalancePolicy resources to dry-run:

```bash theme={null}
kubectl patch rebalancepolicy <name> -n <namespace> \
  --type=merge -p '{"spec":{"dryRun":true}}'
```

Or delete the policy to stop reconciliation for that namespace entirely:

```bash theme={null}
kubectl delete rebalancepolicy <name> -n <namespace>
```
