Resources / Database
Database
A PostgreSQL-compatible database on a VPC, one primary and up to four read replicas, with every byte in Etorm storage. It accepts connections once its engine is available on the platform; until then it stays Pending with reason EngineNotAvailable. The password is shown once, when the database is created.
Overview
| API | database.etorm.com/v1alpha1 |
| Resource | databases (cluster-scoped inside its cluster) |
| Short names | db |
| Available in | project clusters only |
| Status | written by a controller through /status |
Minimal example
apiVersion: database.etorm.com/v1alpha1
kind: Database
metadata:
name: example
spec:
vpcRef:
name: "<name>"
Spec
| Field | Type | Required | Default | Allowed | Description |
|---|---|---|---|---|---|
version | string (one of) | "16" | 16 | The PostgreSQL version the database speaks. | |
vpcRef | reference to VPC | yes | The VPC the database's addresses are on. Cannot be changed. | ||
instances | integer | 1 | 1 to 5 | How many instances: one primary that accepts writes and the rest read replicas. | |
user | string | up to 63 characters | The user created with the database, its owner. Defaults to app. Cannot be changed. | ||
databaseName | string | up to 63 characters | The name of the database inside. Defaults to the name of this object. Cannot be changed. | ||
passwordGeneration | integer | at least 0 | Raise it to set a new password for the user: the new password is shown once, in the response to that change, and the old one stops working. It cannot be lowered. | ||
monitoringRef | reference to MonitoringWorkspace | Optional MonitoringWorkspace to export query latency, connections, and LSM stats to. | |||
resources | object | {} | What each instance may use. | ||
resources.memoryPower | integer | 6 | 0 to 10 | Memory per instance: 64 KiB times two to this power (6 is 4 MiB, 10 is 64 MiB). | |
resources.cpuMillicores | integer | 250 | 1 to 1000 | Processor time per instance on average, in thousandths of a core. |
Status
| Field | Type | Required | Default | Allowed | Description |
|---|---|---|---|---|---|
phase | string | Pending, Ready, Degraded (the primary is up, a replica is not) or Failed. | |||
primary | object | Where to connect for reads and writes. | |||
primary.address | string | Its IPv6 address on the VPC. | |||
primary.port | integer | The PostgreSQL port, 5432. | |||
replicas | list of object | Where to connect for reads only. | |||
replicas[].address | string | Its IPv6 address on the VPC. | |||
replicas[].port | integer | The PostgreSQL port, 5432. | |||
epoch | integer | Increases every time a new primary takes over. | |||
usage | object | What it has used, as billed (spec 0006): CPU time and the bytes it holds now. | |||
usage.cpuSeconds | number | CPU time used since `since`, for queries and housekeeping, in seconds. | |||
usage.storageBytes | integer | Bytes it holds now (billed as GiB-seconds while they are held). | |||
usage.since | string | When metering started (RFC 3339). | |||
usage.fuelTotal | integer | Internal: all fuel counted so far (2 000 000 000 per CPU-second). | |||
usage.fuelSeen | object | Internal: the last fuel count seen per instance. | |||
primaryOrdinal | integer | Which instance is the primary (0 to instances - 1); it changes when the primary fails and a replica takes over. | |||
passwordVerifier | string | The salted verifier of the user's password (SCRAM-SHA-256), never the password. | |||
password | string | The user's password: present only in the response that created the database, never stored. | |||
conditions | list of object | Detailed state, one entry per aspect; Ready says whether the database accepts connections. | |||
conditions[].type | string | Aspect. | |||
conditions[].status | string | True or False. | |||
conditions[].reason | string | Machine-readable reason. | |||
conditions[].message | string | Human-readable detail. |
Columns in listings
| Column | From |
|---|---|
| Version | .spec.version |
| Instances | .spec.instances |
| Primary | .status.primary.address |
| Phase | .status.phase |
| Detail | .status.conditions[0].message |