Customize Your Site—Custom Configuration of Release
Prerequisites
- A Digital.ai Release installation on a kubernetes cluster
kubectl
connected to the cluster- Release operator: 23.3 or above
Overview
Release configuration is based on the conf directory in the Release folder.
The conf folder on the Release server is the directory from where the Release is reading configuration.
The files are generated in the conf folder from the default-conf directory, in that directory are configuration templates.
During startup, the templates are processed and replacing the configuration files in the conf folder only if the file is not existing.
The xl-release.conf
is exception it is replaced always.
Steps
- Download the latest template configuration file that exists on your Release pod that is running. For example, find this file at
/opt/xebialabs/xl-release-server/default-conf/xl-release.conf.template
.
kubectl cp -c release \
digitalai/dai-xlr-digitalai-release-0:default-conf/xl-release.conf.template \
xl-release.conf.template
- Update the custom resource (CR) file or the CR on the cluster.
Update the downloaded template file
vi xl-release.conf.template
Create a kubectl patch file
c=$(cat xl-release.conf.template) \
yq -n '.spec.configuration.default-conf_xl-release-conf-template.content = strenv(c)' \
> xl-release-conf-patch.yaml
Backup old file from the pod from the conf directory
kubectl cp -c release \
digitalai/dai-xlr-digitalai-release-0:conf/xl-release.conf
backup/xl-release.conf
Update the configuration on the Release pods
kubectl patch -n digitalai digitalaireleases.xlr.digital.ai dai-xlr \
--type=merge --patch-file xl-release-conf-patch.yaml
- The Release pods will restart automatically.
Generic update of the files that have default-conf template
In a similar way, it is possible to update other text files that are provided in the application directory, for example:
- boot.conf.cloud.template
- jmx-exporter.yaml
- logback-access.xm
- logback.xml
- logging.properties
- script.policy
- script.policy.template
- wrapper-daemon.vm
- xl-release-security.xml
- xl-release-server.conf.template
- xl-release.conf.template
- xl-release.policy
- xlr-wrapper-linux.conf
- xlr-wrapper-win.conf
- Define the file you will update, for example
xlr-wrapper-linux.conf
.
export FILE_TO_UPDATE=xlr-wrapper-linux.conf
export TEMPLATE_DIR=default-conf
export TARGET_DIR=conf
export TARGET_FILE=xlr-wrapper-linux.conf
- Download the latest template configuration file.
kubectl cp -c release \
digitalai/dai-xlr-digitalai-release-0:$TEMPLATE_DIR/$FILE_TO_UPDATE \
$FILE_TO_UPDATE
- Update the custom resource (CR) file or the CR on the cluster.
Update the downloaded template file
vi $FILE_TO_UPDATE
Create a kubectl patch file
c=$(cat $FILE_TO_UPDATE) \
contentPath=".spec.extraConfiguration.${TEMPLATE_DIR}_${FILE_TO_UPDATE//./-}.content" \
f="${TEMPLATE_DIR}/$FILE_TO_UPDATE" \
filePath=".spec.extraConfiguration.${TEMPLATE_DIR}_${FILE_TO_UPDATE//./-}.path" \
yq -n 'eval(strenv(contentPath)) = strenv(c) | eval(strenv(filePath)) = strenv(f)' \
> "$FILE_TO_UPDATE.patch.yaml"
Backup old file from the pod from the $TARGET_DIR
directory
kubectl cp -c release \
digitalai/dai-xlr-digitalai-release-0:$TARGET_DIR/$TARGET_FILE \
backup/$TARGET_FILE
Delete the configuration file from the pod, so the next time it can be recreated
kubectl exec -c release -it sts/dai-xlr-digitalai-release -n digitalai \
-- rm $TARGET_DIR/$TARGET_FILE
Update the configuration on the Release pods
kubectl patch -n digitalai digitalaireleases.xlr.digital.ai dai-xlr \
--type=merge --patch-file $FILE_TO_UPDATE.patch.yaml
- The Release pods will restart automatically after the update.
Note: The new configuration will be applied after the next operator reconciliation cycle. It can take up to
1
minute to apply the new configuration, and start the rollout restart of the Release pods.