Skip to content

Commit

Permalink
data/data: update etcd srv records to cluster-name subdomain
Browse files Browse the repository at this point in the history
openshift#526 added the etcd srv records on basedomain,
this can be problematic and might collide.
This was working on AWS right now due to the fact that we were using internal route53 zone.

This keeps the old srvs inplace for now, so that when MCO switches to these new records we can comeback and
remove `*_old_srvs`
  • Loading branch information
abhinavdahiya committed Nov 1, 2018
1 parent 910c19a commit 6e2cada
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
10 changes: 9 additions & 1 deletion data/data/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,22 @@ resource "aws_route53_record" "etcd_a_nodes" {
records = ["${module.masters.ip_addresses[count.index]}"]
}

resource "aws_route53_record" "etcd_cluster" {
resource "aws_route53_record" "etcd_cluster_old_srvs" {
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_record" "etcd_cluster" {
type = "SRV"
ttl = "60"
zone_id = "${local.private_zone_id}"
name = "_etcd-server-ssl._tcp.${var.tectonic_cluster_name}"
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
13 changes: 12 additions & 1 deletion data/data/libvirt/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ resource "libvirt_network" "tectonic_net" {

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

hosts = ["${flatten(list(
Expand Down Expand Up @@ -120,7 +121,7 @@ data "libvirt_network_dns_host_template" "workers" {
hostname = "${var.tectonic_cluster_name}"
}

data "libvirt_network_dns_srv_template" "etcd_cluster" {
data "libvirt_network_dns_srv_template" "etcd_cluster_old_srvs" {
count = "${var.tectonic_master_count}"
service = "etcd-server-ssl"
protocol = "tcp"
Expand All @@ -129,3 +130,13 @@ data "libvirt_network_dns_srv_template" "etcd_cluster" {
weight = 10
target = "${var.tectonic_cluster_name}-etcd-${count.index}.${var.tectonic_base_domain}"
}

data "libvirt_network_dns_srv_template" "etcd_cluster" {
count = "${var.tectonic_master_count}"
service = "etcd-server-ssl"
protocol = "tcp"
domain = "${var.tectonic_cluster_name}.${var.tectonic_base_domain}"
port = 2380
weight = 10
target = "${var.tectonic_cluster_name}-etcd-${count.index}.${var.tectonic_base_domain}"
}

0 comments on commit 6e2cada

Please sign in to comment.