Skip to main content
Version: Release 24.3

Mounting Persistent Volumes for Digital.ai Release

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

There are two ways to setup the persistent volumes:

  1. If the mounted folder needs to go in the existing volume on release pod: data, in that case you can use 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 extraVolumes and use extraVolumeMounts to mount it to specific directory.

Using persistence.paths

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

kubectl get Digitalaireleases dai-xlr -n digitalai -o jsonpath='{.spec.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-release-server/reports].

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-release-server/reports
- /opt/xebialabs/xl-release-server/log
EOF

Update the paths configuration on the Release:

kubectl patch -n digitalai Digitalaireleases dai-xlr \
--type=merge --patch-file persistence-paths-patch.yaml

The Release pod will automatically restart after some time. Now, if you check on the pod the list of volumeMounts will have additional dir. For example:

     volumeMounts:
- ...
- mountPath: /opt/xebialabs/xl-release-server/reports
name: data
subPath: reports
- mountPath: /opt/xebialabs/xl-release-server/log
name: data
subPath: log
- ...

Using extraVolumes and extraVolumeMounts

To create new volume on the Release pod, you can use extraVolumes and extraVolumeMounts to mount it. For example to mount the log directory:

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

Update the volume configuration on the Release:

kubectl patch -n digitalai Digitalaireleases dai-xlr \
--type=merge --patch-file persistence-volumes-patch.yaml

The Release pod will automatically restart after some time. Now, if you check on the pod the list of volumeMounts will have additional dir. Ffor example:

  containers:
volumeMounts:
- ...
- mountPath: /opt/xebialabs/xl-release-server/log
name: logs
- ...

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