Skip to content

Commit 9d440c1

Browse files
committed
docs: round-3 howto improvements
- create-clone: add --branch, protection lease duration, --extra-config examples - destroy-clone: add --async example, update protection note for leases - delete-snapshot: add --force CLI example - logical-full-refresh: add CLI/API trigger method (DLE 4.0+) - engine-secure: add cross-link to Teleport integration - teleport-integration: add missing sections (user role, volume mounting, Docker networking), fix prerequisite numbering - rds-refresh: add 12 missing config fields (parameterGroup, optionGroup, storageType, IAM auth, etc.) https://claude.ai/code/session_011sPDgBjzL2N2X6jiYyoTjQ
1 parent 24afe24 commit 9d440c1

File tree

7 files changed

+121
-6
lines changed

7 files changed

+121
-6
lines changed

docs/dblab-howtos/administration/data/rds-refresh.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,24 @@ docker run --rm \
7676
| `source.dbName` | Yes | Database name |
7777
| `source.username` | Yes | Database user |
7878
| `source.password` | Yes | Password (supports `${ENV_VAR}` syntax) |
79+
| `source.snapshotIdentifier` | No | Specific snapshot ID to use; if empty, uses latest automated snapshot |
7980
| `clone.instanceClass` | Yes | RDS clone instance type (e.g., `db.t3.medium`) |
8081
| `clone.securityGroups` | No | Security groups allowing DBLab access |
8182
| `clone.subnetGroup` | No | DB subnet group |
83+
| `clone.parameterGroup` | No | RDS parameter group name |
84+
| `clone.optionGroup` | No | RDS option group name (RDS instances only) |
85+
| `clone.clusterParameterGroup` | No | Cluster parameter group (Aurora only) |
86+
| `clone.publiclyAccessible` | No | Make clone publicly accessible (default: `false`) |
87+
| `clone.enableIAMAuth` | No | Enable IAM database authentication (default: `false`) |
88+
| `clone.storageType` | No | Storage type: `gp2`, `gp3`, `io1`, `io2` |
89+
| `clone.deletionProtection` | No | Enable deletion protection on clone (default: `false`) |
90+
| `clone.port` | No | Custom port for the clone (default: RDS default) |
91+
| `clone.tags` | No | Additional tags (key-value map) for the RDS clone |
8292
| `clone.maxAge` | No | Max age before clone is considered stale (default: `48h`) |
8393
| `dblab.apiEndpoint` | Yes | DBLab API URL |
8494
| `dblab.token` | Yes | DBLab verification token |
95+
| `dblab.insecure` | No | Skip TLS certificate verification (default: `false`) |
96+
| `dblab.pollInterval` | No | Status polling interval (default: `30s`) |
8597
| `dblab.timeout` | No | Max refresh wait (default: `4h`) |
8698
| `aws.region` | Yes | AWS region |
8799

docs/dblab-howtos/administration/engine-secure.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ PGPASSWORD=secret_password psql \
4949
```
5050

5151
Adjust the port numbers accordingly for other clones, following the pattern `original_port+3000` (e.g., `6001->9001`, `6002->9002`, etc.).
52+
53+
## Alternative: Teleport integration
54+
55+
For zero-trust access control with audit logging, certificate-based authentication, and role-based access, consider using [Teleport integration](/docs/dblab-howtos/administration/teleport-integration) (DBLab Engine 4.1+).

docs/dblab-howtos/administration/logical-full-refresh.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,29 @@ Note, that the process described here requires a maintenance window (brief perio
1111

1212
If you are using the "physical" provisioning mode, read [how to configure the "sync" instance](/docs/dblab-howtos/administration/postgresql-configuration#the-sync-instance) instead.
1313

14-
## Refresh data from source
14+
## Triggering a full refresh via CLI or API (DBLab Engine 4.0+)
15+
16+
If you have multiple pools (disks) configured, you can trigger a full refresh without downtime using the CLI or API. DBLab Engine will refresh data on an inactive pool while clones continue to run on the active pool.
17+
18+
**CLI:**
19+
```bash
20+
dblab instance full-refresh
21+
```
22+
23+
**API:**
24+
```bash
25+
curl -X POST -H "Verification-Token: YOUR_TOKEN" http://localhost:2345/full-refresh
26+
```
27+
28+
:::tip
29+
A scheduled full refresh can also be configured using the `retrieval.refresh.timetable` option in `server.yml` (crontab format).
30+
:::
31+
32+
## Manual refresh (single disk)
33+
34+
The process described below requires a maintenance window and deletes existing clones.
35+
36+
### Refresh data from source
1537
### 1. Cleanup
1638
Stop and remove the existing containers, then clean up the data directory and destroy the pool:
1739
```bash

docs/dblab-howtos/administration/teleport-integration.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,24 @@ db_service:
9090
dblab: "true"
9191
```
9292

93-
### 4. SSL/TLS for Postgres clones
93+
### 4. User role for database access
94+
95+
Teleport users who need to connect to DBLab clones need a role granting database access:
96+
97+
```yaml
98+
kind: role
99+
version: v7
100+
metadata:
101+
name: dblab-user
102+
spec:
103+
allow:
104+
db_labels:
105+
dblab: "true"
106+
db_names: ['*']
107+
db_users: ['*']
108+
```
109+
110+
### 5. SSL/TLS for Postgres clones
94111

95112
Teleport always initiates TLS to backend databases. DBLab clones must have SSL enabled.
96113

@@ -111,7 +128,7 @@ tctl auth export --type=db-client > /etc/dblab/certs/teleport-ca.crt
111128
chown 999:999 /etc/dblab/certs/teleport-ca.crt
112129
```
113130

114-
### 5. pg_hba.conf — certificate authentication
131+
### 6. pg_hba.conf — certificate authentication
115132

116133
Starting with DBLab Engine 4.1, the default `pg_hba.conf` includes a `hostssl ... cert` rule that enables Teleport certificate authentication out of the box:
117134

@@ -123,6 +140,29 @@ host all all 0.0.0.0/0 md5
123140

124141
No custom `pg_hba.conf` or volume mount is required for Teleport.
125142

143+
### 7. Volume mounting for certs
144+
145+
Clone containers only inherit DBLab Engine container volumes whose source is under `poolManager.mountDir`. For SSL certs stored outside the pool, use `containerConfig`:
146+
147+
```yaml
148+
databaseContainer: &db_container
149+
dockerImage: "postgresai/extended-postgres:16"
150+
containerConfig:
151+
"shm-size": 1gb
152+
volume: "/etc/dblab/certs:/var/lib/postgresql/cert:ro"
153+
```
154+
155+
Cert files on the host must have uid 999 ownership before DBLab Engine starts, because the postgres user inside the container runs as uid 999.
156+
157+
### 8. Webhook URL — Docker networking
158+
159+
DBLab Engine runs inside Docker, so `localhost:9876` from within the Engine container resolves to the container itself, not the host.
160+
161+
Options:
162+
- Use `host.docker.internal:9876` (Docker Desktop / Docker 20.10+)
163+
- Use the Docker bridge IP (typically `172.17.0.1:9876`)
164+
- Run the sidecar in the same Docker network as DBLab Engine
165+
126166
## Configuration
127167

128168
### DBLab Engine server.yml

docs/dblab-howtos/cloning/create-clone.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,34 @@ $ dblab clone create --username USERNAME --password PASSWORD --id CLONE_ID --sna
9494
}
9595
```
9696

97+
### Create a clone from a branch
98+
:::note
99+
Requires DBLab 4.0 or higher
100+
:::
101+
102+
Create a clone from a specific branch:
103+
```bash
104+
$ dblab clone create --username USERNAME --password PASSWORD --id CLONE_ID --branch main
105+
```
106+
97107
### Protected status
98-
You can make clone protected during the creation or later (if needed). Please be careful: abandoned protected clones may cause out-of-disk-space events. Read the details [here](/docs/dblab-howtos/cloning/clone-protection).
108+
You can make a clone protected during creation or later. Please be careful: abandoned protected clones may cause out-of-disk-space events. Read the details [here](/docs/dblab-howtos/cloning/clone-protection).
109+
110+
Protect with default lease duration:
99111
```bash
100-
$ dblab clone create --username USERNAME --password PASSWORD --id CLONE_ID --protected
112+
$ dblab clone create --username USERNAME --password PASSWORD --id CLONE_ID --protected true
113+
```
114+
115+
Protect for a specific duration (e.g., 8 hours = 480 minutes):
116+
```bash
117+
$ dblab clone create --username USERNAME --password PASSWORD --id CLONE_ID --protected 480
101118
```
102119

103120
```json
104121
{
105122
"id": "democlone",
106123
"protected": true,
124+
"protectedTill": "2026-04-11T06:00:00Z",
107125
"status": {
108126
"code": "OK",
109127
"message": "Clone is ready to accept Postgres connections."
@@ -112,6 +130,12 @@ $ dblab clone create --username USERNAME --password PASSWORD --id CLONE_ID --pro
112130
}
113131
```
114132

133+
### Extra PostgreSQL configuration
134+
You can set additional PostgreSQL configuration parameters for a clone:
135+
```bash
136+
$ dblab clone create --username USERNAME --password PASSWORD --id CLONE_ID --extra-config statement_timeout='30s'
137+
```
138+
115139
## Related
116140
- Guide: [Connect to a clone](/docs/dblab-howtos/cloning/connect-clone)
117141
- Guide: [Destroy a clone](/docs/dblab-howtos/cloning/destroy-clone)

docs/dblab-howtos/cloning/destroy-clone.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DBLab Engine automatically deletes idle unprotected clones after the idle interv
88
:::
99

1010
:::info
11-
The protected clone could not be deleted automatically or manually. In order to delete the clone, you would need to [unprotect it](/docs/dblab-howtos/cloning/clone-protection).
11+
A protected clone cannot be deleted automatically or manually. To delete it, first [remove protection](/docs/dblab-howtos/cloning/clone-protection). With protection leases (DBLab Engine 4.1+), protection expires automatically after the configured duration.
1212
:::
1313

1414
## GUI
@@ -31,6 +31,12 @@ dblab clone destroy CLONE_ID
3131
The clone has been successfully destroyed: CLONE_ID
3232
```
3333

34+
### Destroy a clone asynchronously
35+
For long-running operations, use the `--async` flag:
36+
```bash
37+
dblab clone destroy --async CLONE_ID
38+
```
39+
3440
## Related
3541
- Guide: [Clone protection from manual and automatic deletion](/docs/dblab-howtos/cloning/clone-protection)
3642
- Guide: [Resetting a clone state](/docs/dblab-howtos/cloning/reset-clone)

docs/dblab-howtos/snapshots/delete-snapshot.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,12 @@ Delete a snapshot with `dblab snapshot` command, using subcommand `delete`.
3333
$ dblab snapshot delete SNAPSHOT_ID
3434
```
3535

36+
### Force-delete a snapshot with dependent clones
37+
If the snapshot has dependent clones or datasets, use `--force`:
38+
39+
```bash
40+
$ dblab snapshot delete --force SNAPSHOT_ID
41+
```
42+
3643
## Related
3744
- Guide: [Create a snapshot](/docs/dblab-howtos/snapshots/create-snapshot)

0 commit comments

Comments
 (0)