|
| 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 |
0 commit comments