Skip to content

Commit

Permalink
[kots]: apply customization file to Installer
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Emms authored and roboquat committed Jun 27, 2022
1 parent 09dbf29 commit b21e31a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion install/kots/manifests/gitpod-installation-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
containers:
- name: installation-status
# This will normally be the release tag
image: "eu.gcr.io/gitpod-core-dev/build/installer:sje-azure-minio-gateway.0"
image: "eu.gcr.io/gitpod-core-dev/build/installer:sje-kots-customization.1"
command:
- /bin/sh
- -c
Expand Down
14 changes: 13 additions & 1 deletion install/kots/manifests/gitpod-installer-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
containers:
- name: installer
# This will normally be the release tag
image: "eu.gcr.io/gitpod-core-dev/build/installer:sje-azure-minio-gateway.0"
image: "eu.gcr.io/gitpod-core-dev/build/installer:sje-kots-customization.1"
volumeMounts:
- mountPath: /config-patch
name: config-patch
Expand Down Expand Up @@ -261,6 +261,18 @@ spec:
done
fi
if [ '{{repl ConfigOptionEquals "advanced_mode_enabled" "1" }}' = "true" ];
then
if [ '{{repl ConfigOptionNotEquals "customization_patch" "" }}' = "true" ];
then
CUSTOMIZATION='{{repl ConfigOptionData "customization_patch" | Base64Encode }}'
echo "Gitpod: Applying customization patch ${CUSTOMIZATION}"
# Apply the customization property - if something else is set, this will be ignored
yq e -i ".customization = $(echo "${CUSTOMIZATION}" | base64 -d | yq e -o json '.customization' - | jq -rc) // []" "${CONFIG_FILE}"
fi
fi
echo "Gitpod: Patch Gitpod config"
base64 -d "${CONFIG_PATCH_FILE}" > /tmp/patch.yaml
config_patch=$(cat /tmp/patch.yaml)
Expand Down
15 changes: 15 additions & 0 deletions install/kots/manifests/kots-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,21 @@ spec:
default: "0"
help_text: Enables additional customization options. Enable only when you know what you are doing!

- name: customization_patch
title: Gitpod customization patch (YAML file)
type: file
required: false
when: '{{repl ConfigOptionEquals "advanced_mode_enabled" "1" }}'
help_text: |
A file configured to override annotations, labels and environment variables in components. See our
[advanced documentation](https://www.gitpod.io/docs/self-hosted/latest/advanced/customization) for
more details and the format.
Labels are an immutable property in Kubernetes, so you may need to uninstall your Gitpod instance
before applying - run `helm uninstall -n {{repl Namespace }} gitpod`.
**WARNING** this should not be run if using in-cluster database and/or object storage.
- name: config_patch
title: Gitpod config patch (YAML file)
type: file
Expand Down

0 comments on commit b21e31a

Please sign in to comment.