【问题标题】:How to name datafield in CoreDNS ConfigMap configuration如何在 CoreDNS ConfigMap 配置中命名数据字段
【发布时间】:2019-08-19 14:02:02
【问题描述】:

我已将 coreDNS 配置为指向外部 DNS 服务器,用于所有带有此 yaml*.mydomain.com 请求

apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns-custom
  namespace: kube-system
data:
  test.server: |
    mydomain.com:53 {
        errors
        cache 30
        forward . 10.0.0.3 10.0.0.4
    }

现在我找不到 test.server 部分的用途。 I found that .server is important,但不知道如何正确命名这部分,更不用说如何称呼这部分了。

【问题讨论】:

  • 看看那里的例子,我认为这不重要吗?只要它叫%name%.server

标签: azure kubernetes azure-aks configmap coredns


【解决方案1】:

ConfigMaps 使用 key-value 对来组织其中包含的数据。 Here is a good example of this format for the data section of a ConfigMap.

为此,AKS 中的 coreDNS 似乎会识别与代理相关的配置 as long as the key matches *.server

因此,在您的情况下,名为 test.server 的数据属性包含有关 mydomain.com:53 的配置信息以及其他嵌套配置数据。此格式特定于 AKS 上的 coreDNS 配置。

【讨论】:

    【解决方案2】:

    test.server 只是 ConfigMap 中包含服务器配置属性的键。


    正如第二个示例(在您链接的 AKS 文档页面上)所说:

    测试服务器:| # 您可以在此处选择任何名称,但必须以 .server 文件扩展名结尾


    意味着 Azure Kubernetes 服务可能会搜索以 .server 结尾的键并相应地使用它们。命名可以是从external.serverdns.servercoredns.server 到仅保留test.server

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-12-18
      • 2019-09-16
      • 2019-05-21
      • 1970-01-01
      • 2021-04-28
      • 1970-01-01
      • 2021-05-21
      相关资源
      最近更新 更多