Skip to content

Commit dfe6d7f

Browse files
committed
fixing issue with k3s
1 parent 2f31b99 commit dfe6d7f

File tree

4 files changed

+44
-17
lines changed

4 files changed

+44
-17
lines changed

.werft/eks-installer-tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ pod:
7878
7979
(cd .werft && yarn install && mv node_modules ..) | werft log slice prep
8080
printf '{{ toJson . }}' > context.json
81+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
82+
unzip awscliv2.zip
83+
sudo ./aws/install
8184
8285
npx ts-node .werft/installer-tests.ts "STANDARD_EKS_TEST"
8386
# The bit below makes this a cron job

.werft/installer-tests.ts

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const TEST_CONFIGURATIONS: { [name: string]: TestConfig } = {
3535
"STANDARD_GKE_CLUSTER",
3636
"CERT_MANAGER",
3737
"GCP_MANAGED_DNS",
38+
"CLUSTER_ISSUER",
3839
"GENERATE_KOTS_CONFIG",
3940
"INSTALL_GITPOD",
4041
"CHECK_INSTALLATION",
@@ -49,6 +50,7 @@ const TEST_CONFIGURATIONS: { [name: string]: TestConfig } = {
4950
PHASES: [
5051
"STANDARD_GKE_CLUSTER",
5152
"CERT_MANAGER",
53+
"CLUSTER_ISSUER",
5254
"GCP_MANAGED_DNS",
5355
"GENERATE_KOTS_CONFIG",
5456
"INSTALL_GITPOD",
@@ -66,11 +68,12 @@ const TEST_CONFIGURATIONS: { [name: string]: TestConfig } = {
6668
PHASES: [
6769
"STANDARD_K3S_CLUSTER_ON_GCP",
6870
"CERT_MANAGER",
71+
"CLUSTER_ISSUER",
6972
"GENERATE_KOTS_CONFIG",
7073
"INSTALL_GITPOD",
74+
"RESULTS",
7175
"CHECK_INSTALLATION",
7276
"RUN_INTEGRATION_TESTS",
73-
"RESULTS",
7477
"DESTROY",
7578
],
7679
},
@@ -80,6 +83,7 @@ const TEST_CONFIGURATIONS: { [name: string]: TestConfig } = {
8083
PHASES: [
8184
"STANDARD_K3S_CLUSTER_ON_GCP",
8285
"CERT_MANAGER",
86+
"CLUSTER_ISSUER",
8387
"GENERATE_KOTS_CONFIG",
8488
"INSTALL_GITPOD",
8589
"CHECK_INSTALLATION",
@@ -116,7 +120,7 @@ const TEST_CONFIGURATIONS: { [name: string]: TestConfig } = {
116120
"RESULTS",
117121
"INSTALL_GITPOD",
118122
"CHECK_INSTALLATION",
119-
// "RUN_INTEGRATION_TESTS",
123+
"RUN_INTEGRATION_TESTS",
120124
"DESTROY",
121125
],
122126
},
@@ -169,18 +173,18 @@ const INFRA_PHASES: { [name: string]: InfraConfig } = {
169173
description: `Generate KOTS Config file`,
170174
},
171175
CLUSTER_ISSUER: {
172-
phase: `setup-azure-cluster-issuer cloud=${cloud}`,
173-
makeTarget: "azure-issuer",
174-
description: "Deploys ClusterIssuer for azure",
176+
phase: "setup-cluster-issuer",
177+
makeTarget: `cluster-issuer cloud=${cloud}`,
178+
description: `Deploys ClusterIssuer for ${cloud}`,
175179
},
176180
EXTERNALDNS: {
177181
phase: "external-dns",
178182
makeTarget: `external-dns cloud=${cloud}`,
179183
description: `Deploys external-dns with ${cloud} provider`,
180184
},
181185
ADD_NS_RECORD: {
182-
phase: `add-ns-record cloud=${cloud}`,
183-
makeTarget: "add-ns-record",
186+
phase: "add-ns-record",
187+
makeTarget: `add-ns-record cloud=${cloud}`,
184188
description: "Adds NS record for subdomain under gitpod-self-hosted.com",
185189
},
186190
INSTALL_GITPOD_IGNORE_PREFLIGHTS: {
@@ -246,23 +250,24 @@ export async function installerTests(config: TestConfig) {
246250
}
247251

248252
function callMakeTargets(phase: string, description: string, makeTarget: string) {
249-
werft.phase(phase, `${description}`);
250-
werft.log(phase, `calling ${makeTarget}`);
253+
werft.phase(phase, description);
251254

252255
const response = exec(`make -C ${makefilePath} ${makeTarget}`, {
253-
slice: "call-make-target",
256+
slice: phase,
254257
dontCheckRc: true,
255258
});
256259

257260
if (response.code) {
258261
console.error(`Error: ${response.stderr}`);
259262
werft.fail(phase, "Operation failed");
260-
} else {
261-
werft.log(phase, response.stdout.toString());
262-
werft.done(phase);
263+
return response.code;
263264
}
264265

266+
werft.log(phase, response.stdout.toString());
267+
werft.done(phase);
268+
265269
return response.code;
270+
266271
}
267272

268273
function randomize(resource: string, platform: string): string {

install/tests/Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ eks-standard-cluster:
3434
terraform init --upgrade && \
3535
terraform workspace new $(TF_VAR_TEST_ID) || terraform workspace select $(TF_VAR_TEST_ID) && \
3636
terraform apply -target=module.eks -var kubeconfig=${KUBECONFIG} --auto-approve
37+
@echo "Done creating EKS cluster"
3738

3839
.PHONY:
3940
## aks-standard-cluster: Creates an AKS cluster
4041
aks-standard-cluster:
4142
terraform init --upgrade && \
4243
terraform workspace new $(TF_VAR_TEST_ID) || terraform workspace select $(TF_VAR_TEST_ID) && \
4344
terraform apply -target=module.aks -var kubeconfig=${KUBECONFIG} --auto-approve
45+
@echo "Done creating AKS cluster"
4446

4547
cloud ?= azure
4648
.PHONY:
@@ -49,6 +51,7 @@ add-ns-record:
4951
terraform init --upgrade && \
5052
terraform workspace new $(TF_VAR_TEST_ID) || terraform workspace select $(TF_VAR_TEST_ID) && \
5153
terraform apply -target=module.$(cloud)-add-dns-record -var kubeconfig=${KUBECONFIG} --auto-approve
54+
@echo "Done adding NS record"
5255

5356
cloud ?= azure
5457
.PHONY:
@@ -57,35 +60,37 @@ cluster-issuer:
5760
terraform init --upgrade && \
5861
terraform workspace new $(TF_VAR_TEST_ID) || terraform workspace select $(TF_VAR_TEST_ID) && \
5962
terraform apply -target=module.$(cloud)-issuer -var kubeconfig=${KUBECONFIG} --auto-approve
63+
@echo "Done creating cluster issuer"
6064

6165
.PHONY:
6266
## k3s-standard-cluster: Creates a K3S cluster on GCP with one master and 1 worker node
6367
k3s-standard-cluster:
6468
terraform init --upgrade && \
6569
terraform workspace new $(TF_VAR_TEST_ID) || terraform workspace select $(TF_VAR_TEST_ID) && \
6670
terraform apply -target=module.k3s -var kubeconfig=${KUBECONFIG} --auto-approve
67-
68-
CLUSTER_ISSUER_CLOUD_DNS := "./manifests/gcp-issuer.yaml"
71+
@echo "Done creating k3s cluster"
6972

7073
.PHONY:
7174
## cert-manager: Installs cert-manager, optionally create secret for cloud-dns access
7275
cert-manager:
7376
terraform workspace select $(TF_VAR_TEST_ID) && \
7477
terraform apply -target=module.certmanager -var kubeconfig=${KUBECONFIG} --auto-approve
78+
@echo "Done installing cert-manager"
7579

7680
.PHONY:
7781
## managed-dns: Installs external-dns, and setup up CloudDNS access
7882
managed-dns: check-env-sub-domain
7983
terraform workspace select $(TF_VAR_TEST_ID) && \
80-
terraform apply -target=module.clouddns-externaldns -var kubeconfig=${KUBECONFIG} --auto-approve && \
81-
kubectl --kubeconfig=${KUBECONFIG} apply -f ${CLUSTER_ISSUER_CLOUD_DNS}
84+
terraform apply -target=module.clouddns-externaldns -var kubeconfig=${KUBECONFIG} --auto-approve
85+
@echo "Done created GCP managed DNS"
8286

8387
cloud ?= "azure"
8488
.PHONY:
8589
## external-dns: Installs external-dns
8690
external-dns: check-env-sub-domain
8791
terraform workspace select $(TF_VAR_TEST_ID) && \
8892
terraform apply -target=module.$(cloud)-externaldns -var kubeconfig=${KUBECONFIG} --auto-approve
93+
@echo "Done creating externaldns for ${cloud}"
8994

9095
.PHONY:
9196
## get-kubeconfig: Returns KUBECONFIG of a just created cluster

install/tests/main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ module "k3s" {
3939
domain_name = "${var.TEST_ID}.gitpod-self-hosted.com"
4040
}
4141

42+
module "gcp-issuer" {
43+
source = "../infra/terraform/tools/issuer"
44+
kubeconfig = var.kubeconfig
45+
issuer_name = "cloudDNS"
46+
cert_manager_issuer = {
47+
project = "dns-for-playgrounds"
48+
serviceAccountSecretRef = {
49+
name = "clouddns-dns01-solver"
50+
key = "keys.json"
51+
}
52+
}
53+
}
54+
55+
4256
module "aks" {
4357
# source = "github.com/gitpod-io/gitpod//install/infra/terraform/aks?ref=main" # we can later use tags here
4458
source = "../infra/terraform/aks"

0 commit comments

Comments
 (0)