惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
D
Docker
Vercel News
Vercel News
IT之家
IT之家
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
腾讯CDC
Google DeepMind News
Google DeepMind News
I
InfoQ
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
博客园 - Franky
The Cloudflare Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
T
Tenable Blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
Security Latest
Security Latest
H
Hackread – Cybersecurity News, Data Breaches, AI and More
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 聂微东
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google Online Security Blog
Google Online Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
U
Unit 42
The Hacker News
The Hacker News
Martin Fowler
Martin Fowler
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
F
Full Disclosure
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
Project Zero
Project Zero

Discovery on CoreDNS: DNS and Service Discovery

CoreDNS and Apache APISIX open new doors for Service Discovery? Cluster DNS: CoreDNS vs Kube-DNS Scaling CoreDNS in Kubernetes Clusters Deploying Kubernetes with CoreDNS using kubeadm How Queries Are Processed in CoreDNS Custom DNS Entries For Kubernetes CoreDNS for Minikube Why CNCF for CoreDNS? CoreDNS for Kubernetes Service Discovery, Take 2 CoreDNS for Kubernetes Service Discovery
Migration from kube-dns to CoreDNS
sandeep · 2018-05-22 · via Discovery on CoreDNS: DNS and Service Discovery

CoreDNS is currently a Beta feature in Kubernetes and on course to being graduated to General Availability (GA) for Kubernetes 1.11. This means that CoreDNS will be available as a standard in Kubernetes via the installation toolkits such as kubeadm, kube-up, minikube and kops.

This document will guide you to migrating the DNS service from CoreDNS to kube-dns when using the various tools available to spin up a Kubernetes cluster.

Installing CoreDNS via Kubeadm

There is an extensive guide on how to install CoreDNS instead of kube-dns via Kubeadm available here. From Kubernetes v1.10, CoreDNS supports the translation of the kube-dns ConfigMap to CoreDNS ConfigMap. That is, if you had configured stubdomains, upstreamnameservers and federation via the kube-dns ConfigMap, it will now be translated automatically to the equivalent CoreDNS ConfigMap during when choosing to install CoreDNS using kubeadm upgrade.

Stubdomain and upstreamnameserver in kube-dns translates to the proxy in CoreDNS. The federation in kube-dns has an equivalent federation in CoreDNS.

Example ConfigMap of kube-dns.

apiVersion: v1
data:
  federations: |
    {"foo" : "foo.feddomain.com"}
  stubDomains: |
    {"abc.com" : ["1.2.3.4"], "my.cluster.local" : ["2.3.4.5"]}
  upstreamNameservers: |
    ["8.8.8.8", "8.8.4.4"]
kind: ConfigMap
metadata:
  creationTimestamp: 2018-01-22T20:21:56Z
  name: kube-dns
  namespace: kube-system

CoreDNS Corefile after translation.

   .:53 {
        errors
        health
        kubernetes cluster.local  in-addr.arpa ip6.arpa {
           upstream  8.8.8.8 8.8.4.4
           pods insecure
           fallthrough in-addr.arpa ip6.arpa
        }
        federation cluster.local {
           foo foo.feddomain.com
        }
        prometheus :9153
        proxy .  8.8.8.8 8.8.4.4
        cache 30
    }
    abc.com:53 {
        errors
        cache 30
        proxy . 1.2.3.4
    }
    my.cluster.local:53 {
        errors
        cache 30
        proxy . 2.3.4.5
    }

Installing CoreDNS via Minikube.

CoreDNS is available in the addon manager and is disabled by default.

$ minikube addons list
- kube-dns: enabled
- registry: disabled
- registry-creds: disabled
- freshpod: disabled
- addon-manager: enabled
- dashboard: enabled
- coredns: disabled
- heapster: disabled
- efk: disabled
- ingress: disabled
- default-storageclass: enabled
- storage-provisioner: enabled

To enable CoreDNS, run the following command:

NOTE: Be sure to disable kube-dns after enabling CoreDNS. Otherwise, if both CoreDNS and kube-dns are running, queries may randomly hit either CoreDNS or kube-dns.

$ minikube addons enable coredns
coredns was successfully enabled

CoreDNS in kube-up

Kube-up is another way to start a Kubernetes cluster, now mostly used for deploying Kubernetes in GCE for end-to-end (e2e) testing purposes. The environment variable ENABLE_CLUSTER_DNS (default=true) is required to install DNS service. For CoreDNS can be installed as the default DNS service, the environment variable CLUSTER_DNS_CORE_DNS needs to be set to true.

CoreDNS in Kops

Currently, Kops v1.10 is set to include CoreDNS as an option to be installed instead of kube-dns. In order to install CoreDNS in place of kube-dns, we need to specify the provider as CoreDNS in the cluster yaml configuration for Kops.

spec:
  kubeDNS:
    provider: CoreDNS

This will install CoreDNS instead of kube-dns.

Installing CoreDNS via other methods

For users keen to install CoreDNS in place of kube-dns but who are not using kubeadm, minikube, kube-up, or kops, there are instructions in the CoreDNS deployment repository, which will help you to migrate from kube-dns to CoreDNS. Users should delete the kube-dns deployment after deploying CoreDNS. Otherwise, if both CoreDNS and kube-dns are running, queries may randomly hit either CoreDNS or kube-dns.