You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Deis clusters, DNS records must be created. The Deis cluster runs multiple routers infront of the Deis controller and apps you deploy, so a [load balancer][] is recommended.
3
+
The Deis Workflow controller and all applications deployed via Workflow are intended (by default) to be accessible as subdomains of the Workflow cluster's domain. For example, assuming `example.com` were a cluster's domain:
4
4
5
-
You can find the IP addresses of your Kubernetes cluster nodes by
6
-
running `kubectl get nodes`.
5
+
* The controller should be accessible at `deis.example.com`
6
+
* Applications should be accessible (by default) at `<application name>.example.com`
7
7
8
-
## Necessary DNS records
8
+
Given that this is the case, the primary objective in configuring DNS is that traffic for all subdomains of a cluster's domain be directed to the cluster node(s) hosting the platform's router component, which is capable of directing traffic within the cluster to the correct endpoints.
9
9
10
-
Deis requires a wildcard DNS record. Assuming `myapps.com` is the top-level domain
11
-
apps will live under:
12
10
13
-
*`*.myapps.com` should have "A" record entries for each of the load balancer's IP addresses
11
+
## With a Load Balancer
14
12
15
-
Apps can then be accessed by browsers at `appname.myapps.com`, and the controller will be available to the Deis client at `deis.myapps.com`.
13
+
Generally, it is recommended that a [load balancer][]be used to direct inbound traffic to one or more routers. In such a case, configuring DNS is as simple as defining a wildcard record in DNS that points to the load balancer.
16
14
17
-
[AWS recommends][] against creating "A" record entries; instead, create a wildcard "CNAME" record entry for the load balancer's DNS name, or use Amazon [Route 53][].
15
+
For example, assuming a domain of `example.com`:
18
16
19
-
These records are necessary for all deployments of Deis other than Vagrant clusters.
17
+
* An `A` record enumerating each of your load balancer(s) IPs (i.e. DNS round-robining)
18
+
* A `CNAME` record referencing an existing fully-qualified domain name for the load balancer
19
+
* Per [AWS' own documentation][AWS recommends], this is the recommended strategy when using AWS Elastic Load Balancers, as ELB IPs may change over time.
20
20
21
-
## DNS without a Load Balancer
21
+
DNS for any applications using a "custom domain" (a fully-qualified domain name that is not a subdomain of the cluster's own domain) can be configured by creating a `CNAME` record that references the wildcard record described above.
22
22
23
-
On some platforms (Vagrant, for instance), a load balancer is not an easy or practical thing to
24
-
provision. In these cases, one can directly identify the public IP of a Kubernetes node that is
25
-
hosting a router pod and use that information to configure DNS or the local `/etc/hosts` file.
26
-
27
-
You can find the IP address of a node using `kubectl`:
23
+
Although it is dependent upon your distribution of Kubernetes and your underlying infrastructure, in many cases, the IP(s) or existing fully-qualified domain name of a load balancer can be determined directly using the `kubectl` tool:
28
24
29
25
```
30
-
$ kubectl get pods --namespace=deis | grep deis-router
31
-
deis-router-ih25q 1/1 Running 0 2h
26
+
$ kubectl describe service deis-router --namespace=deis | grep "LoadBalancer Ingress"
Using the pod name determined through the above, one can
35
-
use `kubectl` to determine what node the pod is running on:
30
+
The `LoadBalancer Ingress` field typically describes an existing domain name or public IP(s). Note that if Kubernetes is able to automatically provision a load balancer for you, it does so asynchronously. If the command shown above is issued very soon after Workflow installation, the load balancer may not exist yet.
36
31
37
-
```
38
-
$ kubectl describe pod deis-router-ih25q --namespace=deis
39
-
```
40
32
41
-
The `Node` field of the response should provide an IP:
33
+
## Without a Load Balancer
42
34
43
-
```
44
-
Node: 10.245.1.3/
45
-
```
35
+
On some platforms (Vagrant, for instance), a load balancer is not an easy or practical thing to provision. In these cases, one can directly identify the public IP of a Kubernetes node that is hosting a router pod and use that information to configure the local `/etc/hosts` file.
36
+
37
+
Because wildcard entries do not work in a local `/etc/hosts` file, using this strategy may result in frequent editing of that file to add fully-qualified subdomains of a cluster for each application added to that cluster. Because of this a more viable option may be to utilize the [xip.io][xip] service.
46
38
47
-
If the IP is public, this can be used to configure DNS or the
48
-
local `/etc/hosts` file.
39
+
In general, for any IP, `a.b.c.d`, the fully-qualified domain name `any-subdomain.a.b.c.d.xip.io` will resolve to the IP `a.b.c.d`. This can be enormously useful.
49
40
50
-
An easy way to configure wildcard DNS is to use [xip.io][] to reference the IP of the node running
51
-
your router. For example:
41
+
To begin, find the node(s) hosting router instances using `kubectl`:
52
42
53
-
$ deis register http://deis.10.245.1.3.xip.io
43
+
```
44
+
$ kubectl describe pod deis-router --namespace=deis | grep Node
Note that xip does not seem to work for AWS ELBs - you will have to use an actual DNS record.
49
+
The command will display information for every router pod. For each, a node name and IP are displayed in the `Node` field. If the IPs appearing in these fields are public, any of these may be used to configure your local `/etc/hosts` file or may be used with [xip.io][xip]. If the IPs shown are not public, further investigation may be needed.
56
50
57
-
Alternatively, in your `/etc/hosts` file, add an entry like this:
51
+
You can list the IP addresses of a node using `kubectl`:
This will get you started, though you may find that you have to manually maintain this file as you
64
-
create and deploy more applications to the cluster.
60
+
Here, the `Addresses` field lists all the node's IPs. If any of them are public, again, they may be used to configure your local `/etc/hosts`file or may be used with [xip.io][xip].
61
+
65
62
66
63
## Testing
67
64
@@ -72,14 +69,19 @@ sent to the Deis controller like so (do not forget the trailing slash!):
72
69
curl http://deis.example.com/v2/
73
70
```
74
71
75
-
Since such requests require authentication, a response such as
76
-
the following is an indicator of success:
72
+
Or:
73
+
74
+
```
75
+
curl http://deis.54.218.85.175.xip.io/v2/
76
+
```
77
+
78
+
79
+
Since such requests require authentication, a response such as the following should be considered an indicator of success:
77
80
78
81
```
79
82
{"detail":"Authentication credentials were not provided."}
Copy file name to clipboardExpand all lines: src/managing-workflow/configuring-load-balancers.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,3 +11,5 @@ These ports need to be open on the load balancers:
11
11
If you want to configure SSL termination on your load balancer, see [Platform SSL](platform-ssl.md).
12
12
13
13
A health check should be configured on the load balancer to send an HTTP request to /healthz at port 9090 on all nodes in the Deis cluster. The health check endpoint returns an HTTP 200. This enables the load balancer to serve traffic to whichever hosts happen to be running the router component at any moment.
14
+
15
+
See [the router component's own documentation](https://github.com/deis/router#front-facing-load-balancer) for further details.
0 commit comments