external-dns

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

README

External DNS

Build Status Coverage Status GitHub release

ExternalDNS synchronizes exposed Services and Ingresses with cloud DNS providers.

Motivation

Inspired by Kubernetes' cluster-internal DNS server ExternalDNS intends to make Kubernetes resources discoverable via public DNS servers. Similarly to KubeDNS it retrieves a list of resources from the Kubernetes API, such as Services and Ingresses, to determine a desired list of DNS records. However, unlike KubeDNS it's not a DNS server itself but merely configures other DNS providers accordingly, e.g. AWS Route53 or Google CloudDNS.

In a broader sense, it allows you to control DNS records dynamically via Kubernetes resources in a DNS provider agnostic way.

Getting started

ExternalDNS' current release is v0.1 which allows to keep a managed zone in Google's CloudDNS service synchronized with Services of type=LoadBalancer in your cluster.

In this release ExternalDNS is limited to a single managed zone and takes full ownership of it. That means if you have any existing records in that zone they will be removed. We encourage you to try out ExternalDNS in its own zone first to see if that model works for you. However, ExternalDNS, by default, runs in dryRun mode and won't make any changes to your infrastructure. So, as long as you don't change that flag, you're safe.

Make sure you meet the following prerequisites:

  • You have a local Go 1.7+ development environment.
  • You have access to a Google project with the DNS API enabled.
  • You have access to a Kubernetes cluster that supports exposing Services, e.g. GKE.
  • You have a properly setup, unused and empty hosted zone in Google CloudDNS.

First, get ExternalDNS.

$ go get -u github.com/kubernetes-incubator/external-dns

Run an application and expose it via a Kubernetes Service.

$ kubectl run nginx --image=nginx --replicas=1 --port=80
$ kubectl expose deployment nginx --port=80 --target-port=80 --type=LoadBalancer

Annotate the Service with your desired external DNS name. Make sure to change example.org to your domain and that it includes the trailing dot.

$ kubectl annotate service nginx "external-dns.alpha.kubernetes.io/hostname=nginx.example.org."

Run a single sync loop of ExternalDNS locally. Make sure to change the Google project to one you control and the zone identifier to an unused and empty hosted zone in that project's Google CloudDNS.

$ external-dns --zone example-org --provider google --google-project example-project --source service --once

This should output the DNS records it's going to modify to match the managed zone with the DNS records you desire.

Once you're satisfied with the result you can run ExternalDNS like you would run it in your cluster: as a control loop and not in dryRun mode.

$ external-dns --zone example-org --provider google --google-project example-project --source service --dry-run=false

Check that ExternalDNS created the desired DNS record for your service and that it points to its load balancer's IP. Then try to resolve it.

$ dig +short nginx.example.org.
104.155.60.49

Now you can experiment and watch how ExternalDNS makes sure that your DNS records are configured as desired. Here are a couple of things you can try out:

  • Change the desired hostname by modifying the Service's annotation.
  • Recreate the Service and see that the DNS record will be updated to point to the new load balancer IP.
  • Add another Service to create more DNS records.
  • Remove Services to clean up your managed zone.

The tutorials section contains examples including Ingress resources and show how to setup ExternalDNS in different environments, such as other cloud providers and alternative ingress controllers.

Roadmap

ExternalDNS was built with extensibility in mind. Adding and experimenting with new DNS providers and sources of desired DNS records should be as easy as possible. In addition, it should also be possible to modify how ExternalDNS behaves, e.g. whether it should add but must never delete records.

Furthermore, we're working on an ownership system that allows ExternalDNS to keep track of the records it created and will allow it to never modify records it doesn't have control over.

Here's a rough outline on what is to come:

v0.1
  • Support for Google CloudDNS
  • Support for Kubernetes Services
v0.2
  • Support for AWS Route53
  • Support for Kubernetes Ingresses
v0.3
  • Support for AWS Route53 via ALIAS
  • Support for multiple zones
  • Ownership System
v1.0

The FAQ contains additional information and addresses several questions about key concepts of ExternalDNS.

Also have a look at the milestones to get an idea of where we currently stand.

Yet to be defined
  • Support for CoreDNS and Azure DNS
  • Support for record weights
  • Support for different behavioral policies
  • Support for Services with type=NodePort
  • Support for TPRs
  • Support for more advanced DNS record configurations

Contributing

We encourage you to get involved with ExternalDNS, as users as well as contributors. Read the contributing guidelines and have a look at the contributing docs to learn about building the project, the project structure and the purpose of each package.

Feel free to reach out to us on the Kubernetes slack in the #sig-network channel.

Heritage

ExternalDNS is an effort to unify the following similar projects in order to bring the Kubernetes community an easy and predictable way of managing DNS records across cloud providers based on their Kubernetes resources.

Kubernetes Incubator

This is a Kubernetes Incubator project. The project was established 2017-Feb-9 (initial announcement here). The incubator team for the project is:

  • Sponsor: sig-network
  • Champion: Tim Hockin (@thockin)
  • SIG: sig-network

For more information about sig-network such as meeting times and agenda, check out the community site.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL