Database
The technical documentation of the database microservice,
which stores the data of the application.
2 minute read
Kubernetes resources
- StatefulSet:
united-manufacturing-hub-timescaledb
- Service:
- Internal ClusterIP for the replicas:
united-manufacturing-hub-replica
at port 5432 - Internal ClusterIP for the config:
united-manufacturing-hub-config
at port 8008 - External LoadBalancer:
united-manufacturing-hub
at port 5432
- Internal ClusterIP for the replicas:
- ConfigMap:
- Patroni:
united-manufacturing-hub-timescaledb-patroni
- Post init:
timescale-post-init
- Postgres BackRest:
united-manufacturing-hub-timescaledb-pgbackrest
- Scripts:
united-manufacturing-hub-timescaledb-scripts
- Patroni:
- Secret:
- Certificate:
united-manufacturing-hub-certificate
- Patroni credentials:
united-manufacturing-hub-credentials
- Users passwords:
timescale-post-init-pw
- Certificate:
- PersistentVolumeClaim:
- Data:
storage-volume-united-manufacturing-hub-timescaledb-0
- WAL-E:
wal-volume-united-manufacturing-hub-timescaledb-0
- Data:
Configuration
There is only one parameter that usually needs to be changed: the password used
to connect to the database. To do so, set the value of the db_password
key in
the _000_commonConfig.datastorage
section of the Helm chart values file.
Environment variables
Variable name | Description | Type | Allowed values | Default |
---|---|---|---|---|
BOOTSTRAP_FROM_BACKUP | Whether to bootstrap the database from a backup or not. | int | 0, 1 | 0 |
PATRONI_KUBERNETES_LABELS | The labels to use to find the pods of the StatefulSet. | string | Any | {app: united-manufacturing-hub-timescaledb, cluster-name: united-manufacturing-hub, release: united-manufacturing-hub} |
PATRONI_KUBERNETES_NAMESPACE | The namespace in which the StatefulSet is deployed. | string | Any | united-manufacturing-hub |
PATRONI_KUBERNETES_POD_IP | The IP address of the pod. | string | Any | Random IP |
PATRONI_KUBERNETES_PORTS | The ports to use to connect to the pods. | string | Any | [{"name": "postgresql", "port": 5432}] |
PATRONI_NAME | The name of the pod. | string | Any | united-manufacturing-hub-timescaledb-0 |
PATRONI_POSTGRESQL_CONNECT_ADDRESS | The address to use to connect to the database. | string | Any | $(PATRONI_KUBERNETES_POD_IP):5432 |
PATRONI_POSTGRESQL_DATA_DIR | The directory where the database data is stored. | string | Any | /var/lib/postgresql/data |
PATRONI_REPLICATION_PASSWORD | The password to use to connect to the database as a replica. | string | Any | Random 16 characters |
PATRONI_REPLICATION_USERNAME | The username to use to connect to the database as a replica. | string | Any | standby |
PATRONI_RESTAPI_CONNECT_ADDRESS | The address to use to connect to the REST API. | string | Any | $(PATRONI_KUBERNETES_POD_IP):8008 |
PATRONI_SCOPE | The name of the cluster. | string | Any | united-manufacturing-hub |
PATRONI_SUPERUSER_PASSWORD | The password to use to connect to the database as the superuser. | string | Any | Random 16 characters |
PATRONI_admin_OPTIONS | The options to use for the admin user. | string | Comma separated list of options | createrole,createdb |
PATRONI_admin_PASSWORD | The password to use to connect to the database as the admin user. | string | Any | Random 16 characters |
PGBACKREST_CONFIG | The path to the configuration file for Postgres BackRest. | string | Any | /etc/pgbackrest/pgbackrest.conf |
PGDATA | The directory where the database data is stored. | string | Any | $(PATRONI_POSTGRESQL_DATA_DIR) |
PGHOST | The directory of the runnning database | string | Any | /var/run/postgresql |
Last modified December 6, 2024: Merge pull request #310 from united-manufacturing-hub/whats-new-moved-to-discord (ea93c6b)