From 48ed325c56cd4c92114c2e605fc1f9929e7e84c9 Mon Sep 17 00:00:00 2001 From: saidst Date: Thu, 12 Dec 2019 11:37:19 +0100 Subject: [PATCH 1/3] added details for configuring nginx-ingress-controller in azure private dns tutorial. --- docs/tutorials/azure-private-dns.md | 49 ++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/docs/tutorials/azure-private-dns.md b/docs/tutorials/azure-private-dns.md index 5e7bf917d..58d930fdf 100644 --- a/docs/tutorials/azure-private-dns.md +++ b/docs/tutorials/azure-private-dns.md @@ -1,20 +1,48 @@ - # Set up ExternalDNS for Azure Private DNS -This tutorial describes how to setup ExternalDNS for managing records in Azure Private DNS. -It assumes to deploy ExternalDNS as a container Kubernetes. - +This tutorial describes how to set up ExternalDNS for managing records in Azure Private DNS. It comprises of the following steps: -1) Provision Azure Private DNS -2) Configure service principal for managing the zone -3) Deploy ExternalDNS +1) Install NGINX Ingress Controller +2) Provision Azure Private DNS +3) Configure service principal for managing the zone +4) Deploy ExternalDNS + +Everything will be deployed on Kubernetes. +Therefore, please see the subsequent prerequisites. ## Prerequisites -- Azure Kubernetes Service available -- nginx-ingress-controller incl. `--publish-service=namespace/nginx-ingress-controller-svcname` available +- Azure Kubernetes Service is deployed and ready - [Azure CLI 2.0](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) and `kubectl` installed on the box to execute the subsequent steps +## Install NGINX Ingress Controller + +Helm is used to deploy the ingress controller. + +We employ the popular chart [stable/nginx-ingress](https://github.com/helm/charts/tree/master/stable/nginx-ingress). + +``` +helm install stable/nginx-ingress \ + --name nginx-ingress \ + --set controller.publishService.enabled=true +``` + +The parameter `controller.publishService.enabled` needs to be set to `true.` + +It will make the ingress controller update the endpoint records of ingress-resources to contain the external-ip of the loadbalancer serving the ingress-controller. +This is crucial as ExternalDNS reads those endpoints records when creating DNS-Records from ingress-resources. +In the subsequent parameter we will make use of this. If you don't want to work with ingress-resources in your later use, you can leave the parameter out. + +If you do not want to deploy the ingress controller with Helm, ensure to pass the following cmdline-flags to it through the mechanism of your choice: + +``` +flags: +--publish-service=/ +--update-status=true (default-value) + +example: +./nginx-ingress-controller --publish-service=default/nginx-ingress-controller +``` ## Provision Azure Private DNS @@ -106,8 +134,7 @@ Azure-CLI features functionality for automatically maintaining this file for AKS Then apply one of the following manifests depending on whether you use RBAC or not. -The credentials of the service principal are provided to ExternalDNS as environment-variables. -At the end of this section, we additionally describe how to provide them as a _file_. +The credentials of the service principal are provided to ExternalDNS as environment-variables. ### Manifest (for clusters without RBAC enabled) ```yaml From c66576112baaa83d699a1d75144ad4bd9b698919 Mon Sep 17 00:00:00 2001 From: saidst Date: Tue, 17 Dec 2019 19:43:38 +0100 Subject: [PATCH 2/3] added example for simple check of correct ingress-controller configuration. --- docs/tutorials/azure-private-dns.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/tutorials/azure-private-dns.md b/docs/tutorials/azure-private-dns.md index 58d930fdf..9f191ef3e 100644 --- a/docs/tutorials/azure-private-dns.md +++ b/docs/tutorials/azure-private-dns.md @@ -22,7 +22,7 @@ Helm is used to deploy the ingress controller. We employ the popular chart [stable/nginx-ingress](https://github.com/helm/charts/tree/master/stable/nginx-ingress). ``` -helm install stable/nginx-ingress \ +$ helm install stable/nginx-ingress \ --name nginx-ingress \ --set controller.publishService.enabled=true ``` @@ -33,6 +33,18 @@ It will make the ingress controller update the endpoint records of ingress-resou This is crucial as ExternalDNS reads those endpoints records when creating DNS-Records from ingress-resources. In the subsequent parameter we will make use of this. If you don't want to work with ingress-resources in your later use, you can leave the parameter out. +Verify the correct propagation of the loadbalancer's ip by listing the ingresses. +``` +$ kubectl get ingress +``` +The address column should contain the ip for each ingress. ExternalDNS will pick up exactly this piece of information. +``` +NAME HOSTS ADDRESS PORTS AGE +nginx1 sample1.aks.com 52.167.195.110 80 6d22h +nginx2 sample2.aks.com 52.167.195.110 80 6d21h +``` + + If you do not want to deploy the ingress controller with Helm, ensure to pass the following cmdline-flags to it through the mechanism of your choice: ``` From a567ac58d808b881e146305b4ededaea347ec528 Mon Sep 17 00:00:00 2001 From: saidst Date: Fri, 20 Dec 2019 09:00:38 +0100 Subject: [PATCH 3/3] changed intending. --- docs/tutorials/azure-private-dns.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/azure-private-dns.md b/docs/tutorials/azure-private-dns.md index 9f191ef3e..63999a380 100644 --- a/docs/tutorials/azure-private-dns.md +++ b/docs/tutorials/azure-private-dns.md @@ -3,7 +3,7 @@ This tutorial describes how to set up ExternalDNS for managing records in Azure Private DNS. It comprises of the following steps: -1) Install NGINX Ingress Controller +1) Install NGINX Ingress Controller 2) Provision Azure Private DNS 3) Configure service principal for managing the zone 4) Deploy ExternalDNS