Skip to content

Commit 71fdba3

Browse files
committed
docs: backup and restore diode/hydra secrets
1 parent b950873 commit 71fdba3

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/netbox-enterprise/nbe-backups.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,31 @@ Save it somewhere safe for future restores.
128128

129129
For more details on backing up NetBox databases, see [the official NetBox documentation](https://netboxlabs.com/docs/netbox/en/stable/administration/replicating-netbox/).
130130

131+
#### Diode and Hydra Secrets (NetBox 1.10 and Up)
132+
133+
To ensure that Diode OAuth login information is not lost, you will also need to save the Diode and Hydra secrets from the cluster.
134+
135+
Run this set of commands:
136+
137+
```shell
138+
NETBOX_NAMESPACE="kotsadm" && \
139+
kubectl get secrets \
140+
--namespace "${NETBOX_NAMESPACE}" \
141+
--no-headers \
142+
--output name \
143+
| grep secret/diode \
144+
| while read -r SECRET; do \
145+
echo "---" && \
146+
kubectl apply view-last-applied \
147+
"${SECRET}" \
148+
--namespace "${NETBOX_NAMESPACE}" \
149+
-o yaml; \
150+
done \
151+
> netbox-enterprise-diode-secrets.yaml
152+
```
153+
154+
Save it alongside your `netbox-enterprise.pgsql` for future restores.
155+
131156
### Restoring Your Backups
132157

133158
Restoring is almost as simple as backing up.
@@ -172,6 +197,17 @@ cat netbox-data.tar.gz | kubectl exec ${NETBOX_RESTORE_POD} \
172197
-C /opt/netbox/netbox
173198
```
174199

200+
#### Diode and Hydra Secrets (NetBox 1.10 and Up)
201+
202+
To restore from a secrets yaml file, pass it to `kubectl apply` like so:
203+
204+
```shell
205+
NETBOX_NAMESPACE="kotsadm" && \
206+
kubectl apply \
207+
--namespace "${NETBOX_NAMESPACE}" \
208+
--filename netbox-enterprise-diode-secrets.yaml
209+
```
210+
175211
#### Built-In PostgreSQL
176212

177213
To restore from a dump file, pipe the `netbox-enterprise.pgsql` created during backup into `psql` in the PostgreSQL pod:

0 commit comments

Comments
 (0)