chore: use zonal GKE cluster to reduce provisioning time

Switch cluster and all node pools from regional to zonal (`europe-west4-b`) to avoid the 40+ minute provisioning time of a regional (multi-zone) cluster. Adds a `zone` variable to the GKE module and cluster config, and updates the workflow's `gcloud get-credentials` call to use `--zone` instead of `--region`.
This commit is contained in:
E M 2026-04-23 17:10:08 +10:00
parent 229cff0065
commit 00a6264030
No known key found for this signature in database
5 changed files with 18 additions and 6 deletions

View File

@ -5,6 +5,7 @@ module "gke" {
name = "logos-storage-rel-tests"
project = var.project
region = var.region
zone = var.zone
kubernetes_release_channel = "STABLE"
node_pool_name = "infra-e2-standard-4"
node_pool_machine_type = "e2-standard-4"
@ -21,7 +22,7 @@ module "gke" {
resource "google_container_node_pool" "runners-ci" {
name = "runners-ci-e2-standard-2"
cluster = module.gke.kubernetes_cluster_id
location = var.region
location = var.zone
project = var.project
autoscaling {
@ -47,7 +48,7 @@ resource "google_container_node_pool" "runners-ci" {
resource "google_container_node_pool" "tests-pods" {
name = "tests-e2-medium"
cluster = module.gke.kubernetes_cluster_id
location = var.region
location = var.zone
project = var.project
autoscaling {

View File

@ -7,3 +7,8 @@ variable "region" {
description = "GCP region (e.g. europe-west4)"
type = string
}
variable "zone" {
description = "GCP zone for the cluster (e.g. europe-west4-b)"
type = string
}

View File

@ -1,7 +1,7 @@
# Kubernetes cluster
resource "google_container_cluster" "this" {
name = local.name
location = var.region
location = var.zone
project = var.project
# Create an empty cluster all node pools are managed as separate resources
@ -28,7 +28,7 @@ resource "google_container_cluster" "this" {
resource "google_container_node_pool" "default" {
name = var.node_pool_name
cluster = google_container_cluster.this.id
location = var.region
location = var.zone
project = var.project
autoscaling {

View File

@ -11,7 +11,12 @@ variable "project" {
variable "region" {
type = string
description = "The GCP region for the cluster (regional cluster spans 3 zones)."
description = "The GCP region (used for the provider and node pool location)."
}
variable "zone" {
type = string
description = "The GCP zone for the cluster. Using a single zone avoids the longer provisioning time of a regional (multi-zone) cluster."
}
# Kubernetes Control Plane

View File

@ -211,6 +211,7 @@ jobs:
env:
TF_VAR_project: ${{ secrets.RELEASE_TESTS_GCP_PROJECT }}
TF_VAR_region: europe-west4
TF_VAR_zone: europe-west4-b
STORAGEDOCKERIMAGE: ${{ needs.build-docker-dist-tests.outputs.logos_storage_image }}
TEST_TYPE: release-tests
BRANCH: ${{ inputs.branch || 'master' }}
@ -249,7 +250,7 @@ jobs:
- name: Get kubeconfig
run: |
gcloud container clusters get-credentials logos-storage-rel-tests-gcp-europe-west4 \
--region europe-west4 \
--zone europe-west4-b \
--project ${{ secrets.RELEASE_TESTS_GCP_PROJECT }}
- name: Create in-cluster app kubeconfig secret