Tasks

Step-by-step instructions for performing operations with Kubernetes.

Edit This Page

Using CoreDNS for Service Discovery

FEATURE STATE: Kubernetes v1.9 alpha

This feature is currently in a alpha state, meaning:

  • The version names contain alpha (e.g. v1alpha1).
  • Might be buggy. Enabling the feature may expose bugs. Disabled by default.
  • Support for feature may be dropped at any time without notice.
  • The API may change in incompatible ways in a later software release without notice.
  • Recommended for use only in short-lived testing clusters, due to increased risk of bugs and lack of long-term support.

This page describes how to enable CoreDNS instead of kube-dns for service discovery.

Before you begin

You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one by using Minikube, or you can use one of these Kubernetes playgrounds:

Your Kubernetes server must be version v1.9. To check the version, enter kubectl version.

Installing CoreDNS with kubeadm

In Kubernetes 1.9, CoreDNS is available as an alpha feature and may be installed by setting the CoreDNS feature gate to true during kubeadm init:

kubeadm init --feature-gates=CoreDNS=true

This installs CoreDNS instead of kube-dns.

What’s next

You can configure CoreDNS to support many more use cases than kube-dns by modifying the Corefile. For more information, see the CoreDNS site.

Analytics

Create an Issue Edit this Page