Skip to content

Commit 992da20

Browse files
author
Simon Emms
committed
[kots]: enable use of a local registry
This will enable use of Replicated's airgapped functionality
1 parent 95ebdd8 commit 992da20

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

install/kots/manifests/gitpod-installer-job.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
containers:
2525
- name: installer
2626
# This will normally be the release tag - using this tag as need the license evaluator
27-
image: 'eu.gcr.io/gitpod-core-dev/build/installer:sje-installer-mini-config.0'
27+
image: 'eu.gcr.io/gitpod-core-dev/build/installer:sje-airgapped.0'
2828
volumeMounts:
2929
- mountPath: /config-patch
3030
name: config-patch
@@ -90,7 +90,18 @@ spec:
9090
yq e -i ".database.external.certificate.name = \"database\"" "${CONFIG_FILE}"
9191
fi
9292
93-
if [ '{{repl ConfigOptionEquals "reg_incluster" "0" }}' = "true" ];
93+
if [ '{{repl HasLocalRegistry }}' = "true" ];
94+
then
95+
echo "Gitpod: configuring mirrored container registry"
96+
97+
yq e -i ".containerRegistry.inCluster = false" "${CONFIG_FILE}"
98+
yq e -i ".containerRegistry.external.url = \"{{repl LocalRegistryAddress }}\"" "${CONFIG_FILE}"
99+
yq e -i ".containerRegistry.external.certificate.kind = \"secret\"" "${CONFIG_FILE}"
100+
yq e -i ".containerRegistry.external.certificate.name = \"{{repl ImagePullSecretName }}\"" "${CONFIG_FILE}"
101+
yq e -i ".repository = \"{{repl LocalRegistryAddress }}\"" "${CONFIG_FILE}"
102+
yq e -i ".imagePullSecrets[0].kind = \"secret\"" "${CONFIG_FILE}"
103+
yq e -i ".imagePullSecrets[0].name = \"{{repl ImagePullSecretName }}\"" "${CONFIG_FILE}"
104+
elif [ '{{repl ConfigOptionEquals "reg_incluster" "0" }}' = "true" ];
94105
then
95106
echo "Gitpod: configuring external container registry"
96107
@@ -99,7 +110,7 @@ spec:
99110
yq e -i ".containerRegistry.external.certificate.kind = \"secret\"" "${CONFIG_FILE}"
100111
yq e -i ".containerRegistry.external.certificate.name = \"container-registry\"" "${CONFIG_FILE}"
101112
102-
if [ '{{repl ConfigOptionEquals "reg_s3storage" "1" }}' = "true" ];
113+
if [ '{{repl ConfigOptionEquals "reg_s3storage" "1" }}' = "true" ];
103114
then
104115
echo "Gitpod: configuring container registry S3 backend"
105116

install/kots/manifests/gitpod-registry-secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ kind: Secret
66
metadata:
77
name: container-registry
88
annotations:
9-
kots.io/when: '{{repl ConfigOptionEquals "reg_incluster" "0" }}'
9+
kots.io/when: '{{repl and (eq HasLocalRegistry false) (ConfigOptionEquals "reg_incluster" "0") }}'
1010
type: kubernetes.io/dockerconfigjson
1111
data:
1212
.dockerconfigjson: '{{repl printf "{\"auths\": {\"%s\": {\"username\": \"%s\", \"password\": %s, \"auth\": \"%s\"}}}" (ConfigOption "reg_server" | default (ConfigOption "reg_url")) (ConfigOption "reg_username") (ConfigOption "reg_password" | toJson) (printf "%s:%s" (ConfigOption "reg_username") (ConfigOption "reg_password") | Base64Encode) | Base64Encode }}'

0 commit comments

Comments
 (0)