From e19517d3df3f27d3ce84bf2251632822e43d8836 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Sat, 12 Aug 2017 18:25:05 -0700 Subject: [PATCH] Fix the terraform fmt of configs --- .../container-linux/kubernetes/groups.tf | 8 ++--- .../container-linux/kubernetes/profiles.tf | 1 - bare-metal/container-linux/kubernetes/ssh.tf | 15 +++++---- .../container-linux/kubernetes/controllers.tf | 22 ++++++------- .../container-linux/kubernetes/network.tf | 31 +++++++++---------- .../container-linux/kubernetes/ssh.tf | 1 - .../container-linux/kubernetes/variables.tf | 10 +++--- .../container-linux/kubernetes/workers.tf | 20 ++++++------ 8 files changed, 52 insertions(+), 56 deletions(-) diff --git a/bare-metal/container-linux/kubernetes/groups.tf b/bare-metal/container-linux/kubernetes/groups.tf index 833f180d..98d9c60a 100644 --- a/bare-metal/container-linux/kubernetes/groups.tf +++ b/bare-metal/container-linux/kubernetes/groups.tf @@ -45,9 +45,9 @@ resource "matchbox_group" "worker" { } metadata { - domain_name = "${element(var.worker_domains, count.index)}" - etcd_on_host = "${var.experimental_self_hosted_etcd ? "false" : "true"}" - k8s_dns_service_ip = "${module.bootkube.kube_dns_service_ip}" - ssh_authorized_key = "${var.ssh_authorized_key}" + domain_name = "${element(var.worker_domains, count.index)}" + etcd_on_host = "${var.experimental_self_hosted_etcd ? "false" : "true"}" + k8s_dns_service_ip = "${module.bootkube.kube_dns_service_ip}" + ssh_authorized_key = "${var.ssh_authorized_key}" } } diff --git a/bare-metal/container-linux/kubernetes/profiles.tf b/bare-metal/container-linux/kubernetes/profiles.tf index fc9aa207..430998a1 100644 --- a/bare-metal/container-linux/kubernetes/profiles.tf +++ b/bare-metal/container-linux/kubernetes/profiles.tf @@ -78,4 +78,3 @@ resource "matchbox_profile" "worker" { name = "worker" container_linux_config = "${file("${path.module}/cl/worker.yaml.tmpl")}" } - diff --git a/bare-metal/container-linux/kubernetes/ssh.tf b/bare-metal/container-linux/kubernetes/ssh.tf index 479e2139..3d20d349 100644 --- a/bare-metal/container-linux/kubernetes/ssh.tf +++ b/bare-metal/container-linux/kubernetes/ssh.tf @@ -15,37 +15,37 @@ resource "null_resource" "copy-secrets" { } provisioner "file" { - content = "${module.bootkube.etcd_ca_cert}" + content = "${module.bootkube.etcd_ca_cert}" destination = "$HOME/etcd-client-ca.crt" } provisioner "file" { - content = "${module.bootkube.etcd_client_cert}" + content = "${module.bootkube.etcd_client_cert}" destination = "$HOME/etcd-client.crt" } provisioner "file" { - content = "${module.bootkube.etcd_client_key}" + content = "${module.bootkube.etcd_client_key}" destination = "$HOME/etcd-client.key" } provisioner "file" { - content = "${module.bootkube.etcd_server_cert}" + content = "${module.bootkube.etcd_server_cert}" destination = "$HOME/etcd-server.crt" } provisioner "file" { - content = "${module.bootkube.etcd_server_key}" + content = "${module.bootkube.etcd_server_key}" destination = "$HOME/etcd-server.key" } provisioner "file" { - content = "${module.bootkube.etcd_peer_cert}" + content = "${module.bootkube.etcd_peer_cert}" destination = "$HOME/etcd-peer.crt" } provisioner "file" { - content = "${module.bootkube.etcd_peer_key}" + content = "${module.bootkube.etcd_peer_key}" destination = "$HOME/etcd-peer.key" } @@ -94,4 +94,3 @@ resource "null_resource" "bootkube-start" { ] } } - diff --git a/digital-ocean/container-linux/kubernetes/controllers.tf b/digital-ocean/container-linux/kubernetes/controllers.tf index bd04c9d7..096bd774 100644 --- a/digital-ocean/container-linux/kubernetes/controllers.tf +++ b/digital-ocean/container-linux/kubernetes/controllers.tf @@ -4,10 +4,10 @@ resource "digitalocean_record" "controllers" { # DNS zone where record should be created domain = "${var.dns_zone}" - - name = "${var.cluster_name}" - type = "A" - ttl = 300 + + name = "${var.cluster_name}" + type = "A" + ttl = 300 value = "${element(digitalocean_droplet.controllers.*.ipv4_address, count.index)}" } @@ -15,21 +15,21 @@ resource "digitalocean_record" "controllers" { resource "digitalocean_droplet" "controllers" { count = "${var.controller_count}" - name = "${var.cluster_name}-controller-${count.index}" + name = "${var.cluster_name}-controller-${count.index}" region = "${var.region}" image = "${var.image}" - size = "${var.controller_type}" - + size = "${var.controller_type}" + # network - ipv6 = true + ipv6 = true private_networking = true - + user_data = "${data.ct_config.controller_ign.rendered}" - ssh_keys = "${var.ssh_fingerprints}" + ssh_keys = "${var.ssh_fingerprints}" tags = [ - "${digitalocean_tag.controllers.id}" + "${digitalocean_tag.controllers.id}", ] } diff --git a/digital-ocean/container-linux/kubernetes/network.tf b/digital-ocean/container-linux/kubernetes/network.tf index d0a6479a..4e596712 100644 --- a/digital-ocean/container-linux/kubernetes/network.tf +++ b/digital-ocean/container-linux/kubernetes/network.tf @@ -6,28 +6,28 @@ resource "digitalocean_firewall" "rules" { # allow ssh, http/https ingress, and peer-to-peer traffic inbound_rule = [ { - protocol = "tcp" - port_range = "22" + protocol = "tcp" + port_range = "22" source_addresses = ["0.0.0.0/0", "::/0"] }, { - protocol = "tcp" - port_range = "80" + protocol = "tcp" + port_range = "80" source_addresses = ["0.0.0.0/0", "::/0"] }, { - protocol = "tcp" - port_range = "443" + protocol = "tcp" + port_range = "443" source_addresses = ["0.0.0.0/0", "::/0"] }, { - protocol = "udp" - port_range = "all" + protocol = "udp" + port_range = "all" source_tags = ["${var.cluster_name}-controller", "${var.cluster_name}-worker"] }, { - protocol = "tcp" - port_range = "all" + protocol = "tcp" + port_range = "all" source_tags = ["${var.cluster_name}-controller", "${var.cluster_name}-worker"] }, ] @@ -35,19 +35,18 @@ resource "digitalocean_firewall" "rules" { # allow all outbound traffic outbound_rule = [ { - protocol = "icmp" + protocol = "icmp" destination_addresses = ["0.0.0.0/0", "::/0"] }, { - protocol = "udp" - port_range = "all" + protocol = "udp" + port_range = "all" destination_addresses = ["0.0.0.0/0", "::/0"] }, { - protocol = "tcp" - port_range = "all" + protocol = "tcp" + port_range = "all" destination_addresses = ["0.0.0.0/0", "::/0"] }, ] } - diff --git a/digital-ocean/container-linux/kubernetes/ssh.tf b/digital-ocean/container-linux/kubernetes/ssh.tf index 85bdf2d5..d2b9564c 100644 --- a/digital-ocean/container-linux/kubernetes/ssh.tf +++ b/digital-ocean/container-linux/kubernetes/ssh.tf @@ -22,4 +22,3 @@ resource "null_resource" "bootkube-start" { ] } } - diff --git a/digital-ocean/container-linux/kubernetes/variables.tf b/digital-ocean/container-linux/kubernetes/variables.tf index 0d655673..5fae73a5 100644 --- a/digital-ocean/container-linux/kubernetes/variables.tf +++ b/digital-ocean/container-linux/kubernetes/variables.tf @@ -9,7 +9,7 @@ variable "region" { } variable "dns_zone" { - type = "string" + type = "string" description = "Digital Ocean domain name (i.e. DNS zone with NS records) (e.g. digital-ocean.dghubble.io)" } @@ -19,8 +19,8 @@ variable "image" { } variable "controller_type" { - type = "string" - default = "1gb" + type = "string" + default = "1gb" description = "Digital Ocean droplet type or size (e.g. 2gb, 4gb, 8gb). Do not choose a value below 2gb." } @@ -31,8 +31,8 @@ variable "controller_count" { } variable "worker_type" { - type = "string" - default = "512mb" + type = "string" + default = "512mb" description = "Digital Ocean droplet type or size (e.g. 512mb, 1gb, 2gb, 4gb)" } diff --git a/digital-ocean/container-linux/kubernetes/workers.tf b/digital-ocean/container-linux/kubernetes/workers.tf index 95461e5a..976d489c 100644 --- a/digital-ocean/container-linux/kubernetes/workers.tf +++ b/digital-ocean/container-linux/kubernetes/workers.tf @@ -5,9 +5,9 @@ resource "digitalocean_record" "workers" { # DNS zone where record should be created domain = "${var.dns_zone}" - name = "${var.cluster_name}-workers" - type = "A" - ttl = 300 + name = "${var.cluster_name}-workers" + type = "A" + ttl = 300 value = "${element(digitalocean_droplet.workers.*.ipv4_address, count.index)}" } @@ -15,21 +15,21 @@ resource "digitalocean_record" "workers" { resource "digitalocean_droplet" "workers" { count = "${var.worker_count}" - name = "${var.cluster_name}-worker-${count.index}" + name = "${var.cluster_name}-worker-${count.index}" region = "${var.region}" image = "${var.image}" - size = "${var.worker_type}" - + size = "${var.worker_type}" + # network - ipv6 = true + ipv6 = true private_networking = true - + user_data = "${data.ct_config.worker_ign.rendered}" - ssh_keys = "${var.ssh_fingerprints}" + ssh_keys = "${var.ssh_fingerprints}" tags = [ - "${digitalocean_tag.workers.id}" + "${digitalocean_tag.workers.id}", ] }