From 1e443750bbfc2c9fc409b67a922ac299395cfd4c Mon Sep 17 00:00:00 2001 From: Pick1a1username <20301273+Pick1a1username@users.noreply.github.com> Date: Sun, 17 Feb 2019 19:09:20 +0900 Subject: [PATCH] The chapter 'Deploying the DNS Cluster Add-on' is updated. --- docs/12-dns-addon.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/12-dns-addon.md b/docs/12-dns-addon.md index 67c5e5b..603b5e9 100644 --- a/docs/12-dns-addon.md +++ b/docs/12-dns-addon.md @@ -1,13 +1,16 @@ # Deploying the DNS Cluster Add-on -In this lab you will deploy the [DNS add-on](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/) which provides DNS based service discovery, backed by [CoreDNS](https://coredns.io/), to applications running inside the Kubernetes cluster. +In this chapter, you will deploy the [DNS add-on](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/) which provides DNS based service discovery, backed by [CoreDNS](https://coredns.io/), to applications running inside the Kubernetes cluster. + +**All procedures in this chapter should be done in `client-1`.** + ## The DNS Cluster Add-on Deploy the `coredns` cluster add-on: ``` -kubectl apply -f https://storage.googleapis.com/kubernetes-the-hard-way/coredns.yaml +$ kubectl apply -f https://storage.googleapis.com/kubernetes-the-hard-way/coredns.yaml ``` > output @@ -24,7 +27,7 @@ service/kube-dns created List the pods created by the `kube-dns` deployment: ``` -kubectl get pods -l k8s-app=kube-dns -n kube-system +$ kubectl get pods -l k8s-app=kube-dns -n kube-system ``` > output @@ -40,13 +43,13 @@ coredns-699f8ddd77-gtcgb 1/1 Running 0 20s Create a `busybox` deployment: ``` -kubectl run busybox --image=busybox:1.28 --command -- sleep 3600 +$ kubectl run busybox --image=busybox:1.28 --command -- sleep 3600 ``` List the pod created by the `busybox` deployment: ``` -kubectl get pods -l run=busybox +$ kubectl get pods -l run=busybox ``` > output @@ -59,13 +62,13 @@ busybox-bd8fb7cbd-vflm9 1/1 Running 0 10s Retrieve the full name of the `busybox` pod: ``` -POD_NAME=$(kubectl get pods -l run=busybox -o jsonpath="{.items[0].metadata.name}") +$ POD_NAME=$(kubectl get pods -l run=busybox -o jsonpath="{.items[0].metadata.name}") ``` Execute a DNS lookup for the `kubernetes` service inside the `busybox` pod: ``` -kubectl exec -ti $POD_NAME -- nslookup kubernetes +$ kubectl exec -ti $POD_NAME -- nslookup kubernetes ``` > output