Skip to content

Commit 917f113

Browse files
author
Victor Lantier
committed
Merge branch 'feature/node-pools-oauth-scopes' of github.com:lantier/terraform-google-kubernetes-engine into feature/node-pools-oauth-scopes
2 parents e40190e + b6c85c3 commit 917f113

File tree

5 files changed

+21
-9
lines changed

5 files changed

+21
-9
lines changed

cluster_zonal.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ resource "google_container_node_pool" "zonal_pools" {
108108

109109
management {
110110
auto_repair = "${lookup(var.node_pools[count.index], "auto_repair", true)}"
111-
auto_upgrade = "${lookup(var.node_pools[count.index], "auto_upgrade", false)}"
111+
auto_upgrade = "${lookup(var.node_pools[count.index], "auto_upgrade", true)}"
112112
}
113113

114114
node_config {

examples/deploy_service/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ module "gke" {
4141
network = "${var.network}"
4242
subnetwork = "${var.subnetwork}"
4343

44+
kubernetes_version = "1.11.7-gke.12"
45+
4446
ip_range_pods = "${var.ip_range_pods}"
4547
ip_range_services = "${var.ip_range_services}"
4648
service_account = "${var.compute_engine_service_account}"

examples/node_pool/main.tf

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,23 @@ provider "google" {
2525
}
2626

2727
module "gke" {
28-
source = "../../"
29-
project_id = "${var.project_id}"
30-
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
31-
region = "${var.region}"
32-
network = "${var.network}"
33-
subnetwork = "${var.subnetwork}"
34-
ip_range_pods = "${var.ip_range_pods}"
35-
ip_range_services = "${var.ip_range_services}"
28+
source = "../../"
29+
project_id = "${var.project_id}"
30+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
31+
regional = "false"
32+
region = "${var.region}"
33+
zones = "${var.zones}"
34+
network = "${var.network}"
35+
subnetwork = "${var.subnetwork}"
36+
ip_range_pods = "${var.ip_range_pods}"
37+
ip_range_services = "${var.ip_range_services}"
38+
remove_default_node_pool = "true"
3639

3740
node_pools = [
3841
{
3942
name = "pool-01"
4043
min_count = 1
44+
max_count = 2
4145
service_account = "${var.compute_engine_service_account}"
4246
},
4347
{

examples/node_pool/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ variable "region" {
3131
description = "The region to host the cluster in"
3232
}
3333

34+
variable "zones" {
35+
type = "list"
36+
description = "The zone to host the cluster in (required if is a zonal cluster)"
37+
}
38+
3439
variable "network" {
3540
description = "The VPC network to host the cluster in"
3641
}

test/fixtures/node_pool/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module "example" {
2121
credentials_path = "${local.credentials_path}"
2222
cluster_name_suffix = "-${random_string.suffix.result}"
2323
region = "${var.region}"
24+
zones = ["${slice(var.zones,0,1)}"]
2425
network = "${google_compute_network.main.name}"
2526
subnetwork = "${google_compute_subnetwork.main.name}"
2627
ip_range_pods = "${google_compute_subnetwork.main.secondary_ip_range.0.range_name}"

0 commit comments

Comments
 (0)