Add DigitalOcean AAAA DNS records resolving to workers

* 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`
This commit is contained in:
Dalton Hubble 2018-10-27 23:01:50 -07:00
parent 3bba1ba0dc
commit f034ef90ae
4 changed files with 26 additions and 5 deletions

View File

@ -22,6 +22,11 @@ Notable changes between versions.
* Require `terraform-provider-azurerm` v1.17+ (action required) * 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)) * 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 #### Addons
* Configure Heapster to scrape Kubelets with bearer token auth ([#323](https://github.com/poseidon/typhoon/pull/323)) * Configure Heapster to scrape Kubelets with bearer token auth ([#323](https://github.com/poseidon/typhoon/pull/323))

View File

@ -3,7 +3,8 @@ output "controllers_dns" {
} }
output "workers_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" { output "controllers_ipv4" {

View File

@ -1,5 +1,5 @@
# Worker DNS records # Worker DNS records
resource "digitalocean_record" "workers" { resource "digitalocean_record" "workers-record-a" {
count = "${var.worker_count}" count = "${var.worker_count}"
# DNS zone where record should be created # DNS zone where record should be created
@ -11,6 +11,18 @@ resource "digitalocean_record" "workers" {
value = "${element(digitalocean_droplet.workers.*.ipv4_address, count.index)}" 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 # Worker droplet instances
resource "digitalocean_droplet" "workers" { resource "digitalocean_droplet" "workers" {
count = "${var.worker_count}" count = "${var.worker_count}"

View File

@ -4,7 +4,7 @@ Nginx Ingress controller pods accept and demultiplex HTTP, HTTPS, TCP, or UDP tr
## AWS ## 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. Create the Ingress controller deployment, service, RBAC roles, RBAC bindings, default backend, and namespace.
@ -37,7 +37,7 @@ resource "google_dns_record_set" "some-application" {
## Azure ## 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. Create the Ingress controller deployment, service, RBAC roles, RBAC bindings, default backend, and namespace.
@ -101,7 +101,7 @@ resource "google_dns_record_set" "some-application" {
## Digital Ocean ## 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. Create the Ingress controller daemonset, service, RBAC roles, RBAC bindings, default backend, and namespace.
@ -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. [^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 ## Google Cloud