由于我对 kubernetes 中的 coredns 配置不熟悉,并且我正在尝试探索 kubernetes 中 coredns 提供的插件。我看到一个名为 local 的插件,它将响应本地请求。但我无法理解这个插件将完全有用的用例。有人可以举例说明如何使用它吗?
提前致谢!!!
As I am new to coredns configurations in kubernetes and I'm trying to explore plugins provided by coredns in kubernetes. I see a plugin named local which will respond with a reply to local requests. But I could not understand a use-case where this plugin will be exactly useful for. Can someone explain with an example how it can be make use of?
Thanks in advance!!!
发布评论
评论(1)
作为coredns local 插件的作者/a>,
localhost。< searchPath>
查询正在击中核心,这是错误的。因此,他编写了此插件以拦截Localhost。查询并返回正确的响应。从官方coredns github github网页:
在本地启用的情况下,落在这些区域下的任何查询都会得到答复。这样可以防止查询“逃脱”到Internet上,并在外部基础架构上施加压力。
您可以检查
local> local
插件的代码在这里。我看不到与那里未结合的本地区域节点功能相似。请参阅coredns 在这里。
As the author of the
local
plugin for CoreDNS explains,localhost.<searchpath>
queries are hitting coredns, which is wrong. So, he wrote this plugin to intercept localhost.<'domain'> queries and return the correct response.From the official CoreDNS github web page:
With local enabled any query falling under these zones will get a reply. This prevents the query from "escaping" to the internet and putting strain on external infrastructure.
You can check the code of the
local
plugin here. I don't see similar to the unbound local-zone nodefault functionality there.See all in-tree plugins for CoreDNS here.