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

APIdatabase.etorm.com/v1alpha1
Resourcedatabases (cluster-scoped inside its cluster)
Short namesdb
Available inproject clusters only
Statuswritten by a controller through /status

Minimal example

apiVersion: database.etorm.com/v1alpha1
kind: Database
metadata:
  name: example
spec:
  vpcRef:
    name: "<name>"

Spec

FieldTypeRequiredDefaultAllowedDescription
versionstring (one of)"16"16The PostgreSQL version the database speaks.
vpcRefreference to VPCyesThe VPC the database's addresses are on. Cannot be changed.
instancesinteger11 to 5How many instances: one primary that accepts writes and the rest read replicas.
userstringup to 63 charactersThe user created with the database, its owner. Defaults to app. Cannot be changed.
databaseNamestringup to 63 charactersThe name of the database inside. Defaults to the name of this object. Cannot be changed.
passwordGenerationintegerat least 0Raise 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.
monitoringRefreference to MonitoringWorkspaceOptional MonitoringWorkspace to export query latency, connections, and LSM stats to.
resourcesobject{}What each instance may use.
resources.memoryPowerinteger60 to 10Memory per instance: 64 KiB times two to this power (6 is 4 MiB, 10 is 64 MiB).
resources.cpuMillicoresinteger2501 to 1000Processor time per instance on average, in thousandths of a core.

Status

FieldTypeRequiredDefaultAllowedDescription
phasestringPending, Ready, Degraded (the primary is up, a replica is not) or Failed.
primaryobjectWhere to connect for reads and writes.
primary.addressstringIts IPv6 address on the VPC.
primary.portintegerThe PostgreSQL port, 5432.
replicaslist of objectWhere to connect for reads only.
replicas[].addressstringIts IPv6 address on the VPC.
replicas[].portintegerThe PostgreSQL port, 5432.
epochintegerIncreases every time a new primary takes over.
usageobjectWhat it has used, as billed (spec 0006): CPU time and the bytes it holds now.
usage.cpuSecondsnumberCPU time used since `since`, for queries and housekeeping, in seconds.
usage.storageBytesintegerBytes it holds now (billed as GiB-seconds while they are held).
usage.sincestringWhen metering started (RFC 3339).
usage.fuelTotalintegerInternal: all fuel counted so far (2 000 000 000 per CPU-second).
usage.fuelSeenobjectInternal: the last fuel count seen per instance.
primaryOrdinalintegerWhich instance is the primary (0 to instances - 1); it changes when the primary fails and a replica takes over.
passwordVerifierstringThe salted verifier of the user's password (SCRAM-SHA-256), never the password.
passwordstringThe user's password: present only in the response that created the database, never stored.
conditionslist of objectDetailed state, one entry per aspect; Ready says whether the database accepts connections.
conditions[].typestringAspect.
conditions[].statusstringTrue or False.
conditions[].reasonstringMachine-readable reason.
conditions[].messagestringHuman-readable detail.

Columns in listings

ColumnFrom
Version.spec.version
Instances.spec.instances
Primary.status.primary.address
Phase.status.phase
Detail.status.conditions[0].message

All resources