Skip to content

Commit

Permalink
Add DigitalOcean AAAA DNS records resolving to workers
Browse files Browse the repository at this point in the history
* Improve the workers "round-robin" DNS FQDN that is created
with each cluster by adding AAAA records
* CNAME's resolving to the DigitalOcean `workers_dns` output
can be followed to find a droplet's IPv4 or IPv6 address
* The CNI portmap plugin doesn't support IPv6. Hosting IPv6
apps is possible, but requires editing the nginx-ingress
addon with `hostNetwork: true`
  • Loading branch information
dghubble committed Oct 28, 2018
1 parent 3bba1ba commit f034ef9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Expand Up @@ -22,6 +22,11 @@ Notable changes between versions.
* Require `terraform-provider-azurerm` v1.17+ (action required)
* Add `primary` field to `ip_configuration` needed by v1.17+ ([#331](https://github.com/poseidon/typhoon/pull/331))

#### DigitalOcean

* Add AAAA DNS records resolving to worker nodes ([#333](https://github.com/poseidon/typhoon/pull/333))
* Hosting IPv6 apps requires editing nginx-ingress with `hostNetwork: true`

#### Addons

* Configure Heapster to scrape Kubelets with bearer token auth ([#323](https://github.com/poseidon/typhoon/pull/323))
Expand Down
3 changes: 2 additions & 1 deletion digital-ocean/container-linux/kubernetes/outputs.tf
Expand Up @@ -3,7 +3,8 @@ output "controllers_dns" {
}

output "workers_dns" {
value = "${digitalocean_record.workers.0.fqdn}"
# Multiple A and AAAA records with the same FQDN
value = "${digitalocean_record.workers-record-a.0.fqdn}"
}

output "controllers_ipv4" {
Expand Down
14 changes: 13 additions & 1 deletion digital-ocean/container-linux/kubernetes/workers.tf
@@ -1,5 +1,5 @@
# Worker DNS records
resource "digitalocean_record" "workers" {
resource "digitalocean_record" "workers-record-a" {
count = "${var.worker_count}"

# DNS zone where record should be created
Expand All @@ -11,6 +11,18 @@ resource "digitalocean_record" "workers" {
value = "${element(digitalocean_droplet.workers.*.ipv4_address, count.index)}"
}

resource "digitalocean_record" "workers-record-aaaa" {
count = "${var.worker_count}"

# DNS zone where record should be created
domain = "${var.dns_zone}"

name = "${var.cluster_name}-workers"
type = "AAAA"
ttl = 300
value = "${element(digitalocean_droplet.workers.*.ipv6_address, count.index)}"
}

# Worker droplet instances
resource "digitalocean_droplet" "workers" {
count = "${var.worker_count}"
Expand Down
9 changes: 6 additions & 3 deletions docs/addons/ingress.md
Expand Up @@ -4,7 +4,7 @@ Nginx Ingress controller pods accept and demultiplex HTTP, HTTPS, TCP, or UDP tr

## AWS

On AWS, a network load balancer (NLB) distributes traffic across a target group of worker nodes running an Ingress controller deployment. Security group rules allow traffic to ports 80 and 443. Health checks ensure only workers with a healthy Ingress controller receive traffic.
On AWS, a network load balancer (NLB) distributes TCP traffic across two target groups (port 80 and 443) of worker nodes running an Ingress controller deployment. Security groups rules allow traffic to ports 80 and 443. Health checks ensure only workers with a healthy Ingress controller receive traffic.

Create the Ingress controller deployment, service, RBAC roles, RBAC bindings, default backend, and namespace.

Expand Down Expand Up @@ -37,7 +37,7 @@ resource "google_dns_record_set" "some-application" {

## Azure

On Azure, a load balancer distributes traffic across a backend pool of worker nodes running an Ingress controller deployment. Security group rules allow traffic to ports 80 and 443. Health probes ensure only workers with a healthy Ingress controller receive traffic.
On Azure, a load balancer distributes traffic across a backend address pool of worker nodes running an Ingress controller deployment. Security group rules allow traffic to ports 80 and 443. Health probes ensure only workers with a healthy Ingress controller receive traffic.

Create the Ingress controller deployment, service, RBAC roles, RBAC bindings, default backend, and namespace.

Expand Down Expand Up @@ -101,7 +101,7 @@ resource "google_dns_record_set" "some-application" {

## Digital Ocean

On Digital Ocean, a DNS A record (e.g. `nemo-workers.example.com`) resolves to each worker[^1] running an Ingress controller DaemonSet on host ports 80 and 443. Firewall rules allow IPv4 and IPv6 traffic to ports 80 and 443.
On Digital Ocean, DNS A and AAAA records (e.g. FQDN `nemo-workers.example.com`) resolve to each worker[^1] running an Ingress controller DaemonSet on host ports 80 and 443. Firewall rules allow IPv4 and IPv6 traffic to ports 80 and 443.

Create the Ingress controller daemonset, service, RBAC roles, RBAC bindings, default backend, and namespace.

Expand All @@ -124,6 +124,9 @@ resource "google_dns_record_set" "some-application" {
}
```

!!! note
Hosting IPv6 apps is possible, but requires editing the nginx-ingress addon to use `hostNetwork: true`.

[^1]: Digital Ocean does offer load balancers. We've opted not to use them to keep the Digital Ocean setup simple and cheap for developers.

## Google Cloud
Expand Down

0 comments on commit f034ef9

Please sign in to comment.