Add Custom CoreDNS Configuration

It may be desirable to enhance the configuration of CoreDNS by incorporating additional settings. To ensure the persistence of these changes during control plane maintenance, it is necessary to create a ConfigMap within the kube-system namespace. The ConfigMap should be named coredns-additional-conf and should include a data entry with the key extra.conf. The value associated with this entry must be a string that encompasses the supplementary configuration.

Below is an illustrative example that demonstrates the process of adding a custom DNS entry for example.abc:

apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns-additional-conf
  namespace: kube-system
data:
    extra.conf: |
      example.abc:53 {
        hosts {
          1.2.3.4 example.abc
          2.3.4.5 server.example.abc
          fallthrough
        }
      }

Last updated

Revision created

Minor update from the comments