Skip to content

Commit 4053b2b

Browse files
author
github-actions
committed
Sync docs from ops-cli repo
1 parent 5059f24 commit 4053b2b

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

docs/docs-backup/backup/kubernetes-backup.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,37 @@ The backup process needs these Kubernetes permissions:
340340
| `statefulsets` | get, patch | Scale down/up during backup |
341341
| `pods/log` | get | Monitor backup progress |
342342

343+
### Network access to the API server
344+
345+
RBAC grants *authorization*, but the backup Job also needs *network* connectivity to the Kubernetes API server. The tool discovers pods, scales services, and runs commands inside pods through the API server's `exec`, `cp`, and `log` subresources — these operations stream through the API server, not directly between pods. This applies to both the in-band Helm Job and any out-of-band `kubectl` run.
346+
347+
If your cluster enforces default-deny egress with [NetworkPolicies](https://kubernetes.io/docs/concepts/services-networking/network-policies/), add an egress rule that lets the backup pod reach the API server, typically the `kubernetes.default.svc` ClusterIP on port 443 (or your control-plane endpoint):
348+
349+
```yaml
350+
apiVersion: networking.k8s.io/v1
351+
kind: NetworkPolicy
352+
metadata:
353+
name: infrahub-backup-apiserver-egress
354+
namespace: infrahub
355+
spec:
356+
podSelector:
357+
matchLabels:
358+
app.kubernetes.io/name: infrahub-backup
359+
policyTypes:
360+
- Egress
361+
egress:
362+
# Allow the backup pod to reach the Kubernetes API server.
363+
# Adjust the port to match your cluster (443 for the in-cluster
364+
# service, 6443 for many control-plane endpoints).
365+
- ports:
366+
- protocol: TCP
367+
port: 443
368+
```
369+
370+
:::warning
371+
A default-deny egress NetworkPolicy is a common cause of backups that appear to start, then stall at the pod discovery, scale-down, or database steps. If RBAC is correct but `exec`/`cp` operations hang or time out, confirm the backup pod can reach the API server first.
372+
:::
373+
343374
### Using an existing ServiceAccount
344375

345376
If your security policy requires using a pre-existing ServiceAccount:

docs/docs-backup/backup/kubernetes-restore.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Before restoring:
2323
- The backup was created from the same Infrahub edition (Community or Enterprise)
2424
- Access to modify Helm values for your Infrahub deployment
2525
- S3 credentials with read access to the backup bucket
26+
- Network egress from the restore pod to the Kubernetes API server (see [Network access to the API server](./kubernetes-backup.mdx#network-access-to-the-api-server))
2627

2728
## Step 1: Identify the backup to restore
2829

@@ -284,6 +285,17 @@ kubectl logs -n infrahub -l app.kubernetes.io/name=infrahub-backup
284285
# - Network policy blocking egress
285286
```
286287

288+
### Restore hangs or times out
289+
290+
If the restore pod starts but stalls at the service-stop, database, or service-start steps, and the logs show no error, the pod may be unable to reach the Kubernetes API server. The restore relies on the API server's `exec` and `cp` subresources, which are blocked by default-deny egress NetworkPolicies even when RBAC is correct.
291+
292+
```bash
293+
# Check whether NetworkPolicies restrict egress in the namespace
294+
kubectl get networkpolicy -n infrahub
295+
```
296+
297+
If a default-deny egress policy is present, add an egress rule allowing the pod to reach the API server. See [Network access to the API server](./kubernetes-backup.mdx#network-access-to-the-api-server).
298+
287299
### Checksum validation fails
288300

289301
The backup file may be corrupted. Try downloading a fresh copy:

0 commit comments

Comments
 (0)