Skip to content

Commit

Permalink
Merge pull request #526 from abhinavdahiya/etcd_dns
Browse files Browse the repository at this point in the history
Add SRV records for bootstrapping etcd using DNS.
  • Loading branch information
openshift-merge-robot authored Oct 27, 2018
2 parents 58d98c3 + 0443add commit f02b995
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
8 changes: 8 additions & 0 deletions data/data/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ resource "aws_route53_record" "etcd_a_nodes" {
records = ["${module.masters.ip_addresses[count.index]}"]
}

resource "aws_route53_record" "etcd_cluster" {
type = "SRV"
ttl = "60"
zone_id = "${local.private_zone_id}"
name = "_etcd-server-ssl._tcp"
records = ["${formatlist("0 10 2380 %s", aws_route53_record.etcd_a_nodes.*.fqdn)}"]
}

resource "aws_route53_zone" "tectonic_int" {
count = "${local.private_endpoints ? "${var.tectonic_aws_external_private_zone == "" ? 1 : 0 }" : 0}"
vpc_id = "${module.vpc.vpc_id}"
Expand Down
14 changes: 14 additions & 0 deletions data/data/libvirt/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ resource "libvirt_network" "tectonic_net" {
dns = [{
local_only = true

srvs = ["${flatten(list(
data.libvirt_network_dns_srv_template.etcd_cluster.*.rendered,
))}"]

hosts = ["${flatten(list(
data.libvirt_network_dns_host_template.bootstrap.*.rendered,
data.libvirt_network_dns_host_template.masters.*.rendered,
Expand Down Expand Up @@ -116,3 +120,13 @@ data "libvirt_network_dns_host_template" "workers" {
ip = "${var.tectonic_libvirt_worker_ips[count.index]}"
hostname = "${var.tectonic_cluster_name}"
}

data "libvirt_network_dns_srv_template" "etcd_cluster" {
count = "${var.tectonic_master_count}"
service = "etcd-server-ssl"
protocol = "tcp"
domain = "${var.tectonic_base_domain}"
port = 2380
weight = 10
target = "${var.tectonic_cluster_name}-etcd-${count.index}.${var.tectonic_base_domain}"
}
2 changes: 1 addition & 1 deletion docs/dev/libvirt-howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ This step is optional, but useful for being able to resolve cluster-internal hos
1. Make sure you have the `virsh` binary installed: `sudo dnf install libvirt-client libvirt-devel`
2. Install the libvirt terraform provider:
```sh
GOBIN=~/.terraform.d/plugins go get -u github.com/dmacvicar/terraform-provider-libvirt
GOBIN=~/.terraform.d/plugins go get -u github.com/abhinavdahiya/terraform-provider-libvirt
```

### Cache Terrafrom plugins (optional, but makes subsequent runs a bit faster)
Expand Down

0 comments on commit f02b995

Please sign in to comment.