The chapter 'Deploying the DNS Cluster Add-on' is updated.
parent
dfb22c395f
commit
1e443750bb
|
@ -1,13 +1,16 @@
|
||||||
# Deploying the DNS Cluster Add-on
|
# 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
|
## The DNS Cluster Add-on
|
||||||
|
|
||||||
Deploy the `coredns` 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
|
> output
|
||||||
|
@ -24,7 +27,7 @@ service/kube-dns created
|
||||||
List the pods created by the `kube-dns` deployment:
|
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
|
> output
|
||||||
|
@ -40,13 +43,13 @@ coredns-699f8ddd77-gtcgb 1/1 Running 0 20s
|
||||||
Create a `busybox` deployment:
|
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:
|
List the pod created by the `busybox` deployment:
|
||||||
|
|
||||||
```
|
```
|
||||||
kubectl get pods -l run=busybox
|
$ kubectl get pods -l run=busybox
|
||||||
```
|
```
|
||||||
|
|
||||||
> output
|
> output
|
||||||
|
@ -59,13 +62,13 @@ busybox-bd8fb7cbd-vflm9 1/1 Running 0 10s
|
||||||
Retrieve the full name of the `busybox` pod:
|
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:
|
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
|
> output
|
||||||
|
|
Loading…
Reference in New Issue