Skip to content

Commit 5d3cebf

Browse files
committed
refactor(Makefile): better multi-node support
Our READMEs and Makefile really fall short for multi-node setups. Specifically, we allude to the fact that DNS records will need to be setup, but we don't provide additional info. This commit updates the main README, contrib/ec2, and contrib/rackspace with specific instructions for accessing the controller and router for multi-node setups. Additionally, the Makefile has been refactored so that there aren't separate paths for 1-node and multi-node setups. Now we always start the router, as we have provided instructions regarding DNS in the main README.
1 parent e9eef67 commit 5d3cebf

4 files changed

Lines changed: 26 additions & 75 deletions

File tree

Makefile

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,7 @@ endef
3535
# due to scheduling problems with fleet 0.2.0, start order of components
3636
# is fragile. hopefully this can be changed soon...
3737
ALL_COMPONENTS=builder cache controller database logger registry router
38-
39-
ifeq ($(DEIS_NUM_INSTANCES),1)
40-
export SKIP_ROUTER=false
41-
START_COMPONENTS=registry logger cache database router
42-
else
43-
export SKIP_ROUTER=true
44-
START_COMPONENTS=registry logger cache database
45-
endif
38+
START_COMPONENTS=registry logger cache database router
4639

4740
ALL_UNITS = $(foreach C, $(ALL_COMPONENTS), $(wildcard $(C)/systemd/*))
4841
START_UNITS = $(foreach C, $(START_COMPONENTS), $(wildcard $(C)/systemd/*))
@@ -97,20 +90,7 @@ start: check-fleet
9790
@until fleetctl --strict-host-key-checking=false list-units | egrep -q "deis-builder.+(running|failed|dead)"; do printf "\033[0;33mStatus:\033[0m "; fleetctl --strict-host-key-checking=false list-units | grep "builder" | awk '{printf $$3}'; printf "\r" ; sleep 10; done
9891
$(call check_for_errors)
9992

100-
@# router
101-
@if [ "$$SKIP_ROUTER" = true ]; then \
102-
echo "\033[0;33mYou'll need to configure DNS and start the router manually for multi-node clusters.\033[0m" ; \
103-
echo "\033[0;33mRun 'make start-router' to schedule and start deis-router.\033[0m" ; \
104-
else \
105-
echo "\033[0;33mYour Deis cluster is ready to go! Follow the README to login and use Deis.\033[0m" ; \
106-
fi
107-
108-
start-router: check-fleet
109-
fleetctl --strict-host-key-checking=false submit router/systemd/*
110-
fleetctl --strict-host-key-checking=false start router/systemd/*
111-
$(call echo_yellow,"Use 'make status' to monitor the service and note the IP it has been scheduled to.")
112-
$(call echo_yellow,"Create a wildcard DNS domain which resolves to this host and use that domain when creating clusters/apps in the README.")
113-
$(call echo_yellow,"Your Deis cluster is ready to go! Follow the README to login and use Deis.")
93+
$(call echo_yellow,"Your Deis cluster is ready to go! Continue following the README to login and use Deis.")
11494

11595
status: check-fleet
11696
fleetctl --strict-host-key-checking=false list-units

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,16 @@ Use `make run` to start all Deis containers and attach to their log output. This
7171
$ make run
7272
```
7373

74-
## Additional steps for a multi-node cluster
75-
* Configure local DNS. For a one-node cluster we do this for you: `local.deisapp.com` resolves to the IP of the first VM, 172.17.8.100. Since we cannot know where the `deis-router` container will be running in your cluster, you'll need to setup DNS and resolve a wildcard entry to use for your apps.
76-
* Because of the DNS quandary, we don't start the deis-router component for you. You'll need to start this manually once DNS is setup: `systemctl start deis-router`.
74+
## Configuring DNS for multi-node clusters
75+
For a one-node cluster, both deis-router and deis-controller will run on the same host. For convenience, we've created the DNS record `local.deisapp.com` which resolves to the IP of the first VM, 172.17.8.100.
76+
You can use `local.deisapp.com` to both log into the controller and to access applications that you've deployed (they will be subdomains of `local.deisapp.com`, like `happy-unicorn.local.deisapp.com`).
77+
78+
On a multi-node cluster, however, the router and controller will likely be scheduled on separate machines. Since we cannot know the IP addresses ahead of time, you'll need to setup resolution yourself using your own domain (unfortunately, wildcard hostnames are not permitted in `/etc/hosts`). The records should be as follows:
79+
80+
* `deis.example.org` should resolve to the IP of the machine that runs `deis-controller`
81+
* `*.deis.example.org` (a wildcard DNS entry) should resolve to the IP of the machine that runs `deis-router`
82+
83+
These records are necessary for multi-node Vagrant as well as any other multi-node deployments of Deis (EC2, Rackspace, etc.).
7784

7885
## Testing the cluster
7986
Integration tests and corresponding documentation can be found under the `test/` folder.

contrib/ec2/README.md

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -58,34 +58,17 @@ FLEETCTL_TUNNEL, and issue a `make run` from the project root:
5858
$ ssh-add ~/.ssh/deis
5959
$ export FLEETCTL_TUNNEL=ec2-12-345-678-90.us-west-1.compute.amazonaws.com
6060
$ cd ../.. && make run
61-
The authenticity of host '54.215.248.50:22' can't be established.
62-
RSA key fingerprint is 86:10:74:b9:6a:ee:3b:21:d0:0f:b4:63:cc:10:64:c9.
63-
Are you sure you want to continue connecting (yes/no)? yes
64-
Warning: Permanently added '54.215.248.50:22' (RSA) to the list of known hosts.
65-
Job deis-registry.service started on aec641dc.../172.31.21.4
66-
Job deis-logger.service started on 494dcb6a.../172.31.5.226
67-
Job deis-database.service started on aec641dc.../172.31.21.4
68-
Job deis-cache.service started on aec641dc.../172.31.21.4
69-
Job deis-controller.service started on aec641dc.../172.31.21.4
70-
Job deis-builder.service started on 494dcb6a.../172.31.5.226
71-
Job deis-router.service started on aec641dc.../172.31.21.4
72-
done!
7361
```
62+
The script will deploy Deis and make sure the services start properly.
7463

75-
## Run Deis!
76-
After that, wait for the components to come up, check which host the controller is
77-
running on and register with Deis!
64+
## Configure DNS
65+
While you can reference the controller and hosted applications with public hostnames provided by EC2, it is recommended for ease-of-use that
66+
you configure your own DNS records using a domain you own. See [Configuring DNS for multi-node clusters](../../README.md#configuring-dns-for-multi-node-clusters) for details.
67+
68+
## Use Deis!
69+
After that, register with Deis!
7870
```
79-
$ fleetctl list-units
80-
UNIT LOAD ACTIVE SUB DESC MACHINE
81-
deis-builder.service loaded active running deis-builder d9f1f3ea.../172.31.5.62
82-
deis-cache.service loaded active running deis-cache d9f1f3ea.../172.31.5.62
83-
deis-controller.service loaded active running deis-controller d9f1f3ea.../172.31.5.62
84-
deis-database.service loaded active running deis-database 13c5541b.../172.31.5.61
85-
deis-logger.service loaded active running deis-logger d9f1f3ea.../172.31.5.62
86-
deis-registry.service loaded active running deis-registry 4c263e91.../172.31.24.155
87-
deis-router.service loaded active running deis-router 13c5541b.../172.31.5.61
88-
$ deis register ec2-12-345-678-90.us-west-1.compute.amazonaws.com:8000
71+
$ deis register deis.example.org:8000
8972
username: deis
9073
password:
9174
password (confirm):

contrib/rackspace/README.md

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,35 +54,16 @@ FLEETCTL_TUNNEL, and issue a `make run` from the project root:
5454
```console
5555
$ export FLEETCTL_TUNNEL=23.253.219.94
5656
$ cd ../.. && make run
57-
The authenticity of host '23.253.219.94:22' can't be established.
58-
RSA key fingerprint is ce:3a:c1:3a:ad:11:bd:60:84:8e:60:a8:2f:19:1a:a6.
59-
Are you sure you want to continue connecting (yes/no)? yes
60-
Warning: Permanently added '23.253.219.94:22' (RSA) to the list of known hosts.
61-
Job deis-registry.service scheduled to 73c7d285.../23.253.218.114
62-
Job deis-logger.service scheduled to 21ad134c.../23.253.217.229
63-
Job deis-database.service scheduled to 73c7d285.../23.253.218.114
64-
Job deis-cache.service scheduled to 73c7d285.../23.253.218.114
65-
Job deis-controller.service scheduled to e5c14be6.../23.253.219.94
66-
Job deis-builder.service scheduled to e5c14be6.../23.253.219.94
67-
Job deis-router.service scheduled to 73c7d285.../23.253.218.114
68-
done!
6957
```
58+
The script will deploy Deis and make sure the services start properly.
59+
60+
### Configure DNS
61+
You'll need to configure DNS records so you can access applications hosted on Deis. See [Configuring DNS for multi-node clusters](../../README.md#configuring-dns-for-multi-node-clusters) for details.
7062

7163
### Use Deis!
72-
After that, wait for the components to come up, check which host the controller is
73-
running on and register with Deis!
64+
After that, register with Deis!
7465
```
75-
$ fleetctl list-units
76-
UNIT LOAD ACTIVE SUB DESC MACHINE
77-
deis-builder.service loaded active running deis-builder e5c14be6.../23.253.219.94
78-
deis-cache.service loaded active running deis-cache 73c7d285.../23.253.218.114
79-
deis-controller.service loaded active running deis-controller e5c14be6.../23.253.219.94
80-
deis-database.service loaded active running deis-database 73c7d285.../23.253.218.114
81-
deis-logger.service loaded active running deis-logger 21ad134c.../23.253.217.229
82-
deis-registry.service loaded active running deis-registry 73c7d285.../23.253.218.114
83-
deis-router.service loaded active running deis-router 73c7d285.../23.253.218.114
84-
85-
$ deis register 23.253.219.94:8000
66+
$ deis register deis.example.org:8000
8667
username: deis
8768
password:
8869
password (confirm):

0 commit comments

Comments
 (0)