CoreDNS 1.0: General Availability for Kubernetes Service Discovery

CoreDNS 1.0: General Availability for Kubernetes Service Discovery

Introduction

On December 19, 2017, the CoreDNS team announced CoreDNS 1.0, declaring the flexible DNS server production-ready. After a year of rapid iteration, CoreDNS reached feature parity with kube-dns while offering a modular plugin system that meshes perfectly with Kubernetes’ dynamic environments.


GA Highlights

  • Stable Kubernetes Plugin: Serves cluster.local zones with endpoint slices, headless services and pod-level records, matching kube-dns behavior.
  • Plugin Chain Improvements: Plugins compile into a single binary; the 1.0 release adds retry, loop detection and smarter health checks.
  • Dynamic Configuration Reload: coredns -conf reloads Corefiles without restarts, simplifying changes in production clusters.
  • Metrics & Tracing: Prometheus metrics and OpenTracing hooks graduate from beta, offering deep observability.
  • Forwarding Enhancements: Improved caching, parallel upstream queries and auto plugin for on-demand zone loading.

Migrating from kube-dns

  1. Install the official CoreDNS deployment:

    kubectl apply -f coredns.yaml
    
  2. Update the kubelet --cluster-dns flag to point at the CoreDNS service ClusterIP.

  3. Validate headless services and stub domains using kubectl exec + dig.

  4. Remove the old kube-dns deployment after confirming workloads resolve successfully.

Sample Corefile:

cluster.local:53 {
  errors
  health
  kubernetes cluster.local in-addr.arpa ip6.arpa {
    pods insecure
    fallthrough in-addr.arpa ip6.arpa
  }
  prometheus 0.0.0.0:9153
  cache 30
  loop
  reload
  loadbalance
}
.:53 {
  errors
  cache 30
  forward . 8.8.8.8 1.1.1.1
  log
}

Managing the Corefile via ConfigMap

The CoreDNS deployment consumes a ConfigMap named coredns in kube-system. Update it declaratively:

kubectl -n kube-system edit configmap coredns

or with GitOps:

apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns
  namespace: kube-system
data:
  Corefile: |
    cluster.local:53 {
      errors
      health
      kubernetes cluster.local in-addr.arpa ip6.arpa
      prometheus :9153
      cache 30
      loop
      reload
    }
    .:53 {
      forward . 8.8.8.8 1.1.1.1
      log
    }

Apply with kubectl apply -f corefile-config.yaml to keep DNS configuration under version control.


Operational Tips

  • Scale CoreDNS horizontally—most clusters run 2–4 replicas behind a ClusterIP service.
  • Monitor coredns_dns_request_duration_seconds and coredns_dns_response_rcode_count_total metrics to spot latency or NXDOMAIN spikes.
  • Use plugins.cfg to build minimal binaries for constrained environments; 1.0 tooling makes plugin selection straightforward.
  • Pair with Kubernetes’ ConfigMap-based Corefile to manage DNS settings declaratively.

Common DNS Gotchas (That Look Like App Bugs)

  • Watch for forwarding loops: if CoreDNS forwards to a resolver that forwards back into the cluster, you’ll see loop warnings and intermittent resolution failures.
  • Be conservative with upstream resolvers; public DNS IPs are convenient for demos, but production clusters usually forward to VPC/on-prem resolvers for reliability and policy.
  • When debugging, check from inside a pod (kubectl exec ... -- dig) so you’re seeing the same DNS path and search domains that the workload sees.

Looking Ahead

The 2018 roadmap includes:

  • Dual-Stack Support for IPv6/IPv4 clusters.
  • Dynamic upstream discovery via Kubernetes Endpoints.
  • Advanced policies like response rewriting for service mesh domains (e.g., Istio global suffixes).

CoreDNS 1.0 laid the groundwork for its 2018 promotion to Kubernetes DNS default, giving operators a fast, extensible DNS choice.


Summary

AspectDetails
Release DateDecember 19, 2017
Key InnovationsGA Kubernetes plugin, hot reload, observability, enhanced forwarding
SignificancePositioned CoreDNS as the next-generation DNS provider for Kubernetes clusters