diff --git a/dev/preview/infrastructure/modules/gce/variables.tf b/dev/preview/infrastructure/modules/gce/variables.tf index 6487703cb8f8b8..e9723589f7f674 100644 --- a/dev/preview/infrastructure/modules/gce/variables.tf +++ b/dev/preview/infrastructure/modules/gce/variables.tf @@ -15,7 +15,7 @@ variable "preview_namespace" { variable "vm_type" { type = string - default = "n2d-standard-8" + default = "n2d-standard-16" } variable "ssh_key" { @@ -61,7 +61,7 @@ variable "gcp_project_dns" { variable "use_spot" { type = bool - default = false + default = true description = "Flag to decide whether to use spot instances" } diff --git a/dev/preview/infrastructure/modules/gce/vm.tf b/dev/preview/infrastructure/modules/gce/vm.tf index 5b069c35ac7a92..04293cca9539ba 100644 --- a/dev/preview/infrastructure/modules/gce/vm.tf +++ b/dev/preview/infrastructure/modules/gce/vm.tf @@ -80,5 +80,5 @@ locals { ssh_authorized_keys = var.ssh_key }) - machine_type = var.with_large_vm ? "n2d-standard-16" : var.vm_type + machine_type = var.with_large_vm ? "n2d-standard-32" : var.vm_type } diff --git a/dev/preview/infrastructure/variables.tf b/dev/preview/infrastructure/variables.tf index 54c2806962e66f..738c73807ae886 100644 --- a/dev/preview/infrastructure/variables.tf +++ b/dev/preview/infrastructure/variables.tf @@ -29,7 +29,7 @@ variable "dev_kube_context" { variable "vm_type" { type = string - default = "n2d-standard-8" + default = "n2d-standard-16" } variable "vm_image" { @@ -52,7 +52,7 @@ variable "gcp_project_dns" { variable "gce_use_spot" { type = bool - default = false + default = true description = "Flag to decide whether to use spot instances" } diff --git a/dev/preview/workflow/preview/deploy-harvester.sh b/dev/preview/workflow/preview/deploy-harvester.sh index 7544bcc14335eb..5423977f712cc3 100755 --- a/dev/preview/workflow/preview/deploy-harvester.sh +++ b/dev/preview/workflow/preview/deploy-harvester.sh @@ -33,7 +33,8 @@ shopt -os allexport terraform_init -source "${SCRIPT_PATH}/determine-env.sh" +# avoid harvester entirely +export TF_VAR_infra_provider="gce" PLAN_EXIT_CODE=0 terraform_plan || PLAN_EXIT_CODE=$? diff --git a/dev/preview/workflow/preview/determine-env.sh b/dev/preview/workflow/preview/determine-env.sh deleted file mode 100755 index 93b767c6664d6d..00000000000000 --- a/dev/preview/workflow/preview/determine-env.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -# this is meant to be sourced by the deploy script - -# If we're IN CI, quit for now -if [ -n "${GITHUB_ACTIONS-}" ] || [ -n "${WERFT_SERVICE_HOST-}" ]; then - return -fi - -state_output=$(terraform_output "infra_provider") -# If we don't have the provider_choice in the outputs, bail. This is temporary until all envs have it set -if [[ "${state_output}" != "harvester" && "${state_output}" != "gce" ]]; then - return -fi - -# If we're switching providers, try to delete the old context if there was one, as they will be different and we won't install it again -if [ -n "${TF_VAR_infra_provider-}" ] && [[ "${state_output}" != "${TF_VAR_infra_provider-}" ]]; then - kubectl config delete-context "${TF_WORKSPACE}" &>/dev/null || true - kubectl config delete-cluster "${TF_WORKSPACE}" &>/dev/null || true -fi - -if [ -n "${TF_VAR_infra_provider-}" ]; then - return -fi - -# Reuse the one we set in the state and exit -# Otherwise if we haven't set it, the default value of the variable will be reused and might overwrite a change -# A bit hacky for now, but will prevent destruction if you run it once with GCE, and next time you don't set the var explicitly -export TF_VAR_infra_provider=$state_output -return - -# Leaving this unreachable for now -options=("harvester" "gce") -provider_choice=$(choose "Choose your infra provider" "${options[@]}") - -if [ "${state_output}" != "${provider_choice}" ]; then - ask "You have chosen [${provider_choice}], but in the state we have [${state_output}]. Continuing will destroy and recreate your environment. Are you sure?" - export TF_VAR_infra_provider=${provider_choice} - return -fi