From c6ec6596d84ddc2563193419dc6fe4e74d499f10 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Mon, 6 Nov 2017 00:51:20 -0800 Subject: [PATCH] Minor cleanup for zones, docs, and outputs * Spread across all zones, regardless of UP/DOWN state * Remove unused outputs of private IPs --- docs/google-cloud.md | 2 +- .../container-linux/kubernetes/controllers/controllers.tf | 5 ++--- .../container-linux/kubernetes/controllers/network.tf | 2 +- .../container-linux/kubernetes/controllers/outputs.tf | 4 ---- google-cloud/container-linux/kubernetes/outputs.tf | 4 ---- 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/docs/google-cloud.md b/docs/google-cloud.md index 381b9189..7ff67612 100644 --- a/docs/google-cloud.md +++ b/docs/google-cloud.md @@ -200,7 +200,7 @@ Learn about [version pinning](concepts.md#versioning), maintenance, and [addons] | os_image | OS image for compute instances | "coreos-stable-1465-6-0-v20170817" | | asset_dir | Path to a directory where generated assets should be placed (contains secrets) | "/home/user/.secrets/clusters/yavin" | -Check the list of valid [zones](https://cloud.google.com/compute/docs/regions-zones/regions-zones) and list Container Linux [images](https://cloud.google.com/compute/docs/images) with `gcloud compute images list | grep coreos`. +Check the list of valid [regions](https://cloud.google.com/compute/docs/regions-zones/regions-zones) and list Container Linux [images](https://cloud.google.com/compute/docs/images) with `gcloud compute images list | grep coreos`. #### DNS Zone diff --git a/google-cloud/container-linux/kubernetes/controllers/controllers.tf b/google-cloud/container-linux/kubernetes/controllers/controllers.tf index d6b3939b..b29d64bd 100644 --- a/google-cloud/container-linux/kubernetes/controllers/controllers.tf +++ b/google-cloud/container-linux/kubernetes/controllers/controllers.tf @@ -15,9 +15,8 @@ resource "google_dns_record_set" "etcds" { } # Zones in the region -data "google_compute_zones" "available" { +data "google_compute_zones" "all" { region = "${var.region}" - status = "UP" } # Controller instances @@ -25,7 +24,7 @@ resource "google_compute_instance" "controllers" { count = "${var.count}" name = "${var.cluster_name}-controller-${count.index}" - zone = "${element(data.google_compute_zones.available.names, count.index)}" + zone = "${element(data.google_compute_zones.all.names, count.index)}" machine_type = "${var.machine_type}" metadata { diff --git a/google-cloud/container-linux/kubernetes/controllers/network.tf b/google-cloud/container-linux/kubernetes/controllers/network.tf index 9d334495..36b4755e 100644 --- a/google-cloud/container-linux/kubernetes/controllers/network.tf +++ b/google-cloud/container-linux/kubernetes/controllers/network.tf @@ -30,7 +30,7 @@ resource "google_compute_target_pool" "controllers" { name = "${var.cluster_name}-controller-pool" instances = [ - "${formatlist("%s/%s", google_compute_instance.controllers.*.zone, google_compute_instance.controllers.*.name)}" + "${formatlist("%s/%s", google_compute_instance.controllers.*.zone, google_compute_instance.controllers.*.name)}", ] health_checks = [ diff --git a/google-cloud/container-linux/kubernetes/controllers/outputs.tf b/google-cloud/container-linux/kubernetes/controllers/outputs.tf index 7c819d8e..97bbf957 100644 --- a/google-cloud/container-linux/kubernetes/controllers/outputs.tf +++ b/google-cloud/container-linux/kubernetes/controllers/outputs.tf @@ -5,7 +5,3 @@ output "etcd_fqdns" { output "ipv4_public" { value = ["${google_compute_instance.controllers.*.network_interface.0.access_config.0.assigned_nat_ip}"] } - -output "ipv4_private" { - value = ["${google_compute_instance.controllers.*.network_interface.0.address}"] -} diff --git a/google-cloud/container-linux/kubernetes/outputs.tf b/google-cloud/container-linux/kubernetes/outputs.tf index 5b4b5eb5..08217820 100644 --- a/google-cloud/container-linux/kubernetes/outputs.tf +++ b/google-cloud/container-linux/kubernetes/outputs.tf @@ -2,10 +2,6 @@ output "controllers_ipv4_public" { value = ["${module.controllers.ipv4_public}"] } -output "controllers_ipv4_private" { - value = ["${module.controllers.ipv4_private}"] -} - output "ingress_static_ip" { value = "${module.workers.ingress_static_ip}" }