Skip to content

Commit

Permalink
Avoid creating extraneous GCE controller instance groups
Browse files Browse the repository at this point in the history
* Intended as part of #504 improvement
* Single controller clusters only require one controller
instance group (previously created zone-many)
* Multi-controller clusters must "wrap" controllers over
zonal heterogeneous instance groups. For example, 5
controllers over 3 zones (no change)
  • Loading branch information
dghubble committed Jul 20, 2019
1 parent e0c7676 commit 56d0b9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion google-cloud/container-linux/kubernetes/apiserver.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ resource "google_compute_backend_service" "apiserver" {

# Instance group of heterogeneous (unmanged) controller instances
resource "google_compute_instance_group" "controllers" {
count = length(local.zones)
count = min(var.controller_count, length(local.zones))

name = format("%s-controllers-%s", var.cluster_name, element(local.zones, count.index))
zone = element(local.zones, count.index)
Expand Down

0 comments on commit 56d0b9e

Please sign in to comment.