From 7ddabe020269cfecbd74135ca19bf9dd296367a9 Mon Sep 17 00:00:00 2001 From: Moe Sy Date: Thu, 16 Jul 2020 19:52:17 -1000 Subject: [PATCH] Add custom VPC support Add ability for user to specify subnetwork alongside the network for custom VPC support. When deploying in the default VPC the subnetwork flag can remain empty. --- install/terraform/modules/gke/cluster.tf | 2 ++ install/terraform/modules/gke/variables.tf | 1 + 2 files changed, 3 insertions(+) diff --git a/install/terraform/modules/gke/cluster.tf b/install/terraform/modules/gke/cluster.tf index 181447c7c4..38165dc424 100644 --- a/install/terraform/modules/gke/cluster.tf +++ b/install/terraform/modules/gke/cluster.tf @@ -28,6 +28,7 @@ locals { machineType = lookup(var.cluster, "machineType", "n1-standard-4") initialNodeCount = lookup(var.cluster, "initialNodeCount", "4") network = lookup(var.cluster, "network", "default") + subnetwork = lookup(var.cluster, "subnetwork", "") kubernetesVersion = lookup(var.cluster, "kubernetesVersion", "1.15") } @@ -49,6 +50,7 @@ resource "google_container_cluster" "primary" { location = local.zone project = local.project network = local.network + subnetwork = local.subnetwork min_master_version = local.kubernetesVersion diff --git a/install/terraform/modules/gke/variables.tf b/install/terraform/modules/gke/variables.tf index 4ce17b3aaf..c77d8ab3d8 100644 --- a/install/terraform/modules/gke/variables.tf +++ b/install/terraform/modules/gke/variables.tf @@ -31,6 +31,7 @@ variable "cluster" { "initialNodeCount" = "4" "project" = "agones" "network" = "default" + "subnetwork" = "" "kubernetesVersion" = "1.15" } }