Skip to content

Commit ca8985f

Browse files
committed
fixing issue with k3s
1 parent 73233fc commit ca8985f

File tree

4 files changed

+34
-15
lines changed

4 files changed

+34
-15
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: 16 additions & 11 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",
@@ -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,8 +250,7 @@ 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}`, {
253256
slice: "call-make-target",
@@ -257,12 +260,14 @@ function callMakeTargets(phase: string, description: string, makeTarget: string)
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: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ k3s-standard-cluster:
6565
terraform workspace new $(TF_VAR_TEST_ID) || terraform workspace select $(TF_VAR_TEST_ID) && \
6666
terraform apply -target=module.k3s -var kubeconfig=${KUBECONFIG} --auto-approve
6767

68-
CLUSTER_ISSUER_CLOUD_DNS := "./manifests/gcp-issuer.yaml"
69-
7068
.PHONY:
7169
## cert-manager: Installs cert-manager, optionally create secret for cloud-dns access
7270
cert-manager:
@@ -77,8 +75,7 @@ cert-manager:
7775
## managed-dns: Installs external-dns, and setup up CloudDNS access
7876
managed-dns: check-env-sub-domain
7977
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}
78+
terraform apply -target=module.clouddns-externaldns -var kubeconfig=${KUBECONFIG} --auto-approve
8279

8380
cloud ?= "azure"
8481
.PHONY:

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)