Kubernetes
You could host your own Atuin server using the Kubernetes platform.
Create a secrets.yaml
file for the database credentials:
Create a atuin.yaml
file for the Atuin server:
Finally, you may want to use a separate namespace for atuin, by creating a namespaces.yaml
file:
Note that this configuration will store the database folder outside the kubernetes cluster, in the folder /Users/firstname.lastname/.kube/database
of the host system by configuring the storageClassName
to be manual
. In a real enterprise setup, you would probably want to store the database content permanently in the cluster, and not in the host system.
You should also change the password string in ATUIN_DB_PASSWORD
and ATUIN_DB_URI
in thesecrets.yaml
file to a more secure one.
The atuin service on the port 30530
of the host system. That is configured by the nodePort
property. Kubernetes has a strict rule that you are not allowed to expose a port numbered lower than 30000. To make the clients work, you can simply set the port in in your config.toml
file, e.g. sync_address = "http://192.168.1.10:30530"
.
Deploy the Atuin server using kubectl
:
The sample files above are also in the k8s folder of the atuin repository.
Creating backups of the Postgres database
Now you’re up and running it’s a good time to think about backups.
You can create a CronJob
which uses pg_dump
to create a backup of the database. This example runs weekly and dumps to the local disk on the node.
Configure/update the example yaml
with the following:
- Set a more or less frequent schedule with the
schedule
property. - Replace
/somewhere/on/node/for/database-backups
with a path on your node or reconfigure to use aPersistentVolume
instead ofhostPath
. --format=c
ouputs a format that can be restored withpg_restore
. Useplain
if you want.sql
files outputted instead.