Skip to content

Commit 40cedca

Browse files
Fix: add 3.3.0 docs
1 parent 26389e6 commit 40cedca

114 files changed

Lines changed: 25034 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

content/versions/v3.3.0/_index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: v3.3.0
3+
description: User guides, deploy docs, references, and deep dives about the
4+
Rhize manufacturing data hub.
5+
cascade:
6+
v: "3.3.0"
7+
---
8+
9+
{{< card-list >}}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Deploy
3+
description: >-
4+
A collection of pages to administrate Rhize: install, upgrade, back up, and more.
5+
weight: 100
6+
icon: server
7+
identifier: deploy
8+
cascade:
9+
icon: server
10+
domain_name: libremfg.ai
11+
brand_name: Libre
12+
application_name: libre
13+
db: libreBaas
14+
pre_reqs: |-
15+
- Optional: [kubectx](https://github.com/ahmetb/kubectx) utilities
16+
- `kubectx` to manage multiple clusters
17+
- `kubens` to switch between and configure namespaces easily
18+
- Optional: the [k8 Lens IDE](https://k8slens.dev), if you prefer to use Kubernetes graphically
19+
k8s_cluster_ns: |-
20+
```bash
21+
## context
22+
kubectl config current-context
23+
## namespace
24+
kubectl get namespace
25+
```
26+
27+
To change the namespace for all subsequent [`kubectl` commands](https://kubernetes.io/docs/reference/kubectl/cheatsheet/) to `libre`, run this command:
28+
29+
```bash
30+
kubectl config set-context --current --namespace=libre
31+
```
32+
33+
---
34+
35+
A collection of pages to administrate Rhize: install, upgrade, back up, and more.
36+
37+
38+
{{< card-list >}}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
date: "2023-09-12T19:35:35+11:00"
3+
title: Back up
4+
description: Guides to back up your data on Rhize
5+
categories: ["how-to"]
6+
weight: 200
7+
cascade:
8+
icon: database
9+
---
10+
11+
Backup is critical to ensure reliability and recovery.
12+
13+
These guides show you how to back up different services and data on Rhize.
14+
They also serve as blueprints for automation.
15+
16+
Your organization must determine how frequently you backup services, and how long you store them for.
17+
The correct practice here is highly contextual,
18+
depending on the size of the data, the importance of the data, and the general regulatory and governance demands of your industry.
19+
20+
21+
{{< card-list >}}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: 'Back up Audit PostgreSQL'
3+
date: '2024-03-26T11:20:56-03:00'
4+
categories: ["how-to"]
5+
description: How to backup Audit PostgreSQL on your Rhize deployment
6+
weight: 300
7+
---
8+
9+
This guide shows you the procedure to backup your Audit PostgreSQL database on your Rhize Kubernetes deployment.
10+
11+
## Prerequisites
12+
13+
Before you start, ensure you have the following:
14+
15+
- A designated backup location, for example `~/rhize-backups/libre-audit`.
16+
- Access to the [Rhize Kubernetes Environment](/deploy/install/setup-kubernetes)
17+
{{% param pre_reqs %}}
18+
19+
20+
Also, before you start, confirm you are in the right context and namespace.
21+
22+
{{% param k8s_cluster_ns %}}
23+
24+
## Steps
25+
26+
To back up Audit PostgreSQL, follow these steps:
27+
28+
1. Check the logs for the Audit pods, either in Lens or with [`kubectl logs`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs).
29+
Ensure there are no errors.
30+
31+
1. Retrieve the Audit user password using the following command:
32+
33+
34+
```bash
35+
kubectl get secret <SECRET-NAME> -o jsonpath="{.data.<SECRET-KEY>}" | base64 --decode
36+
```
37+
38+
1. Execute a command on the Audit Postgres pod to perform a full backup:
39+
40+
```bash
41+
kubectl exec -i audit-postgres-0 -- pg_dumpall -U <DB_USER> | gzip > audit-postgres-backup-$(date +"%Y%m%dT%I%M%p").sql.gz
42+
```
43+
44+
On success, the backup creates a GZIP file, `audit-postgres-backup-YYYYMMDDTHHMMSS.sql.gz`.
45+
To check that the backup succeeded, unzip the files and inspect the data.
46+
47+
## Next Steps
48+
49+
- To back up other Rhize services, read how to backup:
50+
- [Keycloak]({{< relref "keycloak" >}}).
51+
- [Grafana]({{< relref "grafana" >}}).
52+
- [The Graph Database]({{< relref "graphdb" >}}).
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: 'Back up the Graph DB to S3'
3+
date: '2024-11-04T11:01:46-03:00'
4+
categories: ["how-to"]
5+
description: How to back up the Rhize graph database to Amazon S3 storage.
6+
weight: 100
7+
---
8+
9+
This guide shows you how to back up the Rhize Graph database to Amazon S3 and S3-compatible storage.
10+
11+
## Prerequisites
12+
13+
Before you start, ensure you have the following:
14+
15+
16+
- A designated S3 backup location, for example `s3://s3.<AWS-REGION>.amazonaws.com/<AWS-BUCKET-NAME>`.
17+
- Access to your [Rhize Kubernetes Environment]({{< relref "../install" >}})
18+
{{% param pre_reqs %}}.
19+
20+
21+
Before you start, confirm you are in the right context and namespace:
22+
23+
{{% param "k8s_cluster_ns" %}}
24+
25+
## Steps
26+
27+
To back up the database, follow these steps:
28+
29+
1. Check the logs for the alpha and zero pods, either in Lens or with [`kubectl logs`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs).
30+
Ensure there are no errors.
31+
32+
```bash
33+
kubectl logs {{< param application_name >}}-baas-baas-alpha-0 --tail=80
34+
```
35+
1. Set the following environmental variables:
36+
- `AWS_ACCESS_KEY_ID`. Your AWS access key with permissions to write to the destination bucket
37+
- `AWS_SECRET_ACCESS_KEY`. Your AWS access key with permissions to write to the destination bucket
38+
- `AWS_SESSION_TOKEN`. Your AWS session token (if required)
39+
40+
1. Make a POST request to your Keycloak `/token` endpoint to get an `access_token` value.
41+
For example, with `curl` and `jq`:
42+
43+
```bash
44+
## replace USERNAME and PASSWORD with your credentials
45+
USERNAME=backups@libremfg.com \
46+
&& PASSWORD=password \
47+
&& curl --location \
48+
--request POST "${BAAS_OIDC_URL}/realms/libre/protocol/openid-connect/token" \
49+
--header 'Content-Type\ application/x-www-form-urlencoded' \
50+
--data-urlencode 'grant_type=password' \
51+
--data-urlencode "username=<USERNAME>" \
52+
--data-urlencode "password=<PASSWORD>" \
53+
--data-urlencode "client_id=<BASS_CLIENT_ID>" \
54+
--data-urlencode "client_secret=<BASS_CLIENT_SECRET>" | jq .access_token
55+
```
56+
57+
1. Using the token from the previous step, send a POST to `<alpha service>:8080/admin` to create a backup of the node to your S3 bucket.
58+
For example, with `curl`:
59+
60+
```bash
61+
curl --location 'http://alpha:8080/admin' \
62+
--header 'Content-Type: application/json' \
63+
--header 'Authorization: Bearer <TOKEN>' \
64+
--data '{"query":"mutation {\n backup(input: {destination: \"s3://s3.<AWS-REGION>.amazonaws.com/<AWS-BUCKET-NAME>\"}) {\n response {\n message\n code\n }\n taskId\n }\n}","variables":{}}'
65+
```
66+
67+
1. List available backups to confirm your backup succeeded:
68+
69+
```bash
70+
curl --location 'http://alpha:8080/admin' \
71+
--header 'Content-Type: application/json' \
72+
--header 'Authorization: Bearer <TOKEN>' \
73+
--data '{"query":"query backup {\n\tlistBackups(input: {location: \"s3://s3.<AWS-REGION>>.amazonaws.com/<AWS-BUCKET-NAME>\"}) {\n\t\tbackupId\n\t\tbackupNum\n\t\tpath\n\t\tsince\n\t\ttype\n\t}\n}","variables":{}}'
74+
```
75+
76+
## Next Steps
77+
78+
- Test the [Restore Graph Database From S3]({{< relref "../restore/binary" >}}) procedure to ensure you can recover data from Amazon S3 in case of an emergency.
79+
- To back up other Rhize services, read how to backup [Grafana]({{< relref "grafana" >}}).
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
title: 'Back up Grafana'
3+
date: '2023-10-18T11:01:56-03:00'
4+
categories: ["how-to"]
5+
description: How to backup Grafana on your Rhize deployment
6+
weight: 300
7+
---
8+
9+
This guide shows you the procedure to back up Grafana on your Rhize Kubernetes deployment.
10+
For general instructions, refer to the official [Back up Grafana](https://grafana.com/docs/grafana/latest/administration/back-up-grafana/) documentation.
11+
12+
## Prerequisites
13+
14+
Before you start, ensure you have the following:
15+
16+
- A designated backup location, for example `~/rhize-backups/grafana`.
17+
- Access to the [Rhize Kubernetes Environment](/deploy/install/setup-kubernetes)
18+
{{% param pre_reqs %}}
19+
20+
21+
Also, before you start, confirm you are in the right context and namespace.
22+
23+
{{% param k8s_cluster_ns %}}
24+
25+
## Steps
26+
27+
To back up the Grafana, follow these steps:
28+
29+
1. Check the logs for the Grafana pods, either in Lens or with [`kubectl logs`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs).
30+
Ensure there are no errors.
31+
32+
1. Open a pod shell for one of the Grafana pods:
33+
34+
```bash
35+
kubectl exec --stdin --tty <GRAFANA_POD_NAME> -- /bin/bash
36+
```
37+
38+
For details, read the Kubernetes topic [Get Shell to a Running Container](https://kubernetes.io/docs/tasks/debug/debug-application/get-shell-running-container/).
39+
40+
1. Use `tar` to backup the Grafana data and `conf` directories:
41+
42+
```bash
43+
## Data Directory Backup Command
44+
tar -v -c -f /home/grafana/grafana-data-$(date +"%Y-%m-%dT%H.%M.%S").tar.gz /var/lib/grafana
45+
## Conf Directory Backup Command
46+
tar -v -c -f /home/grafana/grafana-conf-$(date +"%Y-%m-%dT%H.%M.%S").tar.gz /usr/share/grafana/conf
47+
```
48+
49+
1. Change to the backup directory. For example:
50+
51+
```bash
52+
cd /home/grafana/
53+
```
54+
55+
1. Check for the latest `.gz` files (for example, with `ls -lt`).
56+
There should be new backup `data` and `conf` files whose names include timestamps from when you ran the preceding `tar` commands.
57+
58+
1. Create a checksum file for the latest backups:
59+
60+
```bash
61+
sha256sum <LATEST_DATA_FILE>.tar.gz <LATEST_CONF_FILE>.tar.gz > backup.sums
62+
```
63+
64+
65+
1. Exit the container shell, and then copy files out of the container to your backup location:
66+
67+
```bash
68+
## exit shell
69+
exit
70+
## copy container files to backup
71+
kubectl cp <GRAFANA_POD>:/home/grafana/<NEW_DATA_BACKUP_FILENAME> \
72+
./<NEW_DATA_BACKUP_FILENAME> -c grafana
73+
74+
kubectl cp <GRAFANA_POD>:/home/grafana/<NEW_CONF_BACKUP_FILENAME> \
75+
./<NEW_CONF_BACKUP_FILENAME> -c grafana
76+
kubectl cp <GRAFANA_POD>:/home/grafana/backup.sums \
77+
./backup.sums -c grafana
78+
```
79+
80+
## Confirm success
81+
82+
83+
To confirm the backup, check their sha256 sums and their content.
84+
85+
To check the sums:
86+
87+
1. Change to the directory where you sent the backups:
88+
89+
```bash
90+
cd <BACKUP>/<ON_YOUR_DEVICE>/
91+
```
92+
93+
1. Confirm the checksums match:
94+
95+
```bash
96+
sha256sum -c backup.sums \
97+
<LATEST_DATA_FILE>.tar.gz <LATEST_CONF_FILE>.tar.gz
98+
```
99+
100+
To check that the content is correct, unzip the files and inspect the data.
101+
102+
## Next steps
103+
104+
- Test the [Restore Grafana]({{< relref "../restore" >}}) procedure to ensure you can recover data in case of an emergency.
105+
- To back up other Rhize services, read how to backup [the Graph Database]({{< relref "graphdb" >}}).

0 commit comments

Comments
 (0)