The Postgres CR deploys a production-ready PostgreSQL instance using the Bitnami chart, with support for standalone and replication architectures.
- MTO Dependencies Operator installed on the cluster
- A namespace for the PostgreSQL deployment
- A StorageClass available in the cluster (or use the default)
apiVersion: dependencies.tenantoperator.stakater.com/v1alpha1
kind: Postgres
metadata:
name: postgres
namespace: postgres-system
spec:
architecture: standalone
auth:
postgresPassword: "change-me"
username: "appuser"
password: "change-me"
database: "appdb"
primary:
persistence:
enabled: true
size: 8GiUse an existing Secret for credentials:
spec:
auth:
existingSecret: my-postgres-secret
secretKeys:
adminPasswordKey: postgres-password
userPasswordKey: passwordEnable replication with read replicas:
spec:
architecture: replication
readReplicas:
replicaCount: 2
persistence:
enabled: true
size: 8GiEnable Prometheus metrics exporter:
spec:
metrics:
enabled: true
serviceMonitor:
enabled: truekubectl get pods -n postgres-system -l app.kubernetes.io/name=postgresql
kubectl get postgres -n postgres-system