diff --git a/.werft/aks-installer-tests.yaml b/.werft/aks-installer-tests.yaml index bd68badded41fe..2b90940f70d3bf 100644 --- a/.werft/aks-installer-tests.yaml +++ b/.werft/aks-installer-tests.yaml @@ -1,4 +1,36 @@ # debug using `werft run github -f -s .werft/installer-tests.ts -j .werft/aks-installer-tests.yaml -a debug=true` +args: +- name: subdomain + desc: "Subdomain to use. A terraform workspace of same name will be used" + required: false + default: "" +- name: channel + desc: "Replicated channel to use" + required: false + default: "" +- name: replicatedApp + desc: "Replicated App to use" + required: false + default: "" +- name: version + desc: "Version of gitpod to install(in the case of upgrade tests, this is the initial install version and will later get upgraded to latest" + required: false + default: "" +- name: skipTests + desc: "Set this to true to skip integration tests" + required: false + default: false +- name: upgrade + desc: "Set this to true to run KOTS upgrade from the specified version to the latest version" + required: false + default: false +- name: preview + desc: "Setting preview to true creates a self-hosted preview for you to consume" + required: false + default: true +- name: deps + desc: "Specify if the dependencies(storage, db, registry) should be external or incluster. If unset, a random combination will be chosen. options:[external, incluster]" + required: false pod: serviceAccount: werft affinity: @@ -73,6 +105,16 @@ pod: secretKeyRef: name: slack-webhook-urls key: self_hosted_jobs + - name: REPLICATED_API_TOKEN + valueFrom: + secretKeyRef: + name: replicated + key: token + - name: REPLICATED_APP + valueFrom: + secretKeyRef: + name: replicated + key: app command: - bash - -c @@ -85,7 +127,12 @@ pod: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash - export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo)-azure + export domain="{{ .Annotations.subdomain }}" + if [[ "$domain" == "" ]]; then + export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo)-azure + else + export TF_VAR_TEST_ID="$domain" + fi (cd .werft && yarn install && mv node_modules ..) | werft log slice prep printf '{{ toJson . }}' > context.json diff --git a/.werft/cleanup-installer-tests.yaml b/.werft/cleanup-installer-tests.yaml index 5311c1e37dce78..75822192e40ff0 100644 --- a/.werft/cleanup-installer-tests.yaml +++ b/.werft/cleanup-installer-tests.yaml @@ -98,6 +98,16 @@ pod: secretKeyRef: name: slack-webhook-urls key: self_hosted_jobs + - name: REPLICATED_API_TOKEN + valueFrom: + secretKeyRef: + name: replicated + key: token + - name: REPLICATED_APP + valueFrom: + secretKeyRef: + name: replicated + key: app command: - bash - -c @@ -121,4 +131,4 @@ pod: npx ts-node .werft/installer-tests.ts ${TESTCONFIG} plugins: - cron: "15 3 * * *" + cron: "0 */12 * * *" diff --git a/.werft/eks-installer-tests.yaml b/.werft/eks-installer-tests.yaml index 28ea5971223770..f6064d53ba0b05 100644 --- a/.werft/eks-installer-tests.yaml +++ b/.werft/eks-installer-tests.yaml @@ -1,4 +1,36 @@ # debug using `werft run github -f -s .werft/installer-tests.ts -j .werft/eks-installer-tests.yaml -a debug=true` +args: +- name: subdomain + desc: "Subdomain to use. A terraform workspace of same name will be used" + required: false + default: "" +- name: channel + desc: "Replicated channel to use" + required: false + default: "" +- name: replicatedApp + desc: "Replicated App to use" + required: false + default: "" +- name: version + desc: "Version of gitpod to install(in the case of upgrade tests, this is the initial install version and will later get upgraded to latest" + required: false + default: "" +- name: skipTests + desc: "Set this to true to skip integration tests" + required: false + default: false +- name: upgrade + desc: "Set this to true to run KOTS upgrade from the specified version to the latest version" + required: false + default: false +- name: preview + desc: "Setting preview to true creates a self-hosted preview for you to consume" + required: false + default: true +- name: deps + desc: "Specify if the dependencies(storage, db, registry) should be external or incluster. If unset, a random combination will be chosen. options:[external, incluster]" + required: false pod: serviceAccount: werft affinity: @@ -68,6 +100,16 @@ pod: secretKeyRef: name: slack-webhook-urls key: self_hosted_jobs + - name: REPLICATED_API_TOKEN + valueFrom: + secretKeyRef: + name: replicated + key: token + - name: REPLICATED_APP + valueFrom: + secretKeyRef: + name: replicated + key: app command: - bash - -c @@ -78,7 +120,14 @@ pod: sudo chown -R gitpod:gitpod /workspace sudo apt update && apt install gettext-base - export TF_VAR_TEST_ID="$(echo $RANDOM | md5sum | head -c 5; echo)-aws" + + export domain="{{ .Annotations.subdomain }}" + + if [[ "$domain" == "" ]]; then + export TF_VAR_TEST_ID="$(echo $RANDOM | md5sum | head -c 5; echo)-aws" + else + export TF_VAR_TEST_ID="$domain" + fi (cd .werft && yarn install && mv node_modules ..) | werft log slice prep printf '{{ toJson . }}' > context.json diff --git a/.werft/gke-installer-tests.yaml b/.werft/gke-installer-tests.yaml index 5100cdfc66f8fa..b96a63fe3100aa 100644 --- a/.werft/gke-installer-tests.yaml +++ b/.werft/gke-installer-tests.yaml @@ -1,4 +1,36 @@ # debug using `werft run github -f -s .werft/installer-tests.ts -j .werft/gke-installer-tests.yaml -a debug=true` +args: +- name: subdomain + desc: "Subdomain to use. A terraform workspace of same name will be used" + required: false + default: "" +- name: channel + desc: "Replicated channel to use" + required: false + default: "" +- name: replicatedApp + desc: "Replicated App to use" + required: false + default: "" +- name: version + desc: "Version of gitpod to install(in the case of upgrade tests, this is the initial install version and will later get upgraded to latest" + required: false + default: "" +- name: skipTests + desc: "Set this to true to skip integration tests" + required: false + default: false +- name: upgrade + desc: "Set this to true to run KOTS upgrade from the specified version to the latest version" + required: false + default: false +- name: preview + desc: "Setting preview to true creates a self-hosted preview for you to consume" + required: false + default: true +- name: deps + desc: "Specify if the dependencies(storage, db, registry) should be external or incluster. If unset, a random combination will be chosen. options:[external, incluster]" + required: false pod: serviceAccount: werft affinity: @@ -55,6 +87,16 @@ pod: secretKeyRef: name: slack-webhook-urls key: self_hosted_jobs + - name: REPLICATED_API_TOKEN + valueFrom: + secretKeyRef: + name: replicated + key: token + - name: REPLICATED_APP + valueFrom: + secretKeyRef: + name: replicated + key: app command: - bash - -c @@ -65,7 +107,12 @@ pod: sudo chown -R gitpod:gitpod /workspace sudo apt update && apt install gettext-base - export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo)-gcp + export domain="{{ .Annotations.subdomain }}" + if [[ "$domain" == "" ]]; then + export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo)-gcp + else + export TF_VAR_TEST_ID="$domain" + fi (cd .werft && yarn install && mv node_modules ..) | werft log slice prep printf '{{ toJson . }}' > context.json diff --git a/.werft/installer-tests.ts b/.werft/installer-tests.ts index 4a5481bb7d752f..06a29c546f22b7 100644 --- a/.werft/installer-tests.ts +++ b/.werft/installer-tests.ts @@ -11,12 +11,16 @@ const annotations: any = context.Annotations || {}; const testConfig: string = process.argv.length > 2 ? process.argv[2] : "STANDARD_K3S_TEST"; const channel: string = annotations.channel || "unstable"; +const kotsApp: string = annotations.replicatedApp || "gitpod"; + const version: string = annotations.version || "-"; const preview: string = annotations.preview || "false"; // setting to true will not destroy the setup const upgrade: string = annotations.upgrade || "false"; // setting to true will not KOTS upgrade to the latest version. Set the channel to beta or stable in this case. const skipTests: string = annotations.skipTests || "false"; // setting to true skips the integration tests const deps: string = annotations.deps || ""; // options: ["external", "internal"] setting to `external` will ensure that all resource dependencies(storage, db, registry) will be external. if unset, a random selection will be used +const baseDomain: string = "tests.gitpod-self-hosted.com" + const slackHook = new Map([ ["self-hosted-jobs", process.env.SH_SLACK_NOTIFICATION_PATH.trim()], ["workspace-jobs", process.env.WS_SLACK_NOTIFICATION_PATH.trim()], @@ -165,16 +169,16 @@ const INFRA_PHASES: { [name: string]: InfraConfig } = { ADD_NS_RECORD: { phase: "add-ns-record", makeTarget: "add-ns-record", - description: "Adds NS record for subdomain under tests.gitpod-self-hosted.com", + description: `Adds NS record for subdomain under ${baseDomain}`, }, INSTALL_GITPOD_IGNORE_PREFLIGHTS: { phase: "install-gitpod-without-preflights", - makeTarget: `kots-install channel=${channel} version=${version} preflights=false`, // this is a bit of a hack, for now we pass params like this + makeTarget: `kots-install app=${kotsApp} channel=${channel} version=${version} preflights=false`, // this is a bit of a hack, for now we pass params like this description: "Install gitpod using kots community edition without preflights", }, INSTALL_GITPOD: { phase: "install-gitpod", - makeTarget: `kots-install channel=${channel} version=${version} preflights=true`, + makeTarget: `kots-install app=${kotsApp} channel=${channel} version=${version} preflights=true`, description: "Install gitpod using kots community edition", }, CHECK_INSTALLATION: { @@ -320,7 +324,7 @@ export async function installerTests(config: TestConfig) { werft.phase("print-output", "Get connection details to self-hosted setup"); exec( - `werft log result -d "self-hosted preview url" url "https://${process.env["TF_VAR_TEST_ID"]}.tests.gitpod-self-hosted.com"`, + `werft log result -d "self-hosted preview url" url "https://${process.env["TF_VAR_TEST_ID"]}.${baseDomain}"`, ); if (testConfig == "STANDARD_K3S_TEST") { @@ -341,6 +345,7 @@ export async function installerTests(config: TestConfig) { // if we are not doing preview, we delete the infrastructure cleanup(); } + } function runIntegrationTests() { @@ -414,7 +419,7 @@ function randK8sVersion(config: string): string { break; } case "STANDARD_AKS_TEST": { - options = ["1.21", "1.22", "1.23"] + options = ["1.22", "1.23", "1.24"] break; } case "STANDARD_EKS_TEST": { @@ -560,7 +565,7 @@ export async function sendPreviewSlackAlert(): Promise { fields: [ { type: "mrkdwn", - text: "*URL:*\n", + text: "*URL:*\n`, }, { type: "mrkdwn", diff --git a/.werft/jobs/build/self-hosted-upgrade-tests.ts b/.werft/jobs/build/self-hosted-upgrade-tests.ts index 34c49970ea9f58..ec9c4559767d0f 100644 --- a/.werft/jobs/build/self-hosted-upgrade-tests.ts +++ b/.werft/jobs/build/self-hosted-upgrade-tests.ts @@ -48,7 +48,7 @@ export async function triggerUpgradeTests(werft: Werft, config: JobConfig, usern annotation = `${annotation} -a cluster=${phase} -a updateGitHubStatus=gitpod-io/gitpod` - const testFile: string = ".werft/self-hosted-installer-tests.yaml"; + const testFile: string = `.werft/${phase}-installer-tests.yaml`; try { exec( diff --git a/.werft/k3s-installer-tests.yaml b/.werft/k3s-installer-tests.yaml index 88463230a7a331..a272c544a7887e 100644 --- a/.werft/k3s-installer-tests.yaml +++ b/.werft/k3s-installer-tests.yaml @@ -1,4 +1,36 @@ # debug using `werft run github -f -s .werft/installer-tests.ts -j .werft/k3s-installer-tests.yaml -a debug=true` +args: +- name: subdomain + desc: "Subdomain to use. A terraform workspace of same name will be used" + required: false + default: "" +- name: channel + desc: "Replicated channel to use" + required: false + default: "" +- name: replicatedApp + desc: "Replicated App to use" + required: false + default: "" +- name: version + desc: "Version of gitpod to install(in the case of upgrade tests, this is the initial install version and will later get upgraded to latest" + required: false + default: "" +- name: skipTests + desc: "Set this to true to skip integration tests" + required: false + default: false +- name: upgrade + desc: "Set this to true to run KOTS upgrade from the specified version to the latest version" + required: false + default: false +- name: preview + desc: "Setting preview to true creates a self-hosted preview for you to consume" + required: false + default: true +- name: deps + desc: "Specify if the dependencies(storage, db, registry) should be external or incluster. If unset, a random combination will be chosen. options:[external, incluster]" + required: false pod: serviceAccount: werft affinity: @@ -60,6 +92,16 @@ pod: secretKeyRef: name: slack-webhook-urls key: self_hosted_jobs + - name: REPLICATED_API_TOKEN + valueFrom: + secretKeyRef: + name: replicated + key: token + - name: REPLICATED_APP + valueFrom: + secretKeyRef: + name: replicated + key: app command: - bash - -c @@ -72,7 +114,13 @@ pod: curl -sLS https://get.k3sup.dev | sh - export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo)-k3s + export domain="{{ .Annotations.subdomain }}" + + if [[ "$domain" == "" ]]; then + export TF_VAR_TEST_ID="$(echo $RANDOM | md5sum | head -c 5; echo)-k3s" + else + export TF_VAR_TEST_ID="$domain" + fi (cd .werft && yarn install && mv node_modules ..) | werft log slice prep printf '{{ toJson . }}' > context.json diff --git a/.werft/self-hosted-installer-tests.yaml b/.werft/self-hosted-installer-tests.yaml deleted file mode 100644 index 669904870f32ab..00000000000000 --- a/.werft/self-hosted-installer-tests.yaml +++ /dev/null @@ -1,180 +0,0 @@ -# debug using `werft run github -f -s .werft/installer-tests.ts -j .werft/self-hosted-installer-tests.yaml -a debug=true` -args: -- name: cluster - desc: "Name of the supported managed cluster solution to test with, options: [`k3s`, `gke`, `aks`, `eks`], if not specified, it will run for all cloud providers" - required: false - default: "" -- name: subdomain - desc: "Subdomain to use, starting with `gitpod-*` will omit from cleanup, make sure it is not in use already. A terraform workspace of same name will be used" - required: false - default: "" -- name: channel - desc: "Replicated channel to use" - required: false - default: "" -- name: version - desc: "Version of gitpod to install(in the case of upgrade tests, this is the initial install version and will later get upgraded to latest" - required: false - default: "" -- name: skipTests - desc: "Set this to true to skip integration tests" - required: false - default: false -- name: upgrade - desc: "Set this to true to run KOTS upgrade from the specified version to the latest version" - required: false - default: false -- name: preview - desc: "Setting preview to true creates a self-hosted preview for you to consume" - required: false - default: true -- name: deps - desc: "Specify if the dependencies(storage, db, registry) should be external or incluster. If unset, a random combination will be chosen. options:[external, incluster]" - required: false -pod: - serviceAccount: werft - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: dev/workload - operator: In - values: - - "builds" - securityContext: - runAsUser: 0 - volumes: - - name: sh-playground-sa-perm - secret: - secretName: sh-playground-sa-perm - - name: sh-playground-dns-perm - secret: - secretName: sh-playground-dns-perm - - name: sh-aks-perm - secret: - secretName: aks-credentials - - name: self-hosted-github-oauth - secret: - secretName: self-hosted-github-oauth - containers: - - name: nightly-test - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-dl.1 - workingDir: /workspace - imagePullPolicy: Always - volumeMounts: - - name: self-hosted-github-oauth - mountPath: /mnt/secrets/self-hosted-github-oauth - - name: sh-playground-sa-perm - mountPath: /mnt/secrets/sh-playground-sa-perm - - name: sh-playground-dns-perm # this sa is used for the DNS management - mountPath: /mnt/secrets/sh-playground-dns-perm - env: - - name: GOOGLE_APPLICATION_CREDENTIALS - value: "/mnt/secrets/sh-playground-sa-perm/sh-sa.json" - - name: TF_VAR_sa_creds - value: "/mnt/secrets/sh-playground-sa-perm/sh-sa.json" - - name: TF_VAR_dns_sa_creds - value: "/mnt/secrets/sh-playground-dns-perm/sh-dns-sa.json" - - name: ARM_SUBSCRIPTION_ID - valueFrom: - secretKeyRef: - name: aks-credentials - key: subscriptionid - - name: ARM_TENANT_ID - valueFrom: - secretKeyRef: - name: aks-credentials - key: tenantid - - name: ARM_CLIENT_ID - valueFrom: - secretKeyRef: - name: aks-credentials - key: clientid - - name: ARM_CLIENT_SECRET - valueFrom: - secretKeyRef: - name: aks-credentials - key: clientsecret - - name: NODENAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: USER_TOKEN # this is for the integration tests - valueFrom: - secretKeyRef: - name: integration-test-user - key: token - - name: AWS_ACCESS_KEY_ID - valueFrom: - secretKeyRef: - name: aws-credentials - key: aws-access-key - - name: AWS_SECRET_ACCESS_KEY - valueFrom: - secretKeyRef: - name: aws-credentials - key: aws-secret-key - - name: AWS_REGION - valueFrom: - secretKeyRef: - name: aws-credentials - key: aws-region - - name: IDE_SLACK_NOTIFICATION_PATH - valueFrom: - secretKeyRef: - name: slack-webhook-urls - key: ide_jobs - - name: WS_SLACK_NOTIFICATION_PATH - valueFrom: - secretKeyRef: - name: slack-webhook-urls - key: workspace_jobs - - name: SH_SLACK_NOTIFICATION_PATH - valueFrom: - secretKeyRef: - name: slack-webhook-urls - key: self_hosted_jobs - command: - - bash - - -c - - | - sleep 1 - set -Eeuo pipefail - - sudo chown -R gitpod:gitpod /workspace - sudo apt update && apt install gettext-base - - curl -sLS https://get.k3sup.dev | sh - curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - sudo ./aws/install - - (cd .werft && yarn install && mv node_modules ..) | werft log slice prep - printf '{{ toJson . }}' > context.json - - export CLUSTER="{{ .Annotations.cluster }}" - - if [[ "$CLUSTER" == "" ]]; then - CLUSTER="k3s" - fi - - export domain="{{ .Annotations.subdomain }}" - - export eks=aws - export gke=gcp - export k3s=k3s - export aks=azure - - export provider=${!CLUSTER} - - if [[ "$domain" == "" ]]; then - export TF_VAR_TEST_ID="$(echo $RANDOM | md5sum | head -c 5; echo)-$provider" - else - export TF_VAR_TEST_ID="$domain" - fi - - TESTCONFIG="STANDARD_${CLUSTER^^}_TEST" - - npx ts-node .werft/installer-tests.ts ${TESTCONFIG} diff --git a/install/tests/Makefile b/install/tests/Makefile index e596a953aa0743..daa7d2a158a64c 100644 --- a/install/tests/Makefile +++ b/install/tests/Makefile @@ -7,6 +7,8 @@ TOPDIR=$(shell pwd) KUBECONFIG := "$(TOPDIR)/kubeconfig" +DOMAIN := tests.gitpod-self-hosted.com + check-env-sub-domain: ifndef TF_VAR_TEST_ID $(error TF_VAR_TEST_ID is not defined) @@ -68,12 +70,11 @@ gke-standard-cluster: check-env-cluster-version terraform apply -target=module.gke -var kubeconfig=${KUBECONFIG} --auto-approve @echo "Done creating GKE cluster" +ami_id_121 := "ami-060637af2651bc8bb" -ami_id_121 := "ami-0d57fb01036fac543" - -ami_id_122 := "ami-0b306cb7e98db98e4" +ami_id_122 := "ami-0733d755ed2c97a4d" -ami_id_123 := "ami-0eba9c07a41b01c3b" # since there is no official ubuntu image, we do not support this +ami_id_123 := "ami-05ec8881b9c2740d4" .PHONY: ## eks-standard-cluster: Creates an EKS cluster @@ -153,7 +154,7 @@ get-github-config: ifneq ($(GITHUB_SCM_OAUTH),) export SCM_OAUTH=./manifests/github-oauth.yaml && \ cat $$GITHUB_SCM_OAUTH/provider > $$SCM_OAUTH && \ - yq w -i $$SCM_OAUTH 'oauth.callBackUrl' http://${TF_VAR_TEST_ID}.tests.gitpod-self-hosted.com/auth/github.com/callback && \ + yq w -i $$SCM_OAUTH 'oauth.callBackUrl' http://${TF_VAR_TEST_ID}.${DOMAIN}/auth/github.com/callback && \ kubectl --kubeconfig=${KUBECONFIG} create namespace gitpod || echo "Gitpod namespace already exist" && \ kubectl --kubeconfig=${KUBECONFIG} delete secret github-oauth -n gitpod || echo "gitpod-oauth secret needs to be created" && \ kubectl --kubeconfig=${KUBECONFIG} create secret generic "github-oauth" --namespace gitpod --from-literal=provider="$$(cat $$SCM_OAUTH)" && \ @@ -166,6 +167,7 @@ KOTS_KONFIG := "./manifests/kots-config.yaml" get-base-config: get-github-config export CONFIG_PATCH=./manifests/config-patch.yaml && \ + export DOMAIN=${DOMAIN} && \ export PATCH=$$(cat $$CONFIG_PATCH | base64 -w 0) || export PATCH="" && \ envsubst < ${KOTS_KONFIG} > tmp_config.yml @@ -276,12 +278,14 @@ install-kots-cli: preflights ?= true channel ?= unstable +app ?= gitpod version ?= - kots-install: version-flag = $(if $(version:-=),--app-version-label=$(version),) kots-install: preflight-flag = $(if $(preflights:true=),--skip-preflights,) kots-install: license-file = $(if $(license_community_$(channel)),$(license_community_$(channel)),"../licenses/$(channel).yaml") kots-install: install-kots-cli - kubectl kots install gitpod/${channel} \ + kubectl kots remove ${app} -n gitpod --force --kubeconfig=${KUBECONFIG} || echo "No kots app existing, Installing" + kubectl kots install ${app}/${channel} \ --skip-rbac-check ${version-flag} ${preflight-flag} \ --namespace gitpod --kubeconfig=${KUBECONFIG} \ --name gitpod --shared-password gitpod \ @@ -305,8 +309,8 @@ check-kots-app: kubectl kots get --kubeconfig=${KUBECONFIG} app gitpod -n gitpod | grep gitpod | awk '{print $$2}' | grep "ready" || { $(MAKE) gitpod-debug-info; exit 1; } check-gitpod-installation: delete-cm-setup check-kots-app check-env-sub-domain - @echo "Curling http://${TF_VAR_TEST_ID}.tests.gitpod-self-hosted.com/api/version" - curl -i -X GET http://${TF_VAR_TEST_ID}.tests.gitpod-self-hosted.com/api/version || { echo "Curling Gitpod endpoint failed"; exit 1; } + @echo "Curling http://${TF_VAR_TEST_ID}.${DOMAIN}/api/version" + curl -i -X GET http://${TF_VAR_TEST_ID}.${DOMAIN}/api/version || { echo "Curling Gitpod endpoint failed"; exit 1; } define runtests ./tests.sh ${KUBECONFIG} $(1) diff --git a/install/tests/main.tf b/install/tests/main.tf index 3b700745bfe8e6..344327c4aae16a 100644 --- a/install/tests/main.tf +++ b/install/tests/main.tf @@ -17,6 +17,9 @@ variable "eks_node_image_id" { default = null } +variable "domain" { default = "tests.gitpod-self-hosted.com" } +variable "gcp_zone" { default = "tests-gitpod-self-hosted-com" } + variable "k3s_node_image_id" { default = null } @@ -48,8 +51,8 @@ module "k3s" { kubeconfig = var.kubeconfig dns_sa_creds = var.dns_sa_creds dns_project = "dns-for-playgrounds" - managed_dns_zone = "tests-gitpod-self-hosted-com" - domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com" + managed_dns_zone = var.gcp_zone + domain_name = "${var.TEST_ID}.${var.domain}" cluster_version = var.cluster_version image_id = var.k3s_node_image_id } @@ -72,7 +75,7 @@ module "aks" { # source = "github.com/gitpod-io/gitpod//install/infra/terraform/aks?ref=main" # we can later use tags here source = "../infra/modules/aks" - domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com" + domain_name = "${var.TEST_ID}.${var.domain}" enable_airgapped = false enable_external_database = true enable_external_registry = true @@ -85,7 +88,7 @@ module "aks" { module "eks" { source = "../infra/modules/eks" - domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com" + domain_name = "${var.TEST_ID}.${var.domain}" cluster_name = var.TEST_ID region = "eu-west-1" vpc_availability_zones = ["eu-west-1c", "eu-west-1b"] @@ -118,7 +121,7 @@ module "azure-externaldns" { source = "../infra/modules/tools/external-dns" kubeconfig = var.kubeconfig settings = module.aks.external_dns_settings - domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com" + domain_name = "${var.TEST_ID}.${var.domain}" txt_owner_id = var.TEST_ID } @@ -126,7 +129,7 @@ module "aws-externaldns" { source = "../infra/modules/tools/external-dns" kubeconfig = var.kubeconfig settings = module.eks.external_dns_settings - domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com" + domain_name = "${var.TEST_ID}.${var.domain}" txt_owner_id = var.TEST_ID } @@ -150,8 +153,8 @@ module "azure-add-dns-record" { credentials = var.dns_sa_creds nameservers = module.aks.domain_nameservers dns_project = "dns-for-playgrounds" - managed_dns_zone = "tests-gitpod-self-hosted-com" - domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com" + managed_dns_zone = var.gcp_zone + domain_name = "${var.TEST_ID}.${var.domain}" } module "aws-add-dns-record" { @@ -159,6 +162,6 @@ module "aws-add-dns-record" { credentials = var.dns_sa_creds nameservers = module.eks.domain_nameservers dns_project = "dns-for-playgrounds" - managed_dns_zone = "tests-gitpod-self-hosted-com" - domain_name = "${var.TEST_ID}.tests.gitpod-self-hosted.com" + managed_dns_zone = var.gcp_zone + domain_name = "${var.TEST_ID}.${var.domain}" } diff --git a/install/tests/manifests/kots-config.yaml b/install/tests/manifests/kots-config.yaml index 713e69f0d014e9..b2a11f184b0a8a 100644 --- a/install/tests/manifests/kots-config.yaml +++ b/install/tests/manifests/kots-config.yaml @@ -3,7 +3,7 @@ kind: ConfigValues spec: values: domain: - value: "${TF_VAR_TEST_ID}.tests.gitpod-self-hosted.com" + value: "${TF_VAR_TEST_ID}.${DOMAIN}" data: "domain" ssh_gateway: value: "1"