From 6a1cc91477e25f9d7f428e89c69f71c75ed1b72d Mon Sep 17 00:00:00 2001 From: janeczku Date: Fri, 27 Jan 2017 15:06:19 +0100 Subject: [PATCH] Add DigitalOcean DNS template --- infra-templates/digitalocean-dns/0/README.md | 48 +++++++++++++ .../digitalocean-dns/0/docker-compose.yml | 13 ++++ .../digitalocean-dns/0/rancher-compose.yml | 34 +++++++++ .../catalogIcon-digitalocean-dns.svg | 72 +++++++++++++++++++ infra-templates/digitalocean-dns/config.yml | 7 ++ 5 files changed, 174 insertions(+) create mode 100644 infra-templates/digitalocean-dns/0/README.md create mode 100644 infra-templates/digitalocean-dns/0/docker-compose.yml create mode 100644 infra-templates/digitalocean-dns/0/rancher-compose.yml create mode 100644 infra-templates/digitalocean-dns/catalogIcon-digitalocean-dns.svg create mode 100644 infra-templates/digitalocean-dns/config.yml diff --git a/infra-templates/digitalocean-dns/0/README.md b/infra-templates/digitalocean-dns/0/README.md new file mode 100644 index 0000000..a808387 --- /dev/null +++ b/infra-templates/digitalocean-dns/0/README.md @@ -0,0 +1,48 @@ +## DigitalOcean DNS + +Rancher External DNS service powered by DigitalOcean + +#### Changelog + +Initial version + +#### Usage + +##### DigitalOcean DNS record TTL +The DigitalOcean API currently does not support per-record TTL setting. You should configure the global TTL setting for the domain manually and set it to a low value (e.g. 60). + +##### Limitation when running the service on multiple Rancher servers + +When running multiple instances of the External DNS service configured to use the same domain name, then only one of them can run in the "Default" environment of a Rancher server instance. + +##### Supported host labels + +`io.rancher.host.external_dns_ip` +Override the IP address used in DNS records for containers running on the host. Defaults to the IP address the host is registered with in Rancher. + +`io.rancher.host.external_dns` +Accepts 'true' (default) or 'false' +When this is set to 'false' no DNS records will ever be created for containers running on this host. + +##### Supported service labels + +`io.rancher.service.external_dns` +Accepts 'always', 'never' or 'auto' (default) +- `always`: Always create DNS records for this service +- `never`: Never create DNS records for this service +- `auto`: Create DNS records for this service if it exposes ports on the host + +##### Custom DNS name template + +By default DNS entries are named `...`. +You can specify a custom name template used to construct the subdomain part (left of the domain/zone name) of the DNS records. The following placeholders are supported: + +* `%{{service_name}}` +* `%{{stack_name}}` +* `%{{environment_name}}` + +**Example:** + +`%{{stack_name}}-%{{service_name}}.statictext` + +Make sure to only use characters in static text and separators that your provider allows in DNS names. diff --git a/infra-templates/digitalocean-dns/0/docker-compose.yml b/infra-templates/digitalocean-dns/0/docker-compose.yml new file mode 100644 index 0000000..22ca97f --- /dev/null +++ b/infra-templates/digitalocean-dns/0/docker-compose.yml @@ -0,0 +1,13 @@ +digitalocean: + image: rancher/external-dns:v0.6.2 + command: -provider=digitalocean + expose: + - 1000 + environment: + DO_PAT: ${DO_PAT} + ROOT_DOMAIN: ${ROOT_DOMAIN} + NAME_TEMPLATE: ${NAME_TEMPLATE} + TTL: 300 + labels: + io.rancher.container.create_agent: "true" + io.rancher.container.agent.role: "external-dns" diff --git a/infra-templates/digitalocean-dns/0/rancher-compose.yml b/infra-templates/digitalocean-dns/0/rancher-compose.yml new file mode 100644 index 0000000..aa72b16 --- /dev/null +++ b/infra-templates/digitalocean-dns/0/rancher-compose.yml @@ -0,0 +1,34 @@ +.catalog: + name: "DigitalOcean DNS" + version: "v0.6.2-rancher1" + description: "Rancher External DNS service powered by DigitalOcean" + minimum_rancher_version: v1.2.0-pre4-rc1 + questions: + - variable: "DO_PAT" + label: "DigitalOcean Personal Access Token" + description: "Enter your personal access token" + type: "string" + required: true + - variable: "ROOT_DOMAIN" + label: "Domain Name" + description: "The domain name managed by DigitalOcean." + type: "string" + required: true + - variable: "NAME_TEMPLATE" + label: "DNS Name Template" + description: | + Name template used to construct the subdomain part (left of the domain) of the DNS record names. + Supported placeholders: %{{service_name}}, %{{stack_name}}, %{{environment_name}}. + By default DNS entries will be named '...'. + type: "string" + default: "%{{service_name}}.%{{stack_name}}.%{{environment_name}}" + required: false + +digitalocean: + health_check: + port: 1000 + interval: 5000 + unhealthy_threshold: 3 + request_line: GET / HTTP/1.0 + healthy_threshold: 2 + response_timeout: 2000 diff --git a/infra-templates/digitalocean-dns/catalogIcon-digitalocean-dns.svg b/infra-templates/digitalocean-dns/catalogIcon-digitalocean-dns.svg new file mode 100644 index 0000000..27c4809 --- /dev/null +++ b/infra-templates/digitalocean-dns/catalogIcon-digitalocean-dns.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/infra-templates/digitalocean-dns/config.yml b/infra-templates/digitalocean-dns/config.yml new file mode 100644 index 0000000..33b917f --- /dev/null +++ b/infra-templates/digitalocean-dns/config.yml @@ -0,0 +1,7 @@ +name: DigitalOcean DNS +description: | + Rancher External DNS service powered by DigitalOcean +version: v0.6.2-rancher1 +category: External DNS +labels: + io.rancher.orchestration.supported: 'cattle,mesos,swarm,kubernetes'