From 43dc44623f587174c507b3188c01a15beff52bdd Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Mon, 16 Oct 2017 01:32:25 -0700 Subject: [PATCH] Fix the terraform fmt of configs --- aws/container-linux/kubernetes/outputs.tf | 3 +-- .../container-linux/kubernetes/bootkube.tf | 16 ++++++++-------- .../container-linux/kubernetes/profiles.tf | 4 ++-- bare-metal/container-linux/kubernetes/ssh.tf | 1 - .../container-linux/kubernetes/variables.tf | 9 ++++----- .../container-linux/pxe-worker/variables.tf | 1 + .../container-linux/kubernetes/controllers.tf | 5 +++-- .../kubernetes/controllers/controllers.tf | 1 + .../kubernetes/workers/workers.tf | 1 + 9 files changed, 21 insertions(+), 20 deletions(-) diff --git a/aws/container-linux/kubernetes/outputs.tf b/aws/container-linux/kubernetes/outputs.tf index 66ba3f88..d38c13c0 100644 --- a/aws/container-linux/kubernetes/outputs.tf +++ b/aws/container-linux/kubernetes/outputs.tf @@ -1,5 +1,4 @@ output "ingress_dns_name" { - value = "${aws_elb.ingress.dns_name}" + value = "${aws_elb.ingress.dns_name}" description = "DNS name of the ELB for distributing traffic to Ingress controllers" } - diff --git a/bare-metal/container-linux/kubernetes/bootkube.tf b/bare-metal/container-linux/kubernetes/bootkube.tf index a09b3d83..98df85cf 100644 --- a/bare-metal/container-linux/kubernetes/bootkube.tf +++ b/bare-metal/container-linux/kubernetes/bootkube.tf @@ -2,12 +2,12 @@ module "bootkube" { source = "git::https://github.com/poseidon/terraform-render-bootkube.git?ref=v0.7.0" - cluster_name = "${var.cluster_name}" - api_servers = ["${var.k8s_domain_name}"] - etcd_servers = ["${var.controller_domains}"] - asset_dir = "${var.asset_dir}" - networking = "${var.networking}" - network_mtu = "${var.network_mtu}" - pod_cidr = "${var.pod_cidr}" - service_cidr = "${var.service_cidr}" + cluster_name = "${var.cluster_name}" + api_servers = ["${var.k8s_domain_name}"] + etcd_servers = ["${var.controller_domains}"] + asset_dir = "${var.asset_dir}" + networking = "${var.networking}" + network_mtu = "${var.network_mtu}" + pod_cidr = "${var.pod_cidr}" + service_cidr = "${var.service_cidr}" } diff --git a/bare-metal/container-linux/kubernetes/profiles.tf b/bare-metal/container-linux/kubernetes/profiles.tf index 66f88d24..6dd57cf6 100644 --- a/bare-metal/container-linux/kubernetes/profiles.tf +++ b/bare-metal/container-linux/kubernetes/profiles.tf @@ -87,7 +87,7 @@ data "template_file" "controller-configs" { etcd_initial_cluster = "${join(",", formatlist("%s=https://%s:2380", var.controller_names, var.controller_domains))}" k8s_dns_service_ip = "${module.bootkube.kube_dns_service_ip}" ssh_authorized_key = "${var.ssh_authorized_key}" - networkd_content = "${element(var.controller_networkds, count.index)}" + networkd_content = "${element(var.controller_networkds, count.index)}" } } @@ -107,6 +107,6 @@ data "template_file" "worker-configs" { domain_name = "${element(var.worker_domains, count.index)}" k8s_dns_service_ip = "${module.bootkube.kube_dns_service_ip}" ssh_authorized_key = "${var.ssh_authorized_key}" - networkd_content = "${element(var.worker_networkds, count.index)}" + networkd_content = "${element(var.worker_networkds, count.index)}" } } diff --git a/bare-metal/container-linux/kubernetes/ssh.tf b/bare-metal/container-linux/kubernetes/ssh.tf index eb533680..db934abd 100644 --- a/bare-metal/container-linux/kubernetes/ssh.tf +++ b/bare-metal/container-linux/kubernetes/ssh.tf @@ -89,7 +89,6 @@ resource "null_resource" "copy-kubeconfig" { } } - # Secure copy bootkube assets to ONE controller and start bootkube to perform # one-time self-hosted cluster bootstrapping. resource "null_resource" "bootkube-start" { diff --git a/bare-metal/container-linux/kubernetes/variables.tf b/bare-metal/container-linux/kubernetes/variables.tf index 5bbe802f..ce7a6f09 100644 --- a/bare-metal/container-linux/kubernetes/variables.tf +++ b/bare-metal/container-linux/kubernetes/variables.tf @@ -119,14 +119,13 @@ variable "kernel_args" { # unofficial, undocumented, unsupported, temporary variable "controller_networkds" { - type = "list" + type = "list" description = "Controller Container Linux config networkd section" - default = [] + default = [] } variable "worker_networkds" { - type = "list" + type = "list" description = "Worker Container Linux config networkd section" - default = [] + default = [] } - diff --git a/bare-metal/container-linux/pxe-worker/variables.tf b/bare-metal/container-linux/pxe-worker/variables.tf index a67b92f2..c770ee35 100644 --- a/bare-metal/container-linux/pxe-worker/variables.tf +++ b/bare-metal/container-linux/pxe-worker/variables.tf @@ -59,6 +59,7 @@ variable "kube_dns_service_ip" { variable "kernel_args" { description = "Additional kernel arguments to provide at PXE boot." type = "list" + default = [ "root=/dev/sda1", ] diff --git a/digital-ocean/container-linux/kubernetes/controllers.tf b/digital-ocean/container-linux/kubernetes/controllers.tf index ca9b52ab..9739af22 100644 --- a/digital-ocean/container-linux/kubernetes/controllers.tf +++ b/digital-ocean/container-linux/kubernetes/controllers.tf @@ -64,8 +64,9 @@ data "template_file" "controller_config" { vars = { # Cannot use cyclic dependencies on controllers or their DNS records - etcd_name = "etcd${count.index}" - etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}" + etcd_name = "etcd${count.index}" + etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}" + # etcd0=https://cluster-etcd0.example.com,etcd1=https://cluster-etcd1.example.com,... etcd_initial_cluster = "${join(",", formatlist("%s=https://%s:2380", null_resource.repeat.*.triggers.name, null_resource.repeat.*.triggers.domain))}" k8s_dns_service_ip = "${cidrhost(var.service_cidr, 10)}" diff --git a/google-cloud/container-linux/kubernetes/controllers/controllers.tf b/google-cloud/container-linux/kubernetes/controllers/controllers.tf index abb8012b..2d7c9c27 100644 --- a/google-cloud/container-linux/kubernetes/controllers/controllers.tf +++ b/google-cloud/container-linux/kubernetes/controllers/controllers.tf @@ -55,6 +55,7 @@ resource "google_compute_instance_template" "controller" { boot = true source_image = "${var.os_image}" disk_size_gb = "${var.disk_size}" + // Set explicit name to match the new default name set by the API. // https://github.com/terraform-providers/terraform-provider-google/issues/574 device_name = "persistent-disk-0" diff --git a/google-cloud/container-linux/kubernetes/workers/workers.tf b/google-cloud/container-linux/kubernetes/workers/workers.tf index 094ba397..94882ac1 100644 --- a/google-cloud/container-linux/kubernetes/workers/workers.tf +++ b/google-cloud/container-linux/kubernetes/workers/workers.tf @@ -55,6 +55,7 @@ resource "google_compute_instance_template" "worker" { boot = true source_image = "${var.os_image}" disk_size_gb = "${var.disk_size}" + // Set explicit name to match the new default name set by the API. // https://github.com/terraform-providers/terraform-provider-google/issues/574 device_name = "persistent-disk-0"