coredns / coredns.io

CoreDNS website
https://coredns.io
167 stars 139 forks source link

Add gathersrv external plugin #297

Closed ziollek closed 1 year ago

ziollek commented 1 year ago

Adding a new (however it works in my company for quite a long time) plugin that allows to expose headless services from k8s clusters. It could seem like the multicluster plugin, but there are significant differences:

  1. it works as a rewriting proxy,
  2. it does not require sharing the same cluster zone by k8s clusters,
  3. it is k8s agnostic (it does not connect to any k8s-related API).
ziollek commented 1 year ago

Hi maintainers, could someone check my PR?

chrisohaver commented 1 year ago

Thanks! Sorry for the delay.

Interesting plugin! I think the description ties this closely to K8s. However, it is a general plugin that applies any set of domains, K8s just being one very specific example.

I'll merge this now, but just curious...

How do you handle SOA records? i.e. How do you select which SOA to use when including it in an NXDOMAIN response for example?

ziollek commented 1 year ago

@chrisohaver Thanks for merging. Exactly, the solution is agnostic to where the original records come from (k8s or another source). Currently, it handles only A, AAAA, TXT and SRV queries; other ones are passed further to the plugin chain without any changes. So being more specific if you would like to generate a response for SOA query for the distributed domain, you could use for example template plugin to generate a static response. But I am open to any suggestion if some more advanced logic would be helpful in such a case.