Temporal auto-setup and temporal server

Hi,

We are trying to deploy temporal-server image in our production deployment. But for schema initialization and default namespace, we are still dependent on temporal auto-setup. Our deployment is helm chart based.

I wanted to check what is the recommended way to initialize schema and namespace for temporal server container?

I wonder why temporal server does not come with an optional step to initialize these basic infrastructure for it to run.

Thanks,

Anurag.

Hi,

I wanted to check what is the recommended way to initialize schema and namespace for temporal server container?

Depending on the database, you can use one of these tools

here is some related documentation as well https://docs.temporal.io/self-hosted-guide/upgrade-server

For namespace creation, you can use temporal cli (temporal operator namespace create …) or the temporalio/admin-tools image which contains temporal cli.

Antonio

If I’m understanding that correctly, the concept then would be to build and run temporal-sql-tool from some management station, outside of the Kubernetes cluster, to initialize a database (postgres, in our case) for temporal.

The directions we had been looking involved building temporal-sql-tool to run in a container, and either use a temporal-sql-tool image or a modified version of auto-setup image to run as a Kubernetes job with an on-install and/or pre-upgrade hook.

The complication of using the out-of-box auto-setup image for this is that the auto-setup image never terminates - after running the database and schema setup, it immediately starts running a temporal server, so we have some difficulty detecting in Kubernetes that the setup portion is finished.

I’ve been reading through the documentation and the forum here, but I haven’t found examples of using a Kubernetes job to perform initial setup followed by a normal long-running image of the temporal server - were we looking at the wrong approach there, are new temporal databases generally configured from ‘outside’ of the k8s cluster?

Hi,

Let me know if this helps GitHub - temporalio/helm-charts: Temporal Helm charts

You should be able to run temporal-sql-tool from https://hub.docker.com/r/temporalio/admin-tools

Antonio