mirror of
https://github.com/kelseyhightower/kubernetes-the-hard-way.git
synced 2025-12-15 17:28:58 +03:00
Add pods DNS resolution for external names
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user