Temporal Operations
Operational guide for Temporal workflow orchestration in the fzymgc-house cluster.
Quick Reference
Section titled “Quick Reference”| Property | Value |
|---|---|
| Web UI | https://temporal.fzymgc.house |
| Frontend Service | temporal-frontend.temporal.svc.cluster.local:7233 |
| Namespace | temporal |
| Auth Method | Forward-Auth (shared oauth2-proxy, Keycloak-backed — group temporal-users, ADR hl-1fia) |
| Workers Repo | fzymgc-house/temporal-workers |
| Vault Path | secret/fzymgc-house/cluster/temporal/* |
Architecture
Section titled “Architecture”Two-Database Design
Section titled “Two-Database Design”Temporal uses two separate PostgreSQL databases on the CNPG main cluster:
| Database | Purpose | Schema Version |
|---|---|---|
temporal | Default store (workflow state, history) | v1.18+ |
temporal_visibility | Visibility store (workflow search/listing) | v1.9+ |
This separation prevents schema version collisions—each store has its own schema_version table.
Components
Section titled “Components”| Component | Replicas | Purpose |
|---|---|---|
temporal-frontend | 1 | API gateway, client connections |
temporal-history | 1 | Workflow state management |
temporal-matching | 1 | Task queue routing |
temporal-worker | 1 | Internal workflows (archival, replication) |
temporal-web | 1 | Web UI |
temporal-admintools | 1 | CLI tools (tctl, temporal) |
Worker Deployment
Section titled “Worker Deployment”Workers run via the Temporal Worker Controller, which manages TemporalWorkerDeployment CRDs for rainbow deployments (progressive rollout).
┌─────────────────────────────────────────────────────────────┐│ Temporal Server ││ ┌──────────┐ ┌─────────┐ ┌──────────┐ ┌────────┐ ││ │ Frontend │ │ History │ │ Matching │ │ Worker │ ││ └────┬─────┘ └────┬────┘ └────┬─────┘ └────────┘ ││ │ │ │ ││ └────────────┴───────────┘ ││ │ ││ ┌───────┴───────┐ ││ │ PostgreSQL │ ││ │ temporal │ ││ │ temporal_vis │ ││ └───────────────┘ │└─────────────────────────────────────────────────────────────┘ │ ┌────────────┼────────────┐ ▼ ▼ ▼ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ Worker │ │ Worker │ │ Worker │ │ (core) │ │ (v2) │ │ (v3) │ └─────────┘ └─────────┘ └─────────┘ Rainbow Deployment (Worker Controller)Common Operations
Section titled “Common Operations”Access Admin Tools
Section titled “Access Admin Tools”# Interactive shellkubectl exec -it -n temporal deploy/temporal-admintools -- bash
# Single commandkubectl exec -n temporal deploy/temporal-admintools -- tctl <command>Namespace Management
Section titled “Namespace Management”# List namespaceskubectl exec -n temporal deploy/temporal-admintools -- \ tctl --ns default namespace list
# Create namespacekubectl exec -n temporal deploy/temporal-admintools -- \ tctl --ns default namespace register --namespace workflows
# Describe namespacekubectl exec -n temporal deploy/temporal-admintools -- \ tctl --ns workflows namespace describeWorkflow Operations
Section titled “Workflow Operations”# List workflowskubectl exec -n temporal deploy/temporal-admintools -- \ tctl --ns workflows workflow list
# Execute workflowkubectl exec -n temporal deploy/temporal-admintools -- \ temporal workflow execute \ --namespace workflows \ --task-queue default \ --type HelloWorkflow \ --input '"World"'
# Get workflow historykubectl exec -n temporal deploy/temporal-admintools -- \ tctl --ns workflows workflow showid <workflow-id>
# Terminate workflowkubectl exec -n temporal deploy/temporal-admintools -- \ tctl --ns workflows workflow terminate --workflow_id <id> --reason "manual termination"Task Queue Status
Section titled “Task Queue Status”# Describe task queue (shows workers)kubectl exec -n temporal deploy/temporal-admintools -- \ tctl --ns workflows taskqueue describe --taskqueue defaultCheck Cluster Health
Section titled “Check Cluster Health”kubectl exec -n temporal deploy/temporal-admintools -- \ tctl cluster healthExpected output: temporal.api.workflowservice.v1.WorkflowService: SERVING
Database Operations
Section titled “Database Operations”Check Schema Versions
Section titled “Check Schema Versions”# Default storekubectl exec -n postgres main-13 -- \ psql -U postgres -d temporal -c "SELECT * FROM schema_version;"
# Visibility storekubectl exec -n postgres main-13 -- \ psql -U postgres -d temporal_visibility -c "SELECT * FROM schema_version;"Verify Tables
Section titled “Verify Tables”# Default store tables (should have ~39 tables)kubectl exec -n postgres main-13 -- \ psql -U postgres -d temporal -c "\dt" | wc -l
# Visibility store tableskubectl exec -n postgres main-13 -- \ psql -U postgres -d temporal_visibility -c "\dt"Expected visibility tables:
executions_visibilityschema_update_historyschema_version
Troubleshooting
Section titled “Troubleshooting”Visibility Store Errors
Section titled “Visibility Store Errors”Error: ListWorkflowExecutions operation failed. Select failed: pq: relation "executions_visibility" does not exist
Cause: Schema migration didn’t run for visibility store. Usually caused by:
- Single-database setup where default store schema version blocked visibility migration
- Schema job not connecting to correct database
Fix:
-
Verify two-database architecture is deployed:
Terminal window kubectl get database -n postgres | grep temporalExpected:
temporalandtemporal-visibility -
Delete and re-sync schema job:
Terminal window kubectl delete job -n temporal -l app.kubernetes.io/component=schemaargocd app sync temporal-server -
Verify visibility tables exist:
Terminal window kubectl exec -n postgres main-13 -- \psql -U postgres -d temporal_visibility -c "\dt"
Worker Not Processing Tasks
Section titled “Worker Not Processing Tasks”Symptoms: Workflows stuck in “Running” state, no progress
Checks:
-
Worker pod running:
Terminal window kubectl get pods -n temporal -l app.kubernetes.io/name=temporal-worker -
Worker connected to task queue:
Terminal window kubectl exec -n temporal deploy/temporal-admintools -- \tctl --ns workflows taskqueue describe --taskqueue default -
Worker logs:
Terminal window kubectl logs -n temporal -l app.kubernetes.io/name=temporal-worker --tail=100
Server Pod CrashLooping
Section titled “Server Pod CrashLooping”Check logs:
kubectl logs -n temporal deploy/temporal-frontend --tail=100kubectl logs -n temporal deploy/temporal-history --tail=100Common causes:
- Database connection issues (check CNPG cluster health)
- Secret not synced (check ExternalSecret status)
- Schema not applied (check schema job completion)
Schema Job Stuck
Section titled “Schema Job Stuck”Check job status:
kubectl get jobs -n temporalkubectl describe job temporal-schema-1 -n temporalCheck init container logs:
kubectl logs -n temporal job/temporal-schema-1 -c setup-default-storekubectl logs -n temporal job/temporal-schema-1 -c setup-visibility-storeIf job is immutable and needs recreation:
kubectl delete job temporal-schema-1 -n temporalargocd app sync temporal-serverSecrets
Section titled “Secrets”Vault Paths
Section titled “Vault Paths”| Path | Contents |
|---|---|
fzymgc-house/cluster/postgres/users/main-temporal | Database credentials |
fzymgc-house/cluster/temporal/* | Worker secrets |
Kubernetes Secrets
Section titled “Kubernetes Secrets”| Secret | Namespace | Source |
|---|---|---|
temporal-db-secret | temporal | ExternalSecret → Vault |
temporal-worker-secrets | temporal | ExternalSecret → Vault |