Mise à jour de 'dns/README.md'

This commit is contained in:
Fabrice Didon 2020-11-24 19:17:31 +01:00
parent 24fb435432
commit 6173bcf9aa

View File

@ -1,8 +1,48 @@
# Private DNS installation # Private DNS installation
## Contexte
We want to deploy an internal DNS to serve private domain and that will be able to forward any other requests to another DNS.
## Architecture
We will use CoreDNS (not the cluster internal) to serve those requests.
A etcd cluster will be deployed in statefullset, with PVC, as CoreDNS' backend.
We finally deploy external-dns to handle DNS entry creation and suppression, in Service or Ingress rules.
## Deploy
Pretty straitforward using manifests from 01\* to 04\*.
The CoreDNS configuration is in 04-coredns.yaml :
```
data:
Corefile: |
open-it.intra {
errors
health
log
etcd {
endpoint http://etcd-dns:2379
}
cache 30
prometheus 0.0.0.0:9153
}
. {
forward . 192.168.5.1
cache
}
```
## Testing
We will test by deploying a service type **LoadBalancer** with the annotation :
**external-dns.alpha.kubernetes.io/hostname: "<url|fqdn>"**
Let's try with that Service :
``` ```
apiVersion: v1 apiVersion: v1
@ -20,3 +60,23 @@
app: nginx app: nginx
type: LoadBalancer type: LoadBalancer
``` ```
First, let's retrieve DNS IP :
```
kubectl -n dns get svc coredns
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
coredns LoadBalancer 10.97.35.253 192.168.5.201 53:32585/UDP 1d
```
We can now try DNS resolution
```
$ dig @192.168.5.201 nginx.open-it.intra -short
```
or
```
nslookup nginx.open-it.intra 192.168.5.201
```