When following the CoreDNS section of the documentation to bridge Kubernetes and Consul DNS, you are prompted to add a piece of configuration to CoreDNS config:
consul {
errors
cache 30
proxy . <consul-dns service cluster ip>
}
Unfortunately when running the coredns pod with this configuration an error shows up:
/etc/coredns/Corefile:20 - Error during parsing: Unknown directive 'proxy'
It seems either a bug in the documentation or is missing a critical piece of information. (Do someone know who to report website bugs?)
From my understanding, proxy
is an external CoreDNS plugin, and is disabled by default, so in the coredns/coredns docker image is not present. It took me a while to understand that.
I was able to make it work by replacing proxy
with forward
, but I’m not sure what are all the implications of this.
You may also enable the plugin (plugin are enabled at compile time in CoreDNS), build the executable and push a new docker image for it.