From f791db5e64ba388c8d85430c3e8818dd84bc4095 Mon Sep 17 00:00:00 2001 From: Simon Emms Date: Wed, 7 Sep 2022 10:13:06 +0000 Subject: [PATCH] [kots]: add proxy server configuration --- install/installer/scripts/kots-install.sh | 4 ++++ .../manifests/gitpod-http-proxy-settings.yaml | 15 +++++++++++++++ install/kots/manifests/gitpod-installer-job.yaml | 2 +- install/kots/manifests/kots-preflight.yaml | 7 +++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 install/kots/manifests/gitpod-http-proxy-settings.yaml diff --git a/install/installer/scripts/kots-install.sh b/install/installer/scripts/kots-install.sh index 88b3a68647c6fb..9de31e2fe0b850 100755 --- a/install/installer/scripts/kots-install.sh +++ b/install/installer/scripts/kots-install.sh @@ -76,6 +76,10 @@ yq e -i ".domain = \"${DOMAIN}\"" "${CONFIG_FILE}" yq e -i '.license.kind = "secret"' "${CONFIG_FILE}" yq e -i '.license.name = "gitpod-license"' "${CONFIG_FILE}" +echo "Gitpod: Inject the HTTP_PROXY settings secret" +yq e -i '.httpProxy.kind = "secret"' "${CONFIG_FILE}" +yq e -i '.httpProxy.name = "http-proxy-settings"' "${CONFIG_FILE}" + if [ "${OPEN_VSX_URL}" != "" ]; then echo "Gitpod: Setting Open VSX Registry URL" diff --git a/install/kots/manifests/gitpod-http-proxy-settings.yaml b/install/kots/manifests/gitpod-http-proxy-settings.yaml new file mode 100644 index 00000000000000..292068154e504b --- /dev/null +++ b/install/kots/manifests/gitpod-http-proxy-settings.yaml @@ -0,0 +1,15 @@ +# Copyright (c) 2022 Gitpod GmbH. All rights reserved. +# Licensed under the MIT License. See License-MIT.txt in the project root for license information. + +apiVersion: v1 +kind: Secret +metadata: + name: http-proxy-settings + labels: + app: gitpod + component: gitpod-installer +type: Opaque +data: + httpProxy: repl{{ HTTPProxy | Base64Encode | quote }} + httpsProxy: repl{{ HTTPSProxy | Base64Encode | quote }} + noProxy: repl{{ printf "kotsadm,.%s,%s" (ConfigOption "domain") (NoProxy) | Base64Encode | quote }} diff --git a/install/kots/manifests/gitpod-installer-job.yaml b/install/kots/manifests/gitpod-installer-job.yaml index 0fe7a5629d946c..daee886cb8e434 100644 --- a/install/kots/manifests/gitpod-installer-job.yaml +++ b/install/kots/manifests/gitpod-installer-job.yaml @@ -39,7 +39,7 @@ spec: containers: - name: installer # This will normally be the release tag - image: "eu.gcr.io/gitpod-core-dev/build/installer:sje-move-kots-bash-script.28" + image: "eu.gcr.io/gitpod-core-dev/build/installer:sje-installer-proxy-config.23" volumeMounts: - mountPath: /config-patch name: config-patch diff --git a/install/kots/manifests/kots-preflight.yaml b/install/kots/manifests/kots-preflight.yaml index dc350d44af5771..d6e78afbf786b6 100644 --- a/install/kots/manifests/kots-preflight.yaml +++ b/install/kots/manifests/kots-preflight.yaml @@ -77,6 +77,13 @@ spec: - | CONNECTION="error" + export http_proxy="{{repl HTTPProxy }}" + export HTTP_PROXY="{{repl HTTPProxy }}" + export https_proxy="{{repl HTTPSProxy }}" + export HTTPS_PROXY="{{repl HTTPSProxy }}" + export no_proxy="{{repl NoProxy }}" + export NO_PROXY="{{repl NoProxy }}" + if [ '{{repl HasLocalRegistry }}' = "true" ]; then # Don't test for airgapped