Tasks

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

Edit This Page

—approvers:

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.

本文解释了如何启用 CoreDNS 来替换 kube-dns 进行服务发现。

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:

To check the version, enter kubectl version.

使用 kubeadm 安装 CoreDNS

在 Kubernetes 1.9 版本中,CoreDNS 可作为 alpha 特性使用, 并可以在 kubeadm init 中通过设置 CoreDNS 特性开关为 true 来进行安装。

kubeadm init --feature-gates=CoreDNS=true

上面的命令安装 CoreDNS 来替换 kube-dns。

What’s next

您可以通过修改 Corefile 来配置 CoreDNS,以支持比 kube-dns 更多的用例。 想了解更多信息,请查看 CoreDNS 网站

Analytics

Create an Issue Edit this Page