Skip to main content
This contains a sample Kubernetes manifest file for setting up a periodic task to run Xata Clone.

Kubernetes spec

Setting up the tasks

Create a dedicated namespace for the task (if you’d like, you can also use an existing one):

Step 1: Create secret

The task requires several env variables. Assuming you have the xata CLI already configured on your computer, you can create a secret with all the relevant information like this:
The above assumes branch name is main and the database name is postgres, but you should adjust to your case.

Step 2: Create task

Assuming you saved the spec file above as xata-clone-crontask.yaml, you can create it with:

Step 3: Test the task

Create a test job manually based on the task:
And watch the logs:
If there are any errors, you can delete the whole task (kubectl delete -f xata-clone-crontask.yaml), fix the issue, and repeat Step 2.