Skip to content

[kots]: apply customization file to Installer #10911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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