How to name datafield in CoreDNS ConfigMap configuration

8/19/2019

I have configured coreDNS to point to an external DNS server for all *.mydomain.com requests with this yaml

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
    }

Now what I couldn't find is what the test.server part is for. I found that .server is important, but not how to properly name this part, let alone what to call this part.

-- InsOp
azure
azure-aks
configmap
coredns
kubernetes

2 Answers

8/20/2019

ConfigMaps use key-value pairs to organize the data contained in them. Here is a good example of this format for the data section of a ConfigMap.

For this specifically, it looks like coreDNS in AKS will identify the proxy-related configuration as long as the key matches *.server.

So in your case, the data property called test.server contains configuration information regarding mydomain.com:53 among other nested configuration data. This format is specific to coreDNS configuration on AKS.

-- yyyyahir
Source: StackOverflow

8/20/2019

test.server is just the key from your ConfigMap containing the configuration properties for the server.


As the second example (on the AKS docs page you linked) says:

test.server: | # you may select any name here, but it must end with the .server file extension


Meaning Azure Kubernetes Service will probably search for keys ending in .server and use them accordingly. Naming could be anything from external.server, dns.server or coredns.server to just keeping test.server.

-- char
Source: StackOverflow