Skip to content

Commit e891b32

Browse files
committed
Switch to Gitpod go installer
1 parent 82fc6dd commit e891b32

File tree

2 files changed

+47
-12
lines changed

2 files changed

+47
-12
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GITPOD_VERSION="sje-external-db.2"
1+
ARG GITPOD_VERSION="aledbf-eksinstaller.28"
22

33
FROM eu.gcr.io/gitpod-core-dev/build/installer:$GITPOD_VERSION as installer
44

setup.sh

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -eo pipefail
44

5+
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)
6+
57
function variables_from_context() {
68
# Create EKS cluster without nodes
79
# Generate a new kubeconfig file in the local directory
@@ -139,18 +141,15 @@ function install() {
139141
# Restart tigera-operator
140142
kubectl delete pod -n tigera-operator -l k8s-app=tigera-operator > /dev/null 2>&1
141143

142-
# Create RDS database, S3 bucket for docker-registry and IAM account for gitpod S3 storage
143-
# the cdk application will generates a gitpod-values.yaml file to be used by helm
144-
145144
# TODO: remove once we can reference a secret in the helm chart.
146145
# generated password cannot excede 41 characters (RDS limitation)
147-
SSM_KEY="/gitpod/cluster/${CLUSTER_NAME}/region/${AWS_REGION}"
148-
${AWS_CMD} ssm put-parameter \
149-
--overwrite \
150-
--name "${SSM_KEY}" \
151-
--type String \
152-
--value "$(date +%s | sha256sum | base64 | head -c 35 ; echo)" \
153-
--region "${AWS_REGION}" > /dev/null 2>&1
146+
#SSM_KEY="/gitpod/cluster/${CLUSTER_NAME}/region/${AWS_REGION}"
147+
#${AWS_CMD} ssm put-parameter \
148+
# --overwrite \
149+
# --name "${SSM_KEY}" \
150+
# --type String \
151+
# --value "$(date +%s | sha256sum | base64 | head -c 35 ; echo)" \
152+
# --region "${AWS_REGION}" > /dev/null 2>&1
154153

155154
# deploy CDK stacks
156155
cdk deploy \
@@ -160,10 +159,46 @@ function install() {
160159
--context certificatearn="${CERTIFICATE_ARN}" \
161160
--context identityoidcissuer="$(${AWS_CMD} eks describe-cluster --name "${CLUSTER_NAME}" --query "cluster.identity.oidc.issuer" --output text --region "${AWS_REGION}")" \
162161
--require-approval never \
162+
--outputs-file cdk-outputs.json \
163163
--all
164164

165+
# TLS termination is done in the ALB
166+
cat <<EOF | kubectl apply -f -
167+
apiVersion: cert-manager.io/v1
168+
kind: Certificate
169+
metadata:
170+
name: https-certificates
171+
spec:
172+
dnsNames:
173+
- ${DOMAIN}
174+
- '*.${DOMAIN}'
175+
- '*.ws.${DOMAIN}'
176+
duration: 4380h0m0s
177+
issuerRef:
178+
group: cert-manager.io
179+
kind: Issuer
180+
name: ca-issuer
181+
secretName: https-certificates
182+
EOF
183+
184+
local CONFIG_FILE="${DIR}/gitpod-config.yaml"
185+
gitpod-installer init > "${CONFIG_FILE}"
186+
187+
yq e -i ".certificate.name = \"https-certificates\"" "${CONFIG_FILE}"
188+
yq e -i ".domain = \"${DOMAIN}\"" "${CONFIG_FILE}"
189+
yq e -i ".metadata.region = \"${AWS_REGION}\"" "${CONFIG_FILE}"
190+
yq e -i '.workspace.runtime.containerdRuntimeDir = "/var/lib/containerd/io.containerd.runtime.v2.task/k8s.io"' "${CONFIG_FILE}"
191+
192+
gitpod-installer \
193+
render \
194+
--config="${CONFIG_FILE}" > gitpod.yaml
195+
196+
kubectl apply -f gitpod.yaml
197+
165198
# wait for update of the ingress status
166-
sleep 5
199+
until [ -n "$(kubectl get ingress gitpod -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')" ]; do
200+
sleep 5
201+
done
167202

168203
ALB_URL=$(kubectl get ingress gitpod -o json | jq -r .status.loadBalancer.ingress[0].hostname)
169204
if [ -n "${ALB_URL}" ];then

0 commit comments

Comments
 (0)