Kubernetes DNS Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 37: Line 37:
Note that <code>kube-dns</code> seems to be both the name of the Kubernetes [[#DNS_Service|DNS service]] and the name of a backing provider.
Note that <code>kube-dns</code> seems to be both the name of the Kubernetes [[#DNS_Service|DNS service]] and the name of a backing provider.
==SkyDNS==
==SkyDNS==
-----------


==Services and Naming==
==Services and Naming==

Revision as of 06:14, 20 September 2020

Internal

Overview

Each Kubernetes cluster runs its own DNS service. The DNS service is exposed as a kube-dns Kubernetes ClusterIP service, running in the "kube-system" namespace. The service is backed by two coredns highly-available pods, also deployed in the "kube-system" namespace.

The DNS Service

Each Kubernetes cluster runs an internal DNS service. The DNS service is exposed as a regular Kubernetes ClusterIP service, deployed in the "kube-system" namespace, which in turn exposes the Kubernetes internal DNS server:

NAME       TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                  AGE
kube-dns   ClusterIP   10.96.0.10   <none>        53/UDP,53/TCP,9153/TCP   49d

The static ClusterIP address allocated to the DNS service (10.96.0.10) is hardcoded into every pod in the cluster, allowing the pods to resolve service names.

Every time a new Kubernetes service is deployed, the Kubernetes cluster automatically updates the internal database with service name to ClusterIP address mappings, making the ClusterIP address of the new service dynamically available to all other pods in the cluster. The mechanism is explained in detail in:

Services and DNS

StatefulSets and the individual pods managed by a StatefulSet are also registered with the DNS service.

TODO

DNS Operations

DNS Implementation Details

CoreDNS

NAME                         READY   STATUS    RESTARTS   AGE
coredns-5644d7b6d9-kcxt6     1/1     Running   0          8h
coredns-5644d7b6d9-mztf9     1/1     Running   0          8h

kube-dns

Note that kube-dns seems to be both the name of the Kubernetes DNS service and the name of a backing provider.

SkyDNS

Services and Naming