Customize Your Site—Custom Configuration of Deploy
Prerequisites
- A Digital.ai Deploy installation on a Kubernetes cluster
kubectl
connected to the cluster- Deploy operator: 23.3 or above
Configuration Central Configuration Pod
Overview
Deploy configuration is based on the central configuration server that is the provider of the configuration for the Deploy master and worker. The centralConfiguration folder on the central configuration server is the directory from where it is serving the configuration files. The files are generated in the centralConfiguration folder from the central-conf directory, in that directory are configuration templates. During startup, the templates are processed and replacing the configuration files in the centralConfiguration folder only if the file is not existing.
Starting with version 24.1, the centralConfiguration and conf folders are not mounted with PV, preventing manual file storage or modifications.
Generic update of the files that have template
It is possible to update other text files that are provided in the application directory.
Here is an example of how to do for the central-conf
files:
- deploy-caches.yaml.template
- deploy-cluster.yaml.template
- deploy-metrics.yaml.template
- deploy-oidc.yaml.template
- deploy-plugins.yaml.template
- deploy-reporting.yaml.template
- deploy-repository.yaml.template
- deploy-satellite.yaml.template
- deploy-secret-complexity.yaml.template
- deploy-server.yaml.template
- deploy-task.yaml.template
- logback.xml
or default-conf
files:
- boot.conf.cloud.template
- boot.conf.template
- deployit.conf.template
- jmx-exporter.yaml
- logback-access.xml
- logback.xml
- logging.properties
- wrapper-daemon.vm
- xlc-wrapper.conf.common
- xlc-wrapper.conf.posix
- xlc-wrapper.conf.win
For example:
- Define the file you will update:
export FILE_TO_UPDATE=deploy-task.yaml.template
export TEMPLATE_DIR=central-conf
export TARGET_DIR=centralConfiguration
export TARGET_FILE=deploy-task.yaml
- Download the latest template configuration file:
kubectl cp -c deploy \
digitalai/dai-xld-digitalai-deploy-cc-server-0:$TEMPLATE_DIR/$FILE_TO_UPDATE \
$FILE_TO_UPDATE
- Update the downloaded template file
vi $FILE_TO_UPDATE
- Create a kubectl patch file
c=$(cat $FILE_TO_UPDATE) \
contentPath=".spec.centralConfiguration.extraConfiguration.${TEMPLATE_DIR}_${FILE_TO_UPDATE//./-}.content" \
f="${TEMPLATE_DIR}/$FILE_TO_UPDATE" \
filePath=".spec.centralConfiguration.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 deploy \
digitalai/dai-xld-digitalai-deploy-cc-server-0:$TARGET_DIR/$FILE_TO_UPDATE \
backup/$FILE_TO_UPDATE
- Delete the configuration file from the pod, so the next time it can be recreated:
Note: This step is only necessary if you have the target folder mounted as a persistent volume. Starting from version 24.1, this is no longer the default option.
kubectl exec -c deploy -it sts/dai-xld-digitalai-deploy-cc-server -n digitalai \
-- rm $TARGET_DIR/$FILE_TO_UPDATE
- Update the configuration on the Deploy Central Configuration pods:
kubectl patch -n digitalai digitalaideploys.xld.digital.ai dai-xld \
--type=merge --patch-file $FILE_TO_UPDATE.patch.yaml
- Restart Deploy pods:
kubectl delete sts dai-xld-digitalai-deploy-master -n digitalai
kubectl delete sts dai-xld-digitalai-deploy-worker -n digitalai
Validate changes:
- CR yaml will have a new section under extraConfiguration key.
kubectl get Digitalaideploys dai-xld -o yaml -n digitalai
The restarted pod process will be using the new configuration:
kubectl exec -it sts/dai-xld-digitalai-deploy-cc-server -n digitalai \
-- cat /opt/xebialabs/central-configuration-server/$TARGET_DIR/$FILE_TO_UPDATE
:::note
In case of the templates:
:::
* `central-conf/deploy-server.yaml.template`
* `central-conf/deploy-oidc.yaml.template` already exist in the `configuration` under keys respectively:
* `central-conf_deploy-server-yaml-template`
* `central-conf_deploy-oidc-yaml-template`
So that files use following patch files:
- for
central-conf/deploy-server.yaml.template
c=$(cat deploy-server.yaml.template) \
yq -n '.spec.configuration.central-conf_deploy-server-yaml-template.content = strenv(c)' \
> "deploy-server.yaml.template.patch.yaml"
- for
central-conf/deploy-oidc.yaml.template
c=$(cat deploy-oidc.yaml.template) \
yq -n '.spec.configuration.central-conf_deploy-oidc-yaml-template.content = strenv(c)' \
> "deploy-oidc.yaml.template.patch.yaml"
Update the type-defaults.properties
To update type-defaults.properties, make the changes on the central configuration server. The file will then be distributed to masters and workers, similar to how other configuration files created as templates in the central-conf folder are handled. Since there is no preexisting type-defaults.properties file in the central-conf folder, you do not need to download it. Simply add the following change in the CR:
spec:
centralConfiguration:
extraConfiguration:
central-conf_type-defaults:
content: |
aws.Cloud.allowConcurrentDeployments=true
aws.api.Method.integrationType=AWS
mode: 432
path: central-conf/type-defaults.properties
You must add configurations that are different from the default value. The size limit is around 1MB.
Configuration Master Pod
Deploy Master local part of configuration is based on the conf directory in the Deploy master folder. The conf folder on the Deploy master server is the directory from where the Deploy master is reading local 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.
For example:
- Define the file you will update:
export FILE_TO_UPDATE=xld-wrapper.conf.common
export TEMPLATE_DIR=default-conf
export TARGET_DIR=conf
export TARGET_FILE=xld-wrapper.conf.common
- Download the latest template configuration file:
kubectl cp -c deploy-master \
digitalai/dai-xld-digitalai-deploy-master-0:$TEMPLATE_DIR/$FILE_TO_UPDATE \
$FILE_TO_UPDATE
- Update the downloaded template file
vi $FILE_TO_UPDATE
- Create a kubectl patch file
c=$(cat $FILE_TO_UPDATE) \
contentPath=".spec.master.extraConfiguration.${TEMPLATE_DIR}_${FILE_TO_UPDATE//./-}.content" \
f="${TEMPLATE_DIR}/$FILE_TO_UPDATE" \
filePath=".spec.master.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 deploy-master \
digitalai/dai-xld-digitalai-deploy-master-0:$TARGET_DIR/$FILE_TO_UPDATE \
backup/$FILE_TO_UPDATE
- Delete the configuration file from the pod, so the next time it can be recreated:
Note: This step is only necessary if you have the target folder mounted as a persistent volume. Starting from version 24.1, this is no longer the default option.
kubectl exec -c deploy-master -it sts/dai-xld-digitalai-deploy-master -n digitalai \
-- rm $TARGET_DIR/$FILE_TO_UPDATE
- Update the configuration on the Deploy Central Configuration pods:
kubectl patch -n digitalai digitalaideploys.xld.digital.ai dai-xld \
--type=merge --patch-file $FILE_TO_UPDATE.patch.yaml
- Restart Deploy pods:
kubectl delete sts dai-xld-digitalai-deploy-master -n digitalai
kubectl delete sts dai-xld-digitalai-deploy-worker -n digitalai
Configuration Worker Pod
Deploy Worker local part of configuration is based on the conf directory in the Deploy worker folder, in the same way as on Master.
For example:
- Define the file you will update:
export FILE_TO_UPDATE=xld-wrapper.conf.common
export TEMPLATE_DIR=default-conf
export TARGET_DIR=conf
export TARGET_FILE=xld-wrapper.conf.common
- Download the latest template configuration file:
kubectl cp -c deploy-worker \
digitalai/dai-xld-digitalai-deploy-worker-0:$TEMPLATE_DIR/$FILE_TO_UPDATE \
$FILE_TO_UPDATE
- Update the downloaded template file
vi $FILE_TO_UPDATE
- Create a kubectl patch file
c=$(cat $FILE_TO_UPDATE) \
contentPath=".spec.worker.extraConfiguration.${TEMPLATE_DIR}_${FILE_TO_UPDATE//./-}.content" \
f="${TEMPLATE_DIR}/$FILE_TO_UPDATE" \
filePath=".spec.worker.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 deploy-worker \
digitalai/dai-xld-digitalai-deploy-worker-0:$TARGET_DIR/$FILE_TO_UPDATE \
backup/$FILE_TO_UPDATE
- Delete the configuration file from the pod, so the next time it can be recreated:
Note: This step is only necessary if you have the target folder mounted as a persistent volume. Starting from version 24.1, this is no longer the default option.
kubectl exec -c deploy-worker -it sts/dai-xld-digitalai-deploy-worker -n digitalai \
-- rm $TARGET_DIR/$FILE_TO_UPDATE
- Update the configuration on the Deploy Central Configuration pods:
kubectl patch -n digitalai digitalaideploys.xld.digital.ai dai-xld \
--type=merge --patch-file $FILE_TO_UPDATE.patch.yaml
- Restart Deploy pods:
kubectl delete sts dai-xld-digitalai-deploy-worker -n digitalai