From 5d3926bdfff6ca5117079d6b3878ed73da1a5f3e Mon Sep 17 00:00:00 2001 From: Martin Linkhorst Date: Thu, 10 Aug 2017 20:23:55 +0200 Subject: [PATCH] docs: document how to configure sources via env vars (#310) --- docs/faq.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/docs/faq.md b/docs/faq.md index 8224f430b..a3b1bad33 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -136,3 +136,59 @@ You need to add either https://www.googleapis.com/auth/ndev.clouddns.readwrite o ### How can I run ExternalDNS under a specific GCP Service Account, e.g. to access DNS records in other projects? Have a look at https://github.com/linki/mate/blob/v0.6.2/examples/google/README.md#permissions + +### How do I configure multiple Sources via environment variables? (also applies to domain filters) + +Separate the individual values via a line break. The equivalent of `--source=service --source=ingress` would be `service\ningress`. However, it can be tricky do define that depending on your environment. The following examples work (zsh): + +Via docker: + +```console +$ docker run \ + -e EXTERNAL_DNS_SOURCE=$'service\ningress' \ + -e EXTERNAL_DNS_PROVIDER=google \ + -e EXTERNAL_DNS_DOMAIN_FILTER=$'foo.com\nbar.com' \ + registry.opensource.zalan.do/teapot/external-dns:v0.4.2 +time="2017-08-08T14:10:26Z" level=info msg="config: &{Master: KubeConfig: Sources:[service ingress] Namespace: ... +``` + +Locally: + +```console +$ export EXTERNAL_DNS_SOURCE=$'service\ningress' +$ external-dns --provider=google +INFO[0000] config: &{Master: KubeConfig: Sources:[service ingress] Namespace: ... +``` + +``` +$ EXTERNAL_DNS_SOURCE=$'service\ningress' external-dns --provider=google +INFO[0000] config: &{Master: KubeConfig: Sources:[service ingress] Namespace: ... +``` + +In a Kubernetes manifest: + +```yaml +spec: + containers: + - name: external-dns + args: + - --provider=google + env: + - name: EXTERNAL_DNS_SOURCE + value: "service\ningress" +``` + +Or preferably: + +```yaml +spec: + containers: + - name: external-dns + args: + - --provider=google + env: + - name: EXTERNAL_DNS_SOURCE + value: |- + service + ingress +```