Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 2.64 KB

File metadata and controls

48 lines (36 loc) · 2.64 KB

Schema

The Schema Custom Resource Definition (CRD) is responsible for managing PostgreSQL schemas.

Spec

Field Type Description Required Mutable
clusterRef ResourceRef Reference to the ClusterConnection to use. Yes Yes
database string The name of the database in which the schema is created. Yes No
name string The name of the schema to create. Yes No
owner string The owner of the schema. No Yes
reclaimPolicy string The policy for reclaiming the schema when the CR is deleted. Values: Retain (Default), Delete. No Yes

ResourceRef (clusterRef)

Field Type Description Required
namespace string Namespace of the referenced ClusterConnection. If not specified, uses the owning CR's namespace. No
name string Name of the referenced ClusterConnection. Yes

Reclaim Policy

The reclaimPolicy controls what happens to the PostgreSQL schema when the Custom Resource is deleted from Kubernetes.

  • Retain (Default): The schema remains in the PostgreSQL database. Only the Kubernetes Custom Resource is deleted. This prevents accidental data loss.
  • Delete: The schema is dropped from the PostgreSQL database. Warning: This will permanently delete the schema and all objects (tables, views, etc.) within it.

Example

apiVersion: postgresql.aboutbits.it/v1
kind: Schema
metadata:
  name: my-schema
spec:
  clusterRef:
    name: my-postgres-connection
  database: my_database
  name: my_schema
  owner: my_role
  reclaimPolicy: Retain

Official Documentation