Skip to main content
Version: Deploy 24.1

Mounting Persistent Volumes for Digital.ai Deploy

This topic illustrates how to set up the persistent volumes on the Deploy containers.

There are two ways to setup the persistent volumes:

  1. If the mounted folder needs to go in the existing volume on Deploy pod: data-dir, in that case you can use master.persistence.paths or worker.persistence.paths.
  2. If you have some other volume, for example, in case of log directory, in that case you can define new volume with centralConfiguration.extraVolumes, or master.extraVolumes, or worker.extraVolumes; and use centralConfiguration.extraVolumeMounts, or use worker.extraVolumeMounts, or use master.extraVolumeMounts to mount it to specific directory.

Using master.persistence.paths or worker.persistence.paths

To update current persistence paths, use the master.persistence.paths value in the CR to add additional paths. Check the current value to ensure that you are adding the new path in the list:

kubectl get Digitalaideploys dai-xld -n digitalai -o jsonpath='{.spec.master.persistence.paths}'

If the response is empty, it indicates that the default value is being used. For 24.1 version, it is: [/opt/xebialabs/xl-deploy-server/work].

To update the value, in this case, we are adding the log directory:

cat << EOF >> persistence-paths-patch.yaml
spec:
persistence:
paths:
- /opt/xebialabs/xl-deploy-server/work
- /opt/xebialabs/xl-deploy-server/log
EOF

Update the paths configuration on the Deploy:

kubectl patch -n digitalai Digitalaideploys dai-xld \
--type=merge --patch-file persistence-paths-patch.yaml

The Deploy master pods will not automatically restart after CR change, you need to restart it:

kubectl delete sts dai-xld-digitalai-deploy-master -n digitalai

After that, if you check, the list of volumeMounts on the master pod will have additional dir. For example:

     volumeMounts:
- ...
- mountPath: /opt/xebialabs/xl-deploy-server/work
name: data-dir
subPath: work
- mountPath: /opt/xebialabs/xl-deploy-server/log
name: data-dir
subPath: log
- ...

The worker setup is similar to the master setup.

Using centralConfiguration.extraVolumes, or master.extraVolumes, or worker.extraVolumes; and centralConfiguration.extraVolumeMounts, or worker.extraVolumeMounts, or master.extraVolumeMounts

To create new volume on the Deploy pod, you can use extraVolumes and extraVolumeMounts to mount it. For example to mount the log directory, here is an example for central configuration:

cat << EOF >> persistence-volumes-patch.yaml
spec:
centralConfiguration:
extraVolumeMounts:
- name: logs
mountPath: /opt/xebialabs/central-configuration-server/log
extraVolumes:
- name: logs
emptyDir: {}
EOF

Update the volume configuration on the Deploy:

kubectl patch -n digitalai Digitalaideploys dai-xld \
--type=merge --patch-file persistence-volumes-patch.yaml

The Deploy central configuration will automatically restart in this case (only master and worker are not restarting automatically). If you check on the pod the list of volumeMounts will have additional dir. For example:

  containers:
volumeMounts:
- ...
- mountPath: /opt/xebialabs/central-configuration-server/log
name: logs
- ...

volumes:
- ...
- name: logs │
emptyDir: {}
- ...