fd2a941dd8
CNPG already creates the temporal and temporal_visibility databases via postInitSQL. The auto-setup container doesn't have CREATEDB privilege, so set SKIP_DB_CREATE=true to skip that step. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
99 lines
2.4 KiB
YAML
99 lines
2.4 KiB
YAML
# CNPG PostgreSQL cluster for Temporal persistence
|
|
apiVersion: postgresql.cnpg.io/v1
|
|
kind: Cluster
|
|
metadata:
|
|
name: hightower-temporal-db
|
|
namespace: hightower
|
|
spec:
|
|
instances: 1
|
|
storage:
|
|
size: 5Gi
|
|
storageClass: ceph-block
|
|
bootstrap:
|
|
initdb:
|
|
database: temporal
|
|
owner: temporal
|
|
postInitSQL:
|
|
- CREATE DATABASE temporal_visibility OWNER temporal;
|
|
---
|
|
# Temporal auto-setup — handles schema creation/migration automatically
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: hightower-temporal
|
|
namespace: hightower
|
|
labels:
|
|
app: hightower-temporal
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: hightower-temporal
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: hightower-temporal
|
|
spec:
|
|
containers:
|
|
- name: temporal
|
|
image: temporalio/auto-setup:latest
|
|
ports:
|
|
- containerPort: 7233
|
|
name: grpc
|
|
- containerPort: 8233
|
|
name: web-ui
|
|
env:
|
|
- name: DB
|
|
value: postgres12
|
|
- name: DB_PORT
|
|
value: "5432"
|
|
- name: POSTGRES_SEEDS
|
|
value: hightower-temporal-db-rw
|
|
- name: DBNAME
|
|
value: temporal
|
|
- name: VISIBILITY_DBNAME
|
|
value: temporal_visibility
|
|
- name: POSTGRES_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: hightower-temporal-db-app
|
|
key: username
|
|
- name: POSTGRES_PWD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: hightower-temporal-db-app
|
|
key: password
|
|
- name: NUM_HISTORY_SHARDS
|
|
value: "4"
|
|
- name: SKIP_DB_CREATE
|
|
value: "true"
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: 7233
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 15
|
|
resources:
|
|
requests:
|
|
memory: 512Mi
|
|
cpu: 250m
|
|
limits:
|
|
memory: 1Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: hightower-temporal
|
|
namespace: hightower
|
|
spec:
|
|
selector:
|
|
app: hightower-temporal
|
|
ports:
|
|
- name: grpc
|
|
port: 7233
|
|
targetPort: 7233
|
|
- name: web-ui
|
|
port: 8233
|
|
targetPort: 8233
|