Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.37 KB

coredns.md

File metadata and controls

45 lines (35 loc) · 1.37 KB

CoreDNS customization

The configuration provided by AKS Engine handles most setups by forwarding to the dns server configured on the nodes.

To customize CoreDNS (kubernetes docs) you can create a configmap that is appended to the builtin configuration. See the example below.

The kubernetes docs on also has some guidance.

NB:

  • The custom configmap must be named coredns-custom
  • The configmap must contain the item Corefile. This is imported by the main Corefile.
  • The server block cannot be for . (the root domain); this is in the main Corefile and there can not be duplicates.

Example coredns-custom configmap

apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns-custom   # Name must be `coredns-custom`
  namespace: kube-system
data:
  Corefile: |
    example.com {
        errors
        cache
        forward . 1.1.1.1 8.8.8.8
    }

After applying it you can force coredns to pick up the new config with

    $ kubectl -n kube-system rollout restart deployment coredns
    deployment.extensions/coredns restarted