Skip to content

Commit

Permalink
Merge pull request #62 from netboxlabs/additional-postgres-restore
Browse files Browse the repository at this point in the history
Adds additional kubectl command to set database permissions post import
  • Loading branch information
cruse1977 authored Nov 28, 2024
2 parents 9fe6e4b + 6293047 commit 59b267a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/netbox-enterprise/nbe-backups.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,29 @@ cat netbox.pgsql | kubectl exec "${POSTGRESQL_MAIN_POD}" \
-c database \
-- psql -d netbox -f-
```

Following this run the below to ensure all database permissions are correct:

```shell
export NETBOX_NAMESPACE="kotsadm"
POSTGRESQL_MAIN_POD="$(kubectl get pod \
-o name \
-n "${NETBOX_NAMESPACE}" \
-l 'postgres-operator.crunchydata.com/role=master' \
| head -n 1 \
)" && \
kubectl exec "${POSTGRESQL_MAIN_POD}" \
-n "${NETBOX_NAMESPACE}" \
-i \
-c database \
-- psql -c "ALTER DATABASE netbox OWNER TO netbox;" && \
kubectl exec "${POSTGRESQL_MAIN_POD}" \
-n "${NETBOX_NAMESPACE}" \
-i \
-c database \
-- psql -d netbox -c "GRANT CREATE ON SCHEMA public TO netbox;"
```

#### Built-In Redis

Since Redis isn't running in restore mode, there is no need to disable and re-enable append mode.
Expand Down

0 comments on commit 59b267a

Please sign in to comment.