2015-07-12 00:04:52 -04:00
|
|
|
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
|
|
|
|
|
|
|
|
|
|
<!-- BEGIN STRIP_FOR_RELEASE -->
|
|
|
|
|
|
2015-07-16 13:02:26 -04:00
|
|
|
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
|
|
|
|
width="25" height="25">
|
|
|
|
|
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
|
|
|
|
width="25" height="25">
|
|
|
|
|
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
|
|
|
|
width="25" height="25">
|
|
|
|
|
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
|
|
|
|
width="25" height="25">
|
|
|
|
|
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
|
|
|
|
width="25" height="25">
|
|
|
|
|
|
|
|
|
|
<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>
|
|
|
|
|
|
|
|
|
|
If you are using a released version of Kubernetes, you should
|
|
|
|
|
refer to the docs that go with that version.
|
|
|
|
|
|
2015-12-14 13:37:38 -05:00
|
|
|
<!-- TAG RELEASE_LINK, added by the munger automatically -->
|
2015-07-16 13:02:26 -04:00
|
|
|
<strong>
|
2015-11-03 13:17:57 -05:00
|
|
|
The latest release of this document can be found
|
|
|
|
|
[here](http://releases.k8s.io/release-1.1/docs/admin/dns.md).
|
2015-07-16 13:02:26 -04:00
|
|
|
|
|
|
|
|
Documentation for other releases can be found at
|
|
|
|
|
[releases.k8s.io](http://releases.k8s.io).
|
|
|
|
|
</strong>
|
|
|
|
|
--
|
2015-07-13 18:15:35 -04:00
|
|
|
|
2015-07-12 00:04:52 -04:00
|
|
|
<!-- END STRIP_FOR_RELEASE -->
|
|
|
|
|
|
|
|
|
|
<!-- END MUNGE: UNVERSIONED_WARNING -->
|
2015-07-17 18:35:41 -04:00
|
|
|
|
2015-01-15 00:54:04 -05:00
|
|
|
# DNS Integration with Kubernetes
|
|
|
|
|
|
2015-07-20 16:45:36 -04:00
|
|
|
As of Kubernetes 0.8, DNS is offered as a [cluster add-on](http://releases.k8s.io/HEAD/cluster/addons/README.md).
|
2015-06-19 08:51:36 -04:00
|
|
|
If enabled, a DNS Pod and Service will be scheduled on the cluster, and the kubelets will be
|
2015-07-17 13:12:08 -04:00
|
|
|
configured to tell individual containers to use the DNS Service's IP to resolve DNS names.
|
2015-01-15 00:54:04 -05:00
|
|
|
|
|
|
|
|
Every Service defined in the cluster (including the DNS server itself) will be
|
|
|
|
|
assigned a DNS name. By default, a client Pod's DNS search list will
|
|
|
|
|
include the Pod's own namespace and the cluster's default domain. This is best
|
|
|
|
|
illustrated by example:
|
|
|
|
|
|
2015-07-20 16:45:36 -04:00
|
|
|
Assume a Service named `foo` in the Kubernetes namespace `bar`. A Pod running
|
2015-01-15 00:54:04 -05:00
|
|
|
in namespace `bar` can look up this service by simply doing a DNS query for
|
|
|
|
|
`foo`. A Pod running in namespace `quux` can look up this service by doing a
|
|
|
|
|
DNS query for `foo.bar`.
|
|
|
|
|
|
|
|
|
|
The cluster DNS server ([SkyDNS](https://github.com/skynetservices/skydns))
|
|
|
|
|
supports forward lookups (A records) and service lookups (SRV records).
|
2014-10-16 16:30:48 -04:00
|
|
|
|
|
|
|
|
## How it Works
|
2015-01-15 00:54:04 -05:00
|
|
|
|
2015-10-10 11:31:26 -04:00
|
|
|
The running DNS pod holds 4 containers - skydns, etcd (a private instance which skydns uses),
|
|
|
|
|
a Kubernetes-to-skydns bridge called kube2sky, and a health check called healthz. The kube2sky process
|
2015-07-20 16:45:36 -04:00
|
|
|
watches the Kubernetes master for changes in Services, and then writes the
|
2015-01-15 00:54:04 -05:00
|
|
|
information to etcd, which skydns reads. This etcd instance is not linked to
|
2015-07-20 16:45:36 -04:00
|
|
|
any other etcd clusters that might exist, including the Kubernetes master.
|
2015-01-15 00:54:04 -05:00
|
|
|
|
|
|
|
|
## Issues
|
|
|
|
|
|
2015-07-20 16:45:36 -04:00
|
|
|
The skydns service is reachable directly from Kubernetes nodes (outside
|
2015-06-05 11:35:17 -04:00
|
|
|
of any container) and DNS resolution works if the skydns service is targeted
|
2015-01-15 00:54:04 -05:00
|
|
|
explicitly. However, nodes are not configured to use the cluster DNS service or
|
|
|
|
|
to search the cluster's DNS domain by default. This may be resolved at a later
|
|
|
|
|
time.
|
|
|
|
|
|
|
|
|
|
## For more information
|
|
|
|
|
|
2015-07-20 03:25:07 -04:00
|
|
|
See [the docs for the DNS cluster addon](http://releases.k8s.io/HEAD/cluster/addons/dns/README.md).
|
2015-05-14 18:12:45 -04:00
|
|
|
|
|
|
|
|
|
2015-07-13 20:13:09 -04:00
|
|
|
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
2015-07-10 15:39:25 -04:00
|
|
|
[]()
|
2015-07-13 20:13:09 -04:00
|
|
|
<!-- END MUNGE: GENERATED_ANALYTICS -->
|