- API Reference
- Examples
PostgreSQLDatabase
This feature is available for the following tiers: Standard, Premium.
Packages:
database.entigo.com/v1alpha1
Resource Types:
PostgreSQLDatabase
↩ Parent| Name | Type | Description | Required |
|---|---|---|---|
| apiVersion | string | database.entigo.com/v1alpha1 | true |
| kind | string | PostgreSQLDatabase | true |
| metadata | object | Refer to the Kubernetes API documentation for the fields of the metadata field. | true |
| spec | object | false |
PostgreSQLDatabase.spec
↩ Parent| Name | Type | Description | Required |
|---|---|---|---|
| instanceRef | object | true | |
| owner | string | Owner role name (PostgreSQL conventional name) | true |
| dbTemplate | string | The name of the template from which to create the new database | false |
| deletionProtection | boolean | Prevents accidental deletion of PostgreSQLDatabase resource Default: true | false |
| encoding | string | Character set encoding to use in the new database. Specify a string constant (e.g., 'SQL_ASCII'), or an integer encoding number, or DEFAULT to use the default encoding (namely, the encoding of the template database). | false |
| extensionConfig | map[string]object | Per-extension configuration. Key is the extension name, value is a configuration object. | false |
| extensions | []enum | List of PostgreSQL extensions to enable. Enum: postgis, postgis_topology, fuzzystrmatch, postgis_tiger_geocoder, uuid-ossp, btree_gist | false |
| lcCType | string | Character classification (LC_CTYPE) to use in the new database. This affects the categorization of characters, e.g. lower, upper and digit. The default is to use the character classification of the template database. | false |
| lcCollate | string | Collation order (LC_COLLATE) to use in the new database. This affects the sort order applied to strings, e.g. in queries with ORDER BY, as well as the order used in indexes on text columns. The default is to use the collation order of the template database. | false |
| name | string | Alternative, i.e. non kubernetes compliant name | false |
PostgreSQLDatabase.spec.instanceRef
↩ Parent| Name | Type | Description | Required |
|---|---|---|---|
| name | string | Name of the database instance the db should be created in | true |
PostgreSQLDatabase.spec.extensionConfig[key]
↩ Parent| Name | Type | Description | Required |
|---|---|---|---|
| schema | string | Schema in which to create the extension objects | false |
Basic Database
A minimal PostgreSQL Database definition showing the required fields only.
apiVersion: database.entigo.com/v1alpha1
kind: PostgreSQLDatabase
metadata:
name: basic-database
spec:
owner: owner
instanceRef:
name: basic-instance
A PostgreSQL Database definition showing localization and extensions setup.
apiVersion: database.entigo.com/v1alpha1
kind: PostgreSQLDatabase
metadata:
name: database-with-extensions
spec:
owner: owner
encoding: "UTF8"
lcCType: "et_EE.UTF-8"
lcCollate: "et_EE.UTF-8"
dbTemplate: template0
instanceRef:
name: basic-instance
extensions:
- postgis
- postgis_topology
- fuzzystrmatch
- postgis_tiger_geocoder
- uuid-ossp
- btree_gist
extensionConfig:
postgis_topology:
schema: topology
postgis_tiger_geocoder:
schema: tiger
Prerequisites
The PostgreSQL Database requires the following resources applied:
PostgreSQLInstance
apiVersion: database.entigo.com/v1alpha1
kind: PostgreSQLInstance
metadata:
name: basic-instance
spec:
storageGB: 20
version: "17.2"
PostgreSQLUser (Owner Role)
apiVersion: database.entigo.com/v1alpha1
kind: PostgreSQLUser
metadata:
name: owner
spec:
instanceRef:
name: basic-instance
createDb: true
createRole: true