2f1674ced9
Single container that auto-creates and migrates the schema against CNPG PostgreSQL. Built-in Web UI on 8233. No separate schema job, ConfigMap, or UI deployment needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
97 lines
2.3 KiB
YAML
97 lines
2.3 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"
|
|
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
|