Skip to content

Commit 4fe4f74

Browse files
Pothulapatiroboquat
authored andcommitted
kots: Support s3 backend with incluster registry
Currently, There seems to be a configuration issue, around s3 backend, and docker registry. The s3 option is available when `incluster` is disabled, which is confusing as s3 backend is supported when `incluster` registry is enabled. This PR fixes that by having this configured correctly. Signed-off-by: Tarun Pothulapati <[email protected]>
1 parent ca76283 commit 4fe4f74

File tree

3 files changed

+39
-34
lines changed

3 files changed

+39
-34
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ spec:
139139
yq e -i ".containerRegistry.external.url = \"{{repl ConfigOption "reg_url" }}\"" "${CONFIG_FILE}"
140140
yq e -i ".containerRegistry.external.certificate.kind = \"secret\"" "${CONFIG_FILE}"
141141
yq e -i ".containerRegistry.external.certificate.name = \"container-registry\"" "${CONFIG_FILE}"
142-
143-
if [ '{{repl ConfigOptionEquals "reg_s3storage" "1" }}' = "true" ];
142+
else
143+
if [ '{{repl ConfigOptionEquals "reg_incluster_storage" "s3" }}' = "true" ];
144144
then
145145
echo "Gitpod: configuring container registry S3 backend"
146146
147-
yq e -i ".containerRegistry.s3storage.bucket = \"{{repl ConfigOption "reg_bucketname" }}\"" "${CONFIG_FILE}"
147+
yq e -i ".containerRegistry.s3storage.bucket = \"{{repl ConfigOption "reg_incluster_storage_s3_bucketname" }}\"" "${CONFIG_FILE}"
148148
yq e -i ".containerRegistry.s3storage.certificate.kind = \"secret\"" "${CONFIG_FILE}"
149149
yq e -i ".containerRegistry.s3storage.certificate.name = \"container-registry-s3-backend\"" "${CONFIG_FILE}"
150150
fi

install/kots/manifests/gitpod-registry-s3-backend.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
app: gitpod
1010
component: gitpod-installer
1111
annotations:
12-
kots.io/when: '{{repl and (ConfigOptionEquals "reg_incluster" "0") (ConfigOptionEquals "reg_s3storage" "1") }}'
12+
kots.io/when: '{{repl and (ConfigOptionEquals "reg_incluster" "0") (ConfigOptionEquals "reg_incluster_storage" "s3") }}'
1313
data:
14-
s3AccessKey: '{{repl ConfigOption "reg_accesskey" | Base64Encode }}'
15-
s3SecretKey: '{{repl ConfigOption "reg_secretkey" | Base64Encode }}'
14+
s3AccessKey: '{{repl ConfigOption "reg_incluster_storage_s3_accesskey" | Base64Encode }}'
15+
s3SecretKey: '{{repl ConfigOption "reg_incluster_storage_s3_secretkey" | Base64Encode }}'

install/kots/manifests/kots-config.yaml

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,39 @@ spec:
3333
help_text: You may either use an in-cluster container registry or configure your own external container registry for better performance. This container registry must be accessible from your Kubernetes cluster.
3434
recommended: false
3535

36+
- name: reg_incluster_storage
37+
title: In-cluster Storage provider
38+
type: select_one
39+
when: '{{repl (ConfigOptionEquals "reg_incluster" "1") }}'
40+
default: none
41+
help_text: You may configure your Docker registry to use an external storage backend. This setting is recommended for AWS users instead of using Elastic Container Registry.
42+
items:
43+
- name: none
44+
title: None
45+
- name: s3
46+
title: S3
47+
48+
- name: reg_incluster_storage_s3_bucketname
49+
title: S3 bucket name
50+
type: text
51+
required: true
52+
when: '{{repl (ConfigOptionEquals "reg_incluster_storage" "s3") }}'
53+
help_text: The name of the bucket to act as your S3 storage backend.
54+
55+
- name: reg_incluster_storage_s3_accesskey
56+
title: S3 access key
57+
type: text
58+
required: true
59+
when: '{{repl (ConfigOptionEquals "reg_incluster_storage" "s3") }}'
60+
help_text: The access key to use for authentication of your S3 storage backend.
61+
62+
- name: reg_incluster_storage_s3_secretkey
63+
title: S3 secret key
64+
type: password
65+
when: '{{repl (ConfigOptionEquals "reg_incluster_storage" "s3") }}'
66+
required: true
67+
help_text: The secret key to use for authentication of your S3 storage backend.
68+
3669
- name: reg_url
3770
title: Container registry URL
3871
type: text
@@ -60,34 +93,6 @@ spec:
6093
required: true
6194
help_text: The password for your container registry.
6295

63-
- name: reg_s3storage
64-
title: Use S3 storage for your container registry
65-
type: bool
66-
default: "0"
67-
when: '{{repl and (eq HasLocalRegistry false) (ConfigOptionEquals "reg_incluster" "0") }}'
68-
help_text: If using AWS as your container registry, you must configure an S3 storage backend.
69-
70-
- name: reg_bucketname
71-
title: S3 bucket name
72-
type: text
73-
when: '{{repl and (eq HasLocalRegistry false) (ConfigOptionEquals "reg_incluster" "0") (ConfigOptionEquals "reg_s3storage" "1") }}'
74-
required: true
75-
help_text: The name of the bucket to act as your S3 storage backend.
76-
77-
- name: reg_accesskey
78-
title: S3 access key
79-
type: text
80-
when: '{{repl and (eq HasLocalRegistry false) (ConfigOptionEquals "reg_incluster" "0") (ConfigOptionEquals "reg_s3storage" "1") }}'
81-
required: true
82-
help_text: The access key to use for authentication of your S3 storage backend.
83-
84-
- name: reg_secretkey
85-
title: S3 secret key
86-
type: password
87-
when: '{{repl and (eq HasLocalRegistry false) (ConfigOptionEquals "reg_incluster" "0") (ConfigOptionEquals "reg_s3storage" "1") }}'
88-
required: true
89-
help_text: The secret key to use for authentication of your S3 storage backend.
90-
9196
- name: database
9297
title: Database
9398
description: Gitpod requires an instance of MySQL 5.7 for data storage. This can either be an in-cluster or external database.

0 commit comments

Comments
 (0)