From 6173bcf9aa65331d54c4706695e5c623a315601f Mon Sep 17 00:00:00 2001 From: Fabrice Didon Date: Tue, 24 Nov 2020 19:17:31 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'dns/README.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dns/README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/dns/README.md b/dns/README.md index 57699a4..5ab8a16 100644 --- a/dns/README.md +++ b/dns/README.md @@ -1,8 +1,48 @@ # 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: ""** + +Let's try with that Service : ``` apiVersion: v1 @@ -20,3 +60,23 @@ app: nginx 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 +```