Skip to content

Commit

Permalink
modules/digitalocean/master: move api dns record to master/dns.tf
Browse files Browse the repository at this point in the history
Consolidate DNS records in master/dns.tf to align with db1c71e, in
advance of moving to modules/dns at
[request](coreos#604 (comment))
of @enxebre
  • Loading branch information
nreisbeck committed Jan 22, 2018
1 parent fee17fa commit f01af88
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
16 changes: 15 additions & 1 deletion modules/digitalocean/master/dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,22 @@ resource "digitalocean_domain" "console" {
ip_address = "${digitalocean_loadbalancer.console.ip}"
}

resource "digitalocean_record" "api" {
domain = "${var.base_domain}"
type = "A"
name = "${var.cluster_name}-api"
value = "${digitalocean_floating_ip.master.ip_address}"
}

resource "digitalocean_record" "console" {
domain = "${var.base_domain}"
type = "A"
name = "${var.cluster_name}"
value = "${digitalocean_loadbalancer.console.ip}"
}

resource "digitalocean_record" "master" {
count = "${var.master_count}"
count = "${var.droplet_count}"
domain = "${var.base_domain}"
name = "${var.cluster_name}-master-${count.index}"
type = "A"
Expand Down
19 changes: 3 additions & 16 deletions modules/digitalocean/master/loadbalancer.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
resource "digitalocean_record" "api" {
domain = "${var.base_domain}"
type = "A"
name = "${var.cluster_name}-api"
value = "${digitalocean_floating_ip.master.ip_address}"
}

resource "digitalocean_loadbalancer" "console" {
name = "${var.cluster_name}-con"
region = "${var.droplet_region}"
name = "${var.cluster_name}-console"
region = "${var.droplet_region}"
droplet_ids = ["${digitalocean_droplet.master_node.*.id}"]

forwarding_rule {
entry_port = 80
Expand All @@ -33,10 +27,3 @@ resource "digitalocean_loadbalancer" "console" {
unhealthy_threshold = 2
}
}

resource "digitalocean_record" "console" {
domain = "${var.base_domain}"
type = "A"
name = "${var.cluster_name}"
value = "${digitalocean_loadbalancer.console.ip}"
}

0 comments on commit f01af88

Please sign in to comment.