diff --git a/records/generator.go b/records/generator.go index 8700b363..60a7659f 100644 --- a/records/generator.go +++ b/records/generator.go @@ -211,6 +211,7 @@ func (rg *RecordGenerator) InsertState(sj state.State, domain, ns, listener stri rg.slaveRecords(sj, domain, spec) rg.listenerRecord(listener, ns) rg.masterRecord(domain, masters, sj.Leader) + rg.etcdRecord(domain, masters) rg.taskRecords(sj, domain, spec, ipSources) return nil @@ -357,6 +358,17 @@ func (rg *RecordGenerator) masterRecord(domain string, masters []string, leader } } +// SRV record for etcd +func (rg *RecordGenerator) etcdRecord(domain string, masters []string) { + server := "_etcd-server._tcp." + domain + "." + client := "_etcd-client._tcp." + domain + "." + for idx, _ := range masters { + perMasterRecord := "master" + strconv.Itoa(idx) + "." + domain + "." + rg.insertRR(client, perMasterRecord + ":2379", SRV) + rg.insertRR(server, perMasterRecord + ":2380", SRV) + } +} + // A or AAAA record for mesos-dns (the name is listed in SOA replies) func (rg *RecordGenerator) listenerRecord(listener string, ns string) { if listener == "0.0.0.0" {