Skip to content

Latest commit

 

History

History
73 lines (49 loc) · 2.36 KB

File metadata and controls

73 lines (49 loc) · 2.36 KB

WARNING WARNING WARNING WARNING WARNING

PLEASE NOTE: This document applies to the HEAD of the source tree

If you are using a released version of Kubernetes, you should refer to the docs that go with that version.

The latest release of this document can be found [here](http://releases.k8s.io/release-1.1/docs/getting-started-guides/docker-multinode/deployDNS.md).

Documentation for other releases can be found at releases.k8s.io.

Deploy DNS on docker and docker-multinode

Get the template file

First of all, download the dns template

skydns template

Set environment variables

Then you need to set DNS_REPLICAS, DNS_DOMAIN and DNS_SERVER_IP envs

$ export DNS_REPLICAS=1

$ export DNS_DOMAIN=cluster.local # specify in startup parameter `--cluster-domain` for containerized kubelet 

$ export DNS_SERVER_IP=10.0.0.10  # specify in startup parameter `--cluster-dns` for containerized kubelet 

Replace the corresponding value in the template and create the pod

$ sed -e "s/{{ pillar\['dns_replicas'\] }}/${DNS_REPLICAS}/g;s/{{ pillar\['dns_domain'\] }}/${DNS_DOMAIN}/g;s/{{ pillar\['dns_server'\] }}/${DNS_SERVER_IP}/g" skydns.yaml.in > ./skydns.yaml

# If the kube-system namespace isn't already created, create it
$ kubectl get ns
$ kubectl create -f ./kube-system.yaml

$ kubectl create -f ./skydns.yaml

Test if DNS works

Follow this link to check it out.

Analytics