Skip to content

XDatabase

Experimental

This API is experimental and may change without notice.

An Azure PostgreSQL Flexible Server and database with a password supplied by a Kubernetes Secret. An optional skuName overrides compute while size still determines storage; regional SKU support does not guarantee capacity.

API

Property Value
Group azure.platform.example.org
Kind XDatabase
Plural xdatabases
Scope Namespaced
Versions v1alpha1 (referenceable)
Source compositions/apis/azure/postgresql/schema.yaml

Spec

Field Type Required Default Description
adminPasswordSecretRef immutable object yes — Secret in the same namespace holding the administrator password.
    adminPasswordSecretRef.key string yes password —
    adminPasswordSecretRef.name string yes — —
adminUsername string no pgadmin Administrator login name for the server.
allowAzureServices boolean no false Add the 0.0.0.0 firewall rule that permits connections from Azure services.
databaseName string no — Name of the default database created on the server. Defaults to spec.name.
location string no swedencentral Azure region for the database server.
name immutable string yes — Name of the PostgreSQL Flexible Server.
postgresVersion string no 16 PostgreSQL major version. One of: 13, 14, 15, 16.
resourceGroupRef object yes — Resource group hosting the database server.
    resourceGroupRef.name string yes — Logical name of the XResourceGroup.
size string no small T-shirt size: small = B_Standard_B1ms/32GB, medium = GP_Standard_D2s_v3/128GB, large = GP_Standard_D4s_v3/256GB. One of: small, medium, large.
skuName string no `` Optional provider-format compute SKU override, e.g. B_Standard_B2s. Empty uses size. Storage still follows size. Regional support does not guarantee allocation capacity. Constraints: pattern: ^((B|GP|MO)Standard[A-Za-z0-9_]+)?$.

Fields marked immutable are fixed once the resource is created; changing one is rejected by the API server. An immutable object pins the fields nested under it too. To change one, delete the resource and create it again.

Example

Create the referenced XResourceGroup and password Secret before creating the database. The team example is disabled by default in its kustomization.yaml. Set allowAzureServices only when workloads outside a private network need access; it permits connections from Azure service IPs.

---
apiVersion: azure.platform.example.org/v1alpha1
kind: XDatabase
metadata:
  name: dbdemo01
spec:
  name: dbdemo01
  size: small
  skuName: B_Standard_B2s
  resourceGroupRef:
    name: crd-dev-apps
  adminUsername: pgadmin
  adminPasswordSecretRef:
    name: dbdemo01-admin
    key: password

Taken from teams/crd-dev/apps.yaml, which is applied to the cluster by Flux, so it cannot drift from a working manifest.

Status

Populated by Crossplane once the underlying Azure resources exist. Every composite in this repository exposes the provisioned Azure resource ID as status.id.

Field Type Required Default Description
databaseId string no — Azure resource ID of the default database.
fqdn string no — Fully qualified domain name of the server.
id string no — Azure resource ID of the Flexible Server.

Reference