Add pods DNS resolution for external names

pull/582/head
Nemo 2020-06-27 20:57:27 +02:00
parent 7f3fb70d29
commit c847d01b74
3 changed files with 15 additions and 2 deletions

View File

@ -61,6 +61,7 @@ data:
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
forward . /etc/resolv.conf
cache 30
loop
reload

View File

@ -35,7 +35,7 @@ Verify if swap is enabled:
sudo swapon --show
```
If output is empthy then swap is not enabled. If swap is enabled run the following command to disable swap immediately:
If output is empty then swap is not enabled. If swap is enabled run the following command to disable swap immediately:
```bash
sudo swapoff -a

View File

@ -4,10 +4,22 @@ In this lab you will deploy the [DNS add-on](https://kubernetes.io/docs/concepts
## The DNS Cluster Add-on
Get the CoreDNS yaml:
```bash
wget https://storage.googleapis.com/kubernetes-the-hard-way/coredns.yaml
```
Edit the `coredns.yaml` file to change CoreDNS configuration to enable DNS resolution for external name:
```bash
sed '/.*prometheus :9153/a \ \ \ \ \ \ \ \ forward . /etc/resolv.conf' coredns.yaml
```
Deploy the `coredns` cluster add-on:
```bash
kubectl apply -f https://storage.googleapis.com/kubernetes-the-hard-way/coredns.yaml
kubectl apply -f coredns.yaml
```
> Output: