Skip to content

Database

Usage example

Example
apiVersion: aiven.io/v1alpha1
kind: Database
metadata:
  name: my-db
spec:
  authSecretRef:
    name: aiven-token
    key: token

  project: aiven-project-name
  serviceName: my-service

  lcCtype: en_US.UTF-8
  lcCollate: en_US.UTF-8

Info

To create this resource, a Secret containing Aiven token must be created first.

Apply the resource with:

kubectl apply -f example.yaml

Verify the newly created Database:

kubectl get databases my-db

The output is similar to the following:

Name     Project               Service Name    
my-db    aiven-project-name    my-service      

Database

Database is the Schema for the databases API.

Required

  • apiVersion (string). Value aiven.io/v1alpha1.
  • kind (string). Value Database.
  • metadata (object). Data that identifies the object, including a name string and optional namespace.
  • spec (object). DatabaseSpec defines the desired state of Database. See below for nested schema.

spec

Appears on Database.

DatabaseSpec defines the desired state of Database.

Required

  • project (string, Immutable, Pattern: ^[a-zA-Z0-9_-]+$, MaxLength: 63). Identifies the project this resource belongs to.
  • serviceName (string, Immutable, Pattern: ^[a-z][-a-z0-9]+$, MaxLength: 63). Specifies the name of the service that this resource belongs to.

Optional

  • authSecretRef (object). Authentication reference to Aiven token in a secret. See below for nested schema.
  • lcCollate (string, Immutable, MaxLength: 128). Default string sort order (LC_COLLATE) of the database. Default value: en_US.UTF-8.
  • lcCtype (string, Immutable, MaxLength: 128). Default character classification (LC_CTYPE) of the database. Default value: en_US.UTF-8.
  • terminationProtection (boolean). It is a Kubernetes side deletion protections, which prevents the database from being deleted by Kubernetes. It is recommended to enable this for any production databases containing critical data.

authSecretRef

Appears on spec.

Authentication reference to Aiven token in a secret.

Required

  • key (string, MinLength: 1).
  • name (string, MinLength: 1).