Verified Commit 9e889936 authored by Radim Peša's avatar Radim Peša
Browse files

DNS records for workers

parent 45291361
Host 192.168.7.*
Host k8s-prod-worker-*
# Security
ForwardAgent no
# Connection multiplexing
......@@ -6,9 +6,9 @@ ControlMaster auto
ControlPersist 2m
ControlPath ~/.ssh/ansible-%r@%h:%p
# Connect through bastion hosts
ProxyCommand ssh -W %h:%p rancher.edirex.ics.muni.cz
ProxyCommand ssh -W %h:%p pdxuser@rancher.edirex.ics.muni.cz
# Bastion hosts
Host rancher.edirex.ics.muni.cz
User pdxuser
User pdxuser
ProxyCommand none
......@@ -17,28 +17,11 @@ resource "openstack_compute_instance_v2" "k8s_cluster_worker" {
}
}
#resource "openstack_networking_floatingip_v2" "k8s_cluster_worker_fip" {
# count = "${var.k8s_worker_node_count}"
# pool = "${var.pool}"
#}
#resource "openstack_compute_floatingip_associate_v2" "k8s_cluster_worker_fip_a" {
# count = "${var.k8s_worker_node_count}"
# floating_ip = "${element(openstack_networking_floatingip_v2.k8s_cluster_worker_fip.*.address, count.index)}"
# instance_id = "${element(openstack_compute_instance_v2.k8s_cluster_worker.*.id, count.index)}"
#}
## Get PTR records
#data "dns_ptr_record_set" "ptr_k8s_cluster_worker" {
# count = "${var.k8s_worker_node_count}"
# ip_address = "${element(openstack_networking_floatingip_v2.k8s_cluster_worker_fip.*.address, count.index)}"
#}
## Set CNAME records
#resource "dns_cname_record" "cname_k8s_cluster_worker" {
# count = "${var.k8s_worker_node_count}"
# zone = "${var.zone}"
# name = "${element(openstack_compute_instance_v2.k8s_cluster_worker.*.name, count.index)}"
# cname = "${element(data.dns_ptr_record_set.ptr_k8s_cluster_worker.*.ptr, count.index)}"
# ttl = "${var.ttl}"
#}
# Set DNS records
resource "dns_a_record_set" "a_record_k8s_cluster_worker" {
count = "${var.k8s_worker_node_count}"
zone = "${var.zone}"
name = "${element(openstack_compute_instance_v2.k8s_cluster_worker.*.name, count.index)}"
addresses = ["${element(openstack_compute_instance_v2.k8s_cluster_worker.*.access_ip_v4, count.index)}"]
ttl = "${var.ttl}"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment