Skip to content

Commit

Permalink
Adds 2nd kube cmd to change database permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
cruse1977 committed Nov 28, 2024
1 parent 9fe6e4b commit 656260f
Show file tree
Hide file tree
Showing 297 changed files with 100,252 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
Loading

0 comments on commit 656260f

Please sign in to comment.