|
6 | 6 |
|
7 | 7 | Provision a Controller |
8 | 8 | ====================== |
9 | | -The `controller` is the brains of a Deis platform. |
10 | | -There are two ways to provision a controller: automatically or manually. |
11 | | - |
12 | | -Automatic Provisioning |
13 | | ----------------------- |
14 | | -The community maintains shell scripts that automate the provisioning |
15 | | -of Deis controllers on different cloud providers. |
16 | | -In addition to launching the controller itself, these scripts also |
17 | | -use optimized base images, |
18 | | -generate SSH keys, firewall configs and other cloud infrastructure |
19 | | -per Deis best practices. |
20 | | - |
21 | | -You can find instructions on automatic provisioning for: |
22 | | - |
23 | | - * `EC2`_ |
24 | | - * `Rackspace`_ |
25 | | - * `Digital Ocean`_ |
26 | | - |
27 | | -Please note that even with automatic provisioning, you will still have to |
28 | | -`add the controller to the admins group`_. |
29 | | - |
30 | | -Manual Provisioning |
31 | | -------------------- |
32 | | -If you want your controller on bare metal, a different cloud provider, |
33 | | -or would just rather provision things manually --no problem! |
34 | | -Just remember with manual provisioning, you are in charge of: |
35 | | - |
36 | | - * Ensuring system requirements are met |
37 | | - * SSH key generation and distribution |
38 | | - * Network configuration |
39 | | - |
40 | | -.. important:: System Requirements |
41 | | - Most controllers require at least 2GB of system memory and 100GB of storage |
42 | | - |
43 | | -The general process for manual provisioning involves: |
44 | | - |
45 | | - #. Boot a target host that meets system requirements |
46 | | - #. Make sure the target host is accessible over SSH from your workstation |
47 | | - #. Use ``knife bootstrap`` to provision the controller on the target host |
48 | | - |
49 | | -Here is an example ``knife bootstrap`` command: |
50 | | - |
51 | | -.. code-block:: console |
52 | | -
|
53 | | - $ knife bootstrap 198.51.100.22 \ |
54 | | - > --bootstrap-version 11.8.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 | | -
|
70 | | -Please note the ``knife bootstrap`` command can take several minutes to complete. |
71 | | - |
72 | | -Add Controller to Admins Group |
73 | | ------------------------------- |
74 | | -Whether you used automatic or manual provisioning, |
75 | | -you must add "deis-controller" to the "admins" group on the Chef Server. |
76 | | - |
77 | | -Hosted Chef |
78 | | -~~~~~~~~~~~ |
79 | | -For Hosted Chef, visit the `OpsCode management interface`_ to add |
80 | | -"deis-controller" to the "admins" group. These `steps`_ describe specifically |
81 | | -how to add users to groups in the management interface. |
82 | | - |
83 | | -Open Source Chef |
84 | | -~~~~~~~~~~~~~~~~ |
85 | | - |
86 | | -For Open Source Chef, use the knife cli tool. First, set the EDITOR environment |
87 | | -variable to your favourite text editor: |
88 | | - |
89 | | -``$ export EDITOR=vim`` |
90 | | - |
91 | | -Now issue the command to edit the "deis-controller" user. |
92 | | - |
93 | | -``$ knife client edit deis-controller`` |
94 | | - |
95 | | -and update the 'admin' key to 'true'. The updated content should look similar to this. |
96 | | - |
97 | | -.. code-block:: json |
98 | | -
|
99 | | - { |
100 | | - "name": "deis-controller", |
101 | | - "public_key": "-----BEGIN PUBLIC KEY-----\nMaa...QAB\n-----END PUBLIC KEY-----\n", |
102 | | - "admin": true, |
103 | | - "json_class": "Chef::ApiClient", |
104 | | - "chef_type": "client" |
105 | | - } |
106 | | -
|
107 | | -Save and close the file. The "deis-controller" user is now in the "admins" group. |
108 | | - |
109 | | -.. important:: |
110 | | - If you skip adding "deis-controller" to the Chef "admins" group, you will |
111 | | - receive errors when scaling down nodes, as the controller will not have |
112 | | - permission to delete "client" and "node" records from the Chef Server. |
113 | | - |
114 | | -.. _`EC2`: https://github.com/opdemand/deis/tree/master/contrib/ec2#readme |
115 | | -.. _`Rackspace`: https://github.com/opdemand/deis/tree/master/contrib/rackspace#readme |
116 | | -.. _`Digital Ocean`: https://github.com/opdemand/deis/tree/master/contrib/digitalocean#readme |
117 | | -.. _`add the controller to the admins group`: #add-controller-to-admins-group |
118 | | -.. _`knife`: http://docs.opscode.com/knife.html |
119 | | -.. _`OpsCode management interface`: https://manage.opscode.com/ |
120 | | -.. _`steps`: http://docs.opscode.com/manage_server_hosted_groups.html#add-user-to-group |
| 9 | +The `controller` is the brains of a Deis platform. Provisioning a Deis |
| 10 | +controller is a matter of creating one or more :ref:`concepts_coreos` |
| 11 | +machines and installing a few necessary *systemd* units to manage |
| 12 | +Docker containers. |
| 13 | + |
| 14 | +Anywhere you can run CoreOS, you can run Deis, including most cloud |
| 15 | +providers, virtual machines, and bare metal. See the |
| 16 | +`CoreOS documentation`_ for more information on how to get set up |
| 17 | +with CoreOS. |
| 18 | + |
| 19 | +Amazon EC2 |
| 20 | +---------- |
| 21 | +The `contrib/ec2` section of the Deis project includes shell scripts, |
| 22 | +documentation, and a customized CloudFormation template to make it easy |
| 23 | +to provision a multi-node Deis cluster on `Amazon EC2`_. |
| 24 | + |
| 25 | +Please see `contrib/ec2`_ for details on using Deis on Amazon EC2. |
| 26 | + |
| 27 | +Rackspace |
| 28 | +--------- |
| 29 | +The `contrib/rackspace` section of the Deis project includes shell |
| 30 | +scripts, documentation, and a cloud-config template to make it easy to |
| 31 | +provision a multi-node Deis cluster on Rackspace_ cloud. |
| 32 | + |
| 33 | +Please see `contrib/rackspace`_ for details on using Deis on |
| 34 | +Rackspace cloud. |
| 35 | + |
| 36 | +Vagrant |
| 37 | +------- |
| 38 | +The `contrib/vagrant` section of the Deis project includes shell |
| 39 | +scripts, documentation, a Makefile and a Vagrantfile to make it easy to |
| 40 | +provision a multi-node Deis cluster on Vagrant_ virtual machines. |
| 41 | + |
| 42 | +Please see `contrib/vagrant`_ for details on using Deis with Vagrant. |
| 43 | + |
| 44 | + |
| 45 | +.. _`CoreOS Documentation`: https://coreos.com/docs/ |
| 46 | +.. _`Amazon EC2`: https://github.com/opdemand/deis/tree/master/contrib/ec2#readme |
| 47 | +.. _`contrib/ec2`: https://github.com/opdemand/deis/tree/master/contrib/ec2 |
| 48 | +.. _Rackspace: https://github.com/opdemand/deis/tree/master/contrib/rackspace#readme |
| 49 | +.. _`contrib/rackspace`: https://github.com/opdemand/deis/tree/master/contrib/rackspace |
| 50 | +.. _Vagrant: http://www.vagrantup.com/ |
| 51 | +.. _`contrib/vagrant`: https://github.com/opdemand/deis/tree/master/contrib/vagrant |
121 | 52 |
|
0 commit comments