Fix the terraform fmt of configs
This commit is contained in:
parent
f04411377f
commit
e19517d3df
|
@ -45,9 +45,9 @@ resource "matchbox_group" "worker" {
|
||||||
}
|
}
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
domain_name = "${element(var.worker_domains, count.index)}"
|
domain_name = "${element(var.worker_domains, count.index)}"
|
||||||
etcd_on_host = "${var.experimental_self_hosted_etcd ? "false" : "true"}"
|
etcd_on_host = "${var.experimental_self_hosted_etcd ? "false" : "true"}"
|
||||||
k8s_dns_service_ip = "${module.bootkube.kube_dns_service_ip}"
|
k8s_dns_service_ip = "${module.bootkube.kube_dns_service_ip}"
|
||||||
ssh_authorized_key = "${var.ssh_authorized_key}"
|
ssh_authorized_key = "${var.ssh_authorized_key}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,4 +78,3 @@ resource "matchbox_profile" "worker" {
|
||||||
name = "worker"
|
name = "worker"
|
||||||
container_linux_config = "${file("${path.module}/cl/worker.yaml.tmpl")}"
|
container_linux_config = "${file("${path.module}/cl/worker.yaml.tmpl")}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,37 +15,37 @@ resource "null_resource" "copy-secrets" {
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
content = "${module.bootkube.etcd_ca_cert}"
|
content = "${module.bootkube.etcd_ca_cert}"
|
||||||
destination = "$HOME/etcd-client-ca.crt"
|
destination = "$HOME/etcd-client-ca.crt"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
content = "${module.bootkube.etcd_client_cert}"
|
content = "${module.bootkube.etcd_client_cert}"
|
||||||
destination = "$HOME/etcd-client.crt"
|
destination = "$HOME/etcd-client.crt"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
content = "${module.bootkube.etcd_client_key}"
|
content = "${module.bootkube.etcd_client_key}"
|
||||||
destination = "$HOME/etcd-client.key"
|
destination = "$HOME/etcd-client.key"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
content = "${module.bootkube.etcd_server_cert}"
|
content = "${module.bootkube.etcd_server_cert}"
|
||||||
destination = "$HOME/etcd-server.crt"
|
destination = "$HOME/etcd-server.crt"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
content = "${module.bootkube.etcd_server_key}"
|
content = "${module.bootkube.etcd_server_key}"
|
||||||
destination = "$HOME/etcd-server.key"
|
destination = "$HOME/etcd-server.key"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
content = "${module.bootkube.etcd_peer_cert}"
|
content = "${module.bootkube.etcd_peer_cert}"
|
||||||
destination = "$HOME/etcd-peer.crt"
|
destination = "$HOME/etcd-peer.crt"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
content = "${module.bootkube.etcd_peer_key}"
|
content = "${module.bootkube.etcd_peer_key}"
|
||||||
destination = "$HOME/etcd-peer.key"
|
destination = "$HOME/etcd-peer.key"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,4 +94,3 @@ resource "null_resource" "bootkube-start" {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@ resource "digitalocean_record" "controllers" {
|
||||||
# DNS zone where record should be created
|
# DNS zone where record should be created
|
||||||
domain = "${var.dns_zone}"
|
domain = "${var.dns_zone}"
|
||||||
|
|
||||||
name = "${var.cluster_name}"
|
name = "${var.cluster_name}"
|
||||||
type = "A"
|
type = "A"
|
||||||
ttl = 300
|
ttl = 300
|
||||||
value = "${element(digitalocean_droplet.controllers.*.ipv4_address, count.index)}"
|
value = "${element(digitalocean_droplet.controllers.*.ipv4_address, count.index)}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,21 +15,21 @@ resource "digitalocean_record" "controllers" {
|
||||||
resource "digitalocean_droplet" "controllers" {
|
resource "digitalocean_droplet" "controllers" {
|
||||||
count = "${var.controller_count}"
|
count = "${var.controller_count}"
|
||||||
|
|
||||||
name = "${var.cluster_name}-controller-${count.index}"
|
name = "${var.cluster_name}-controller-${count.index}"
|
||||||
region = "${var.region}"
|
region = "${var.region}"
|
||||||
|
|
||||||
image = "${var.image}"
|
image = "${var.image}"
|
||||||
size = "${var.controller_type}"
|
size = "${var.controller_type}"
|
||||||
|
|
||||||
# network
|
# network
|
||||||
ipv6 = true
|
ipv6 = true
|
||||||
private_networking = true
|
private_networking = true
|
||||||
|
|
||||||
user_data = "${data.ct_config.controller_ign.rendered}"
|
user_data = "${data.ct_config.controller_ign.rendered}"
|
||||||
ssh_keys = "${var.ssh_fingerprints}"
|
ssh_keys = "${var.ssh_fingerprints}"
|
||||||
|
|
||||||
tags = [
|
tags = [
|
||||||
"${digitalocean_tag.controllers.id}"
|
"${digitalocean_tag.controllers.id}",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,28 +6,28 @@ resource "digitalocean_firewall" "rules" {
|
||||||
# allow ssh, http/https ingress, and peer-to-peer traffic
|
# allow ssh, http/https ingress, and peer-to-peer traffic
|
||||||
inbound_rule = [
|
inbound_rule = [
|
||||||
{
|
{
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
port_range = "22"
|
port_range = "22"
|
||||||
source_addresses = ["0.0.0.0/0", "::/0"]
|
source_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
port_range = "80"
|
port_range = "80"
|
||||||
source_addresses = ["0.0.0.0/0", "::/0"]
|
source_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
port_range = "443"
|
port_range = "443"
|
||||||
source_addresses = ["0.0.0.0/0", "::/0"]
|
source_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
protocol = "udp"
|
protocol = "udp"
|
||||||
port_range = "all"
|
port_range = "all"
|
||||||
source_tags = ["${var.cluster_name}-controller", "${var.cluster_name}-worker"]
|
source_tags = ["${var.cluster_name}-controller", "${var.cluster_name}-worker"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
port_range = "all"
|
port_range = "all"
|
||||||
source_tags = ["${var.cluster_name}-controller", "${var.cluster_name}-worker"]
|
source_tags = ["${var.cluster_name}-controller", "${var.cluster_name}-worker"]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -35,19 +35,18 @@ resource "digitalocean_firewall" "rules" {
|
||||||
# allow all outbound traffic
|
# allow all outbound traffic
|
||||||
outbound_rule = [
|
outbound_rule = [
|
||||||
{
|
{
|
||||||
protocol = "icmp"
|
protocol = "icmp"
|
||||||
destination_addresses = ["0.0.0.0/0", "::/0"]
|
destination_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
protocol = "udp"
|
protocol = "udp"
|
||||||
port_range = "all"
|
port_range = "all"
|
||||||
destination_addresses = ["0.0.0.0/0", "::/0"]
|
destination_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
port_range = "all"
|
port_range = "all"
|
||||||
destination_addresses = ["0.0.0.0/0", "::/0"]
|
destination_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,4 +22,3 @@ resource "null_resource" "bootkube-start" {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ variable "region" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "dns_zone" {
|
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)"
|
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" {
|
variable "controller_type" {
|
||||||
type = "string"
|
type = "string"
|
||||||
default = "1gb"
|
default = "1gb"
|
||||||
description = "Digital Ocean droplet type or size (e.g. 2gb, 4gb, 8gb). Do not choose a value below 2gb."
|
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" {
|
variable "worker_type" {
|
||||||
type = "string"
|
type = "string"
|
||||||
default = "512mb"
|
default = "512mb"
|
||||||
description = "Digital Ocean droplet type or size (e.g. 512mb, 1gb, 2gb, 4gb)"
|
description = "Digital Ocean droplet type or size (e.g. 512mb, 1gb, 2gb, 4gb)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@ resource "digitalocean_record" "workers" {
|
||||||
# DNS zone where record should be created
|
# DNS zone where record should be created
|
||||||
domain = "${var.dns_zone}"
|
domain = "${var.dns_zone}"
|
||||||
|
|
||||||
name = "${var.cluster_name}-workers"
|
name = "${var.cluster_name}-workers"
|
||||||
type = "A"
|
type = "A"
|
||||||
ttl = 300
|
ttl = 300
|
||||||
value = "${element(digitalocean_droplet.workers.*.ipv4_address, count.index)}"
|
value = "${element(digitalocean_droplet.workers.*.ipv4_address, count.index)}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,21 +15,21 @@ resource "digitalocean_record" "workers" {
|
||||||
resource "digitalocean_droplet" "workers" {
|
resource "digitalocean_droplet" "workers" {
|
||||||
count = "${var.worker_count}"
|
count = "${var.worker_count}"
|
||||||
|
|
||||||
name = "${var.cluster_name}-worker-${count.index}"
|
name = "${var.cluster_name}-worker-${count.index}"
|
||||||
region = "${var.region}"
|
region = "${var.region}"
|
||||||
|
|
||||||
image = "${var.image}"
|
image = "${var.image}"
|
||||||
size = "${var.worker_type}"
|
size = "${var.worker_type}"
|
||||||
|
|
||||||
# network
|
# network
|
||||||
ipv6 = true
|
ipv6 = true
|
||||||
private_networking = true
|
private_networking = true
|
||||||
|
|
||||||
user_data = "${data.ct_config.worker_ign.rendered}"
|
user_data = "${data.ct_config.worker_ign.rendered}"
|
||||||
ssh_keys = "${var.ssh_fingerprints}"
|
ssh_keys = "${var.ssh_fingerprints}"
|
||||||
|
|
||||||
tags = [
|
tags = [
|
||||||
"${digitalocean_tag.workers.id}"
|
"${digitalocean_tag.workers.id}",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue