github.com/enmand/kubernetes@v1.2.0-alpha.0/docs/getting-started-guides/docker-multinode/deployDNS.md (about) 1 <!-- BEGIN MUNGE: UNVERSIONED_WARNING --> 2 3 <!-- BEGIN STRIP_FOR_RELEASE --> 4 5 <img src="http://kubernetes.io/img/warning.png" alt="WARNING" 6 width="25" height="25"> 7 <img src="http://kubernetes.io/img/warning.png" alt="WARNING" 8 width="25" height="25"> 9 <img src="http://kubernetes.io/img/warning.png" alt="WARNING" 10 width="25" height="25"> 11 <img src="http://kubernetes.io/img/warning.png" alt="WARNING" 12 width="25" height="25"> 13 <img src="http://kubernetes.io/img/warning.png" alt="WARNING" 14 width="25" height="25"> 15 16 <h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2> 17 18 If you are using a released version of Kubernetes, you should 19 refer to the docs that go with that version. 20 21 <strong> 22 The latest 1.0.x release of this document can be found 23 [here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/docker-multinode/deployDNS.md). 24 25 Documentation for other releases can be found at 26 [releases.k8s.io](http://releases.k8s.io). 27 </strong> 28 -- 29 30 <!-- END STRIP_FOR_RELEASE --> 31 32 <!-- END MUNGE: UNVERSIONED_WARNING --> 33 34 ## Deploy DNS 35 36 ### Get the template file 37 38 First of all, download the template dns rc and svc file from 39 40 [skydns-rc template](skydns-rc.yaml.in) 41 42 [skydns-svc template](skydns-svc.yaml.in) 43 44 ### Set env 45 46 Then you need to set `DNS_REPLICAS` , `DNS_DOMAIN` , `DNS_SERVER_IP` , `KUBE_SERVER` ENV. 47 48 ``` 49 $ export DNS_REPLICAS=1 50 51 $ export DNS_DOMAIN=cluster.local # specify in startup parameter `--cluster-domain` for containerized kubelet 52 53 $ export DNS_SERVER_IP=10.0.0.10 # specify in startup parameter `--cluster-dns` for containerized kubelet 54 55 $ export KUBE_SERVER=10.10.103.250 # your master server ip, you may change it 56 ``` 57 58 ### Replace the corresponding value in the template. 59 60 ``` 61 $ sed -e "s/{{ pillar\['dns_replicas'\] }}/${DNS_REPLICAS}/g;s/{{ pillar\['dns_domain'\] }}/${DNS_DOMAIN}/g;s/{kube_server_url}/${KUBE_SERVER}/g;" skydns-rc.yaml.in > ./skydns-rc.yaml 62 63 $ sed -e "s/{{ pillar\['dns_server'\] }}/${DNS_SERVER_IP}/g" skydns-svc.yaml.in > ./skydns-svc.yaml 64 ``` 65 66 ### Use `kubectl` to create skydns rc and service 67 68 69 ``` 70 $ kubectl -s "$KUBE_SERVER:8080" --namespace=kube-system create -f ./skydns-rc.yaml 71 72 $ kubectl -s "$KUBE_SERVER:8080" --namespace=kube-system create -f ./skydns-svc.yaml 73 ``` 74 75 ### Test if DNS works 76 77 Follow [this link](../../../cluster/addons/dns/#how-do-i-test-if-it-is-working) to check it out. 78 79 80 81 82 83 <!-- BEGIN MUNGE: GENERATED_ANALYTICS --> 84 []() 85 <!-- END MUNGE: GENERATED_ANALYTICS -->