Skip to content

Commit d4c1938

Browse files
committed
Added documentation for static / bare metal installation.
1 parent 419ae2b commit d4c1938

12 files changed

Lines changed: 181 additions & 34 deletions

contrib/digitalocean/provision-digitalocean-controller.sh

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,24 @@
55
# Retrieve the region-id by using `knife digital_ocean region list`
66
#
77

8+
if [[ -z $1 ]]; then
9+
echo usage: $0 [region]
10+
exit 1
11+
fi
12+
813
function echo_color {
914
echo -e "\033[1m$1\033[0m"
1015
}
1116

12-
function usage {
13-
echo_color "Usage: provision-digitalocean-controller.sh <region-id>"
14-
}
15-
1617
THIS_DIR=$(cd $(dirname $0); pwd) # absolute path
1718
CONTRIB_DIR=$(dirname $THIS_DIR)
1819

19-
if [[ -z $1 ]]; then
20-
usage
21-
exit 1
22-
fi
23-
2420
# check for Deis' general dependencies
2521
if ! $CONTRIB_DIR/check-deis-deps.sh; then
2622
echo 'Deis is missing some dependencies.'
2723
exit 1
2824
fi
2925

30-
echo_color "Provisioning a deis controller on Digital Ocean!"
31-
3226
# connection details for using digital ocean's API
3327
client_id=$DIGITALOCEAN_CLIENT_ID
3428
api_key=$DIGITALOCEAN_API_KEY
@@ -45,14 +39,13 @@ fi
4539
#################
4640
# chef settings #
4741
#################
48-
4942
node_name=deis-controller
5043
run_list="recipe[deis::controller]"
5144
chef_version=11.6.2
5245

53-
##########################
54-
# digital ocean settings #
55-
##########################
46+
#########################
47+
# digitalocean settings #
48+
#########################
5649

5750
# the name of the location we want to work with
5851
region_id=$1
@@ -75,8 +68,7 @@ fi
7568
################
7669
# SSH settings #
7770
################
78-
79-
key_name="deis-controller"
71+
key_name=deis-controller
8072
ssh_key_path=~/.ssh/$key_name
8173

8274
# create ssh keypair and store it
@@ -110,15 +102,15 @@ echo_color "Provisioning $node_name with knife digital_ocean..."
110102

111103
set -x
112104
knife digital_ocean droplet create \
113-
--bootstrap-version $chef_version \
114-
--server-name $node_name \
115-
--image $image_id \
116-
--location $region_id \
117-
--size $size_id \
118-
--ssh-keys $ssh_key_id \
119-
--identity-file $ssh_key_path \
120-
--bootstrap \
121-
--run-list $run_list
105+
--bootstrap-version $chef_version \
106+
--server-name $node_name \
107+
--image $image_id \
108+
--location $region_id \
109+
--size $size_id \
110+
--ssh-keys $ssh_key_id \
111+
--identity-file $ssh_key_path \
112+
--bootstrap \
113+
--run-list $run_list
122114
set +x
123115

124116
# Need Chef admin permission in order to add and remove nodes and clients

contrib/ec2/provision-ec2-controller.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env bash
2+
#
3+
# Usage: ./provision-ec2-controller.sh <region>
4+
#
25

36
if [ -z $1 ]; then
47
echo usage: $0 [region]

contrib/rackspace/provision-rackspace-controller.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env bash
2+
#
3+
# Usage: ./provision-rackspace-controller.sh <region>
4+
#
25

36
if [ -z $1 ]; then
47
echo usage: $0 [region]

contrib/vagrant/provision-controller.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env bash
2+
#
3+
# Usage: ./provision-vagrant-controller.sh
4+
#
25

36
function echo_color {
47
echo -e "\033[1m$1\033[0m"

docs/installation/digitalocean.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
:description: How to install a Deis controller on DigitalOcean and create your private PaaS
33
:keywords: install, installation, deis, controller, setup, digitalocean
44

5+
.. _digitalocean_installation:
6+
57
DigitalOcean Installation
68
=========================
79

docs/installation/ec2.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
:description: How to install a Deis controller on Amazon EC2 and create your private PaaS
33
:keywords: install, installation, deis, controller, setup, amazon, ec2
44

5+
.. _ec2_installation:
6+
57
Amazon EC2 Installation
68
=======================
79

docs/installation/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ Installation
1616
ec2
1717
rackspace
1818
digitalocean
19+
static
1920
vagrant

docs/installation/rackspace.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
:description: How to install a Deis controller on Rackspace and create your private PaaS
33
:keywords: install, installation, deis, controller, setup, rackspace
44

5+
.. _rackspace_installation:
6+
57
Rackspace Installation
68
======================
79

docs/installation/static.rst

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
:title: Bare Metal Installation
2+
:description: How to install a Deis controller on existing hardware and create your private PaaS
3+
:keywords: install, installation, deis, controller, setup, bare metal, hardware
4+
5+
.. _static_installation:
6+
7+
Bare Metal Installation
8+
=======================
9+
10+
.. include:: steps1-2.txt
11+
12+
3. Provision a Deis Controller
13+
------------------------------
14+
15+
To create the controller and nodes, the Deis system expects to find Ubuntu
16+
Linux machines running a Docker-compatible kernel. Ubuntu 12.04.3 LTS 64-bit
17+
is recommended.
18+
19+
The `knife`_ command is used to bootstrap the controller. It should
20+
have been installed by ``bundle install``:
21+
22+
.. code-block:: console
23+
24+
$ knife bootstrap --help
25+
knife bootstrap FQDN (options)
26+
--bootstrap-no-proxy [NO_PROXY_URL|NO_PROXY_IP]
27+
Do not proxy locations for the node being bootstrapped
28+
--bootstrap-proxy PROXY_URL The proxy server for the node being bootstrapped
29+
--bootstrap-version VERSION The version of Chef to install
30+
-N, --node-name NAME The Chef node name for your new node
31+
--server-url URL Chef Server URL
32+
...
33+
34+
Run `knife`_ to create Deis' data bags:
35+
36+
.. code-block:: console
37+
38+
$ # create data bags
39+
$ knife data bag create deis-users 2>/dev/null
40+
Created data_bag[deis-users]
41+
$ knife data bag create deis-formations 2>/dev/null
42+
Created data_bag[deis-formations]
43+
$ knife data bag create deis-apps 2>/dev/null
44+
Created data_bag[deis-apps]
45+
46+
Run `knife`_ again with appropriate arguments to bootstrap an existing instance
47+
with chef and install Deis' server components. This takes several minutes
48+
to complete:
49+
50+
.. code-block:: console
51+
52+
$ # bootstrap the controller with knife
53+
$ knife bootstrap 198.51.100.22 \
54+
> --bootstrap-version 11.6.2 \
55+
> --ssh-user ubuntu \
56+
> --sudo \
57+
> --identity-file ~/.ssh/id_rsa \
58+
> --node-name deis-controller \
59+
> --run-list "recipe[deis::controller]"
60+
Bootstrapping Chef on 198.51.100.22
61+
198.51.100.22 --2013-11-20 15:03:46-- https://www.opscode.com/chef/install.sh
62+
198.51.100.22 HTTP request sent, awaiting response... 200 OK
63+
198.51.100.22 Length: 6790 (6.6K) [application/x-sh]
64+
198.51.100.22 Saving to: `STDOUT'
65+
198.51.100.22
66+
...
67+
198.51.100.22 Chef Client finished, 74 resources updated
68+
198.51.100.22
69+
+ set +x
70+
Please ensure that "deis-controller" is added to the Chef "admins" group.
71+
72+
.. include:: steps3-4.txt
73+
74+
5. Register With the Controller
75+
-------------------------------
76+
77+
Registration will discover SSH keys automatically and use environment
78+
variables to configure supported cloud providers with your credentials.
79+
80+
.. code-block:: console
81+
82+
$ sudo pip install deis
83+
$ deis register http://deis.example.com
84+
username: myuser
85+
password:
86+
password (confirm):
87+
email: myuser@example.com
88+
Registered myuser
89+
Logged in as myuser
90+
91+
Found the following SSH public keys:
92+
1) id_rsa.pub
93+
Which would you like to use with Deis? 1
94+
Uploading /Users/myuser/.ssh/id_rsa.pub to Deis... done
95+
96+
6. Deploy a Formation and App
97+
-----------------------------
98+
99+
Bare metal nodes have the same Docker-compatible requirements as the
100+
controller does: Ubuntu 12.04.3 LTS 64-bit is recommended.
101+
102+
Create a "static" formation:
103+
104+
.. code-block:: console
105+
106+
$ deis formations:create dev --flavor=static
107+
Creating formation... done, created dev
108+
Creating runtime layer... done in 1s
109+
$ # if necessary, update runtime layer contents to access your nodes
110+
$ deis layers:update dev runtime --ssh_username=myuser
111+
112+
Prepare the node for provisioning by the controller:
113+
114+
.. code-block:: console
115+
116+
$ # use some command-line wizardry to capture just the public key
117+
$ ssh_key=$(deis layers:info dev runtime | \
118+
> grep -Eo '\"ssh_public_key\"\: \"(.*)\"' | \
119+
> cut -d\" -f4)
120+
$ authfile=.ssh/authorized_keys
121+
$ tmpfile=/tmp/authorized_keys.tmp
122+
$ # prepend the layer's public key to the node's authorized_keys file
123+
$ ssh myuser@node1.example.com \
124+
> "echo $ssh_key|cat - $authfile > $tmpfile && mv $tmpfile $authfile"
125+
126+
Scale up the formation by adding the existing node:
127+
128+
.. code-block:: console
129+
130+
$ # add the node to the formation
131+
$ deis nodes:create dev node1.example.com --layer=runtime
132+
Creating node for node1.example.com... done in 107s
133+
134+
.. include:: step6.txt

docs/installation/steps1-2.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
*Please note: Deis is still under active development. It should not yet be used in production.*
1+
**PLEASE NOTE:** *Deis is in active development. It should not yet be used in production.*
22

3-
Creating your own PaaS requires provisioning a Deis controller on a cloud
4-
provider of your choice, then registering an account on that controller with
5-
the Deis client.
3+
Creating your own PaaS requires provisioning a
4+
Deis :ref:`Controller <controller>`.
65

7-
Regardless of whether your controller is hosted with Amazon EC2, Rackspace,
8-
or DigitalOcean, it can create and manage nodes on any of those cloud providers.
6+
Regardless of whether you provision a controller on
7+
:ref:`Amazon EC2 <ec2_installation>`,
8+
:ref:`Rackspace <rackspace_installation>`,
9+
:ref:`DigitalOcean <digitalocean_installation>`,
10+
or your own :ref:`bare metal <static_installation>`, it can create and manage
11+
nodes on any of those cloud providers.
912

1013
Prerequisites
1114
-------------
@@ -23,7 +26,7 @@ on a Chef server accessible with `knife`_.
2326

2427
Cloning the default master branch will provide you with the latest development
2528
version of Deis. If you instead want to deploy the latest stable release,
26-
checkout the most recent tag using ``git checkout v0.1.1``, for example.
29+
checkout the most recent tag using ``git checkout v0.3.0``, for example.
2730

2831
2. Configure the Chef Server
2932
----------------------------

0 commit comments

Comments
 (0)