Skip to content

Commit 87e7f9d

Browse files
committed
fix review suggestions
1 parent cdb4580 commit 87e7f9d

File tree

9 files changed

+25
-23
lines changed

9 files changed

+25
-23
lines changed

.werft/eks-installer-tests.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ pod:
1919
- name: sh-playground-dns-perm
2020
secret:
2121
secretName: sh-playground-dns-perm
22-
- name: sh-aks-perm
23-
secret:
24-
secretName: aks-credentials
2522
containers:
2623
- name: nightly-test
2724
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:cw-werft-cred.0

.werft/installer-tests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ const INFRA_PHASES: { [name: string]: InfraConfig } = {
185185
ADD_NS_RECORD: {
186186
phase: "add-ns-record",
187187
makeTarget: `add-ns-record cloud=${cloud}`,
188-
description: "Adds NS record for subdomain under gitpod-self-hosted.com",
188+
description: "Adds NS record for subdomain under tests.gitpod-self-hosted.com",
189189
},
190190
INSTALL_GITPOD_IGNORE_PREFLIGHTS: {
191191
phase: "install-gitpod-without-preflights",
@@ -282,7 +282,7 @@ function cleanup() {
282282
werft.phase(phase, "Destroying all the created resources");
283283

284284
const response = exec(`make -C ${makefilePath} cleanup cloud=${cloud}`, {
285-
slice: "run-terrafrom-destroy",
285+
slice: "run-terraform-destroy",
286286
dontCheckRc: true,
287287
});
288288

install/infra/terraform/eks/database.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
resource "random_password" "password" {
2+
length = 16
3+
special = true
4+
override_special = "!#$%&*()-_=+[]{}<>:?"
5+
}
6+
17
resource "aws_db_subnet_group" "gitpod_subnets" {
28
name = "db-sg-${var.cluster_name}"
39
subnet_ids = [module.vpc.public_subnets[2], module.vpc.public_subnets[3]]
@@ -32,7 +38,7 @@ resource "aws_db_instance" "gitpod" {
3238
identifier = "db-${var.cluster_name}"
3339
name = "gitpod"
3440
username = "gitpod"
35-
password = "gitpod-qwat"
41+
password = random_password.password.result
3642
parameter_group_name = "default.mysql5.7"
3743
db_subnet_group_name = aws_db_subnet_group.gitpod_subnets.name
3844
skip_final_snapshot = true

install/infra/terraform/eks/dns.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ resource "aws_route53_record" "cert_validation_3" {
5454
type = tolist(aws_acm_certificate.gitpod.domain_validation_options)[3].resource_record_type
5555
zone_id = "${resource.aws_route53_zone.gitpod.zone_id}"
5656
records = [tolist(aws_acm_certificate.gitpod.domain_validation_options)[3].resource_record_value]
57-
ttl = 6
57+
ttl = 60
5858
}
5959

6060
resource "aws_iam_policy" "gitpod" {

install/infra/terraform/eks/output.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ output "external_dns_settings" {
66
},
77
{
88
"name" = "aws.region",
9-
"value" = "eu-west-1"
9+
"value" = var.region
1010
},
1111
{
1212
"name" = "aws.credentials.secretKey",
@@ -26,7 +26,7 @@ output "secretAccessKey" {
2626

2727
output "cert_manager_issuer" {
2828
value = try({
29-
region = "eu-west-1"
29+
region = var.region
3030
secretAccessKeySecretRef = {
3131
name = "route53-credentials"
3232
key = "secret-access-key"
@@ -45,7 +45,7 @@ output "database" {
4545
sensitive = true
4646
value = try({
4747
host = "${aws_db_instance.gitpod.address}"
48-
password = "gitpod-qwat" # FIXME hardcoded at this point
48+
password = random_password.password.result
4949
port = 3306
5050
username = "${aws_db_instance.gitpod.username}"
5151
}, {})

install/infra/terraform/eks/variables.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
variable "cluster_name" {
22
type = string
33
description = "EKS cluster name."
4-
default = "nan-eks-3"
54
}
65
variable "kubeconfig" {
76
type = string

install/tests/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ check-kots-app:
203203
kubectl kots get --kubeconfig=${KUBECONFIG} app gitpod -n gitpod | grep gitpod | awk '{print $$2}' | grep "ready" || { echo "Gitpod is not ready"; exit 1; }
204204

205205
check-gitpod-installation: delete-cm-setup check-kots-app check-env-sub-domain
206-
@echo "Curling http://${TF_VAR_TEST_ID}.gitpod-self-hosted.com/api/version"
207-
curl -i -X GET http://${TF_VAR_TEST_ID}.gitpod-self-hosted.com/api/version || { echo "Curling Gitpod endpoint failed"; exit 1; }
206+
@echo "Curling http://${TF_VAR_TEST_ID}.tests.gitpod-self-hosted.com/api/version"
207+
curl -i -X GET http://${TF_VAR_TEST_ID}.tests.gitpod-self-hosted.com/api/version || { echo "Curling Gitpod endpoint failed"; exit 1; }
208208

209209
run-tests:
210210
./tests.sh ${KUBECONFIG}
@@ -241,7 +241,7 @@ destroy-azure: select-workspace
241241

242242
get-results:
243243
@echo "If you have gotten this far, it means your setup succeeded"
244-
@echo "The IP address of you setup is "$(TF_VAR_TEST_ID).gitpod-self-hosted.com""
244+
@echo "The IP address of you setup is "$(TF_VAR_TEST_ID).tests.gitpod-self-hosted.com""
245245
@echo "Following is the KUBECONFIG you can use to connect to the cluster:"
246246
@cat ${KUBECONFIG}
247247

install/tests/main.tf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module "k3s" {
3636
dns_sa_creds = var.dns_sa_creds
3737
dns_project = "dns-for-playgrounds"
3838
managed_dns_zone = "gitpod-self-hosted-com"
39-
domain_name = "${var.TEST_ID}.gitpod-self-hosted.com"
39+
domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com"
4040
}
4141

4242
module "gcp-issuer" {
@@ -57,7 +57,7 @@ module "aks" {
5757
# source = "github.com/gitpod-io/gitpod//install/infra/terraform/aks?ref=main" # we can later use tags here
5858
source = "../infra/terraform/aks"
5959

60-
domain_name = "${var.TEST_ID}.gitpod-self-hosted.com"
60+
domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com"
6161
enable_airgapped = false
6262
enable_external_database = true
6363
enable_external_registry = true
@@ -69,7 +69,7 @@ module "aks" {
6969

7070
module "eks" {
7171
source = "../infra/terraform/eks"
72-
domain_name = "${var.TEST_ID}.gitpod-self-hosted.com"
72+
domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com"
7373
cluster_name = var.TEST_ID
7474
region = "eu-west-1"
7575
vpc_availability_zones = ["eu-west-1c", "eu-west-1b"]
@@ -96,15 +96,15 @@ module "azure-externaldns" {
9696
source = "../infra/terraform/tools/external-dns"
9797
kubeconfig = var.kubeconfig
9898
settings = module.aks.external_dns_settings
99-
domain_name = "${var.TEST_ID}.gitpod-self-hosted.com"
99+
domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com"
100100
txt_owner_id = var.TEST_ID
101101
}
102102

103103
module "aws-externaldns" {
104104
source = "../infra/terraform/tools/external-dns"
105105
kubeconfig = var.kubeconfig
106106
settings = module.eks.external_dns_settings
107-
domain_name = "${var.TEST_ID}.gitpod-self-hosted.com"
107+
domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com"
108108
txt_owner_id = var.TEST_ID
109109
}
110110

@@ -129,14 +129,14 @@ module "azure-add-dns-record" {
129129
nameservers = module.aks.domain_nameservers
130130
dns_project = "dns-for-playgrounds"
131131
managed_dns_zone = "gitpod-self-hosted-com"
132-
domain_name = "${var.TEST_ID}.gitpod-self-hosted.com"
132+
domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com"
133133
}
134134

135135
module "aws-add-dns-record" {
136136
source = "../infra/terraform/tools/cloud-dns-ns"
137137
credentials = var.dns_sa_creds
138138
nameservers = module.eks.domain_nameservers
139139
dns_project = "dns-for-playgrounds"
140-
managed_dns_zone = "gitpod-self-hosted-com"
141-
domain_name = "${var.TEST_ID}.gitpod-self-hosted.com"
140+
managed_dns_zone = "tests-gitpod-self-hosted-com"
141+
domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com"
142142
}

install/tests/manifests/kots-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: ConfigValues
33
spec:
44
values:
55
domain:
6-
value: "${TF_VAR_TEST_ID}.gitpod-self-hosted.com"
6+
value: "${TF_VAR_TEST_ID}.tests.gitpod-self-hosted.com"
77
data: "domain"
88
ssh_gateway:
99
value: "1"

0 commit comments

Comments
 (0)