I'm fairly new to DNS and CoreDNS and it was very easy to compile and start Now I'm trying to insert a few TXT records in etcd. Sniffing with wireshark ensures I'm placing the entries at the correct endpoint. But I am missing examples or documentation of records (A, AAAA, MX, TXT) on which paths to put them (including the JSON format). Or I'm reading the documentation wrong of the etcd plugin.
I have read through the sourcecode of the plugin but I can not come up with a correct PUT request to place the TXT record.
https://github.com/coredns/coredns/blob/master/plugin/etcd/etcd.go#L77:
> curl -XPUT http://127.0.0.1:2379/v2/keys/skydns/org/xor-gate/dorpstraat -d value='{"text":"boembats","ttl":"3000"}'
{"action":"set","node":{"key":"/skydns/org/xor-gate/dorpstraat","value":"{\"text\":\"boembats\",\"ttl\":\"3000\"}","modifiedIndex":6,"createdIndex":6}}
path: /skydns/org/xor-gate/dorpstraat
path error: Key not found
Thanks in advance,
Jerry Jacobs
I think the reason is that the examples are only for etcdv2 but we've already moved to etcdv3. So the records you put in the etcd instance by using etcdv2 API(i.e., both in examples and your command, using[CLIENT_URL]/v2/keys as the endpoint gateway) will not be visible if our plugin using etcdv3.
And also I think we shouldn't use curl API for example, the reasons are as follows:
Key and Value must be base64 encoded in JSON.Here is a link for details: https://github.com/coreos/etcd/blob/master/Documentation/dev-guide/api_grpc_gateway.md#notes
So maybe using etcdctl is a better choice.
ah, yeah we should totally clean those up; not valid anymore /cc @nitisht
right. Will do that @miekg
Most helpful comment
right. Will do that @miekg