|
4 | 4 | .. _deis_on_bare_metal: |
5 | 5 |
|
6 | 6 | Bare Metal |
7 | | ----------- |
| 7 | +========== |
8 | 8 |
|
9 | | -The `contrib/bare-metal` section of the Deis project includes documentation to help with |
10 | | -provisioning a multi-node cluster on your own hardware. |
| 9 | +Deis clusters can be provisioned anywhere `CoreOS`_ can, including on your own hardware. To get |
| 10 | +CoreOS running on raw hardware, you can boot with `PXE`_ or `iPXE`_ - this will boot a CoreOS |
| 11 | +machine running entirely from RAM. Then, you can `install CoreOS to disk`_. |
11 | 12 |
|
12 | | -Please see `contrib/bare-metal`_ for details on using Deis on bare metal. |
13 | 13 |
|
14 | | -.. _`contrib/bare-metal`: https://github.com/deis/deis/tree/master/contrib/bare-metal |
| 14 | +Generate SSH key |
| 15 | +---------------- |
| 16 | + |
| 17 | +To avoid problems deploying/launching apps later on it is necessary to install `CoreOS`_ to disk |
| 18 | +with a SSH key without a passphrase. The following command will generate a new keypair named |
| 19 | +"deis": |
| 20 | + |
| 21 | +.. code-block:: console |
| 22 | +
|
| 23 | + $ ssh-keygen -q -t rsa -f ~/.ssh/deis -N '' -C deis |
| 24 | +
|
| 25 | +
|
| 26 | +Customize user-data |
| 27 | +------------------- |
| 28 | + |
| 29 | + |
| 30 | +Generate a New Discovery URL |
| 31 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 32 | + |
| 33 | +To get started with provisioning Deis, we will need to generate a new Discovery URL. Discovery URLs |
| 34 | +help connect `etcd`_ instances together by storing a list of peer addresses and metadata under a |
| 35 | +unique address. You can generate a new discovery URL for use in your platform by |
| 36 | +running the following from the root of the repository: |
| 37 | + |
| 38 | +.. code-block:: console |
| 39 | +
|
| 40 | + $ make discovery-url |
| 41 | +
|
| 42 | +This will write a new discovery URL to the user-data file. Some convenience scripts are supplied in |
| 43 | +this user-data file, so it is mandatory for provisioning Deis. |
| 44 | + |
| 45 | + |
| 46 | +SSH Key |
| 47 | +^^^^^^^ |
| 48 | + |
| 49 | +Add the public key part for the SSH key generated in the first step to the user-data file: |
| 50 | + |
| 51 | +.. code-block:: console |
| 52 | +
|
| 53 | + ssh_authorized_keys: |
| 54 | + - ssh-rsa AAAAB3... deis |
| 55 | +
|
| 56 | +
|
| 57 | +Update $private_ipv4 |
| 58 | +^^^^^^^^^^^^^^^^^^^^ |
| 59 | + |
| 60 | +`CoreOS`_ on bare metal doesn't detect the ``$private_ipv4`` reliably. Replace all occurences in |
| 61 | +the user-data with the (private) IP address of the node. |
| 62 | + |
| 63 | + |
| 64 | +Add Environment |
| 65 | +^^^^^^^^^^^^^^^ |
| 66 | + |
| 67 | +Since `CoreOS`_ doesn't detect private and public IP adresses, ``/etc/environment`` file doesn't |
| 68 | +get written on boot. Add it to the `write_files` section of the user-data file: |
| 69 | + |
| 70 | +.. code-block:: console |
| 71 | +
|
| 72 | + - path: /etc/environment |
| 73 | + permissions: 0644 |
| 74 | + content: | |
| 75 | + COREOS_PUBLIC_IPV4=<your public ip> |
| 76 | + COREOS_PRIVATE_IPV4=<your private ip> |
| 77 | +
|
| 78 | +
|
| 79 | +Install CoreOS to disk |
| 80 | +---------------------- |
| 81 | + |
| 82 | +Assuming you have booted your bare metal server into `CoreOS`_, you can perform now perform the |
| 83 | +installation to disk. |
| 84 | + |
| 85 | +Provide the config file to the installer |
| 86 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 87 | + |
| 88 | +Save the user-data file to your bare metal machine. The example assumes you transferred the config |
| 89 | +to ``/tmp/config`` |
| 90 | + |
| 91 | + |
| 92 | +Start the installation |
| 93 | +^^^^^^^^^^^^^^^^^^^^^^ |
| 94 | + |
| 95 | +.. code-block:: console |
| 96 | +
|
| 97 | + coreos-install -C alpha -c /tmp/config -d /dev/sda |
| 98 | +
|
| 99 | +
|
| 100 | +This will install the current `CoreOS`_ release to disk. If you want to install the recommended |
| 101 | +`CoreOS`_ version, check the `Deis changelog`_ and specify that version by appending the ``-V`` |
| 102 | +parameter to the install command, e.g. ``-V 472.0.0``. |
| 103 | + |
| 104 | +After the installation has finished, reboot your server. Once your machine is back up, you should |
| 105 | +be able to log in as the `core` user using the `deis` ssh key. |
| 106 | + |
| 107 | + |
| 108 | +Configure DNS |
| 109 | +------------- |
| 110 | + |
| 111 | +See :ref:`configure-dns` for more information on properly setting up your DNS records with Deis. |
| 112 | + |
| 113 | + |
| 114 | +Install Deis Platform |
| 115 | +--------------------- |
| 116 | + |
| 117 | +Now that you've finished provisioning a cluster, please refer to :ref:`install_deis_platform` to |
| 118 | +start installing the platform. |
| 119 | + |
| 120 | + |
| 121 | +Considerations when deploying Deis |
| 122 | +---------------------------------- |
| 123 | + |
| 124 | +* Use machines with ample disk space and RAM (for comparison, we use m3.large instances on EC2) |
| 125 | +* Choose an appropriate `cluster size`_ |
| 126 | + |
| 127 | + |
| 128 | +Known Problems |
| 129 | +-------------- |
| 130 | + |
| 131 | + |
| 132 | +Hostname is localhost |
| 133 | +^^^^^^^^^^^^^^^^^^^^^ |
| 134 | + |
| 135 | +If your hostname after installation to disk is ``localhost``, set the hostname in user-data before |
| 136 | +installation: |
| 137 | + |
| 138 | +.. code-block:: console |
| 139 | +
|
| 140 | + hostname: your-hostname |
| 141 | +
|
| 142 | +The hostname must not be the fully qualified domain name! |
| 143 | + |
| 144 | + |
| 145 | +Slow name resolution |
| 146 | +^^^^^^^^^^^^^^^^^^^^ |
| 147 | + |
| 148 | +Certain DNS servers and firewalls have problems with glibc sending out requests for IPv4 and IPv6 |
| 149 | +addresses in parallel. The solution is to set the option ``single-request`` in |
| 150 | +``/etc/resolv.conf``. This can best be accomplished in the user-data when installing `CoreOS`_ to |
| 151 | +disk. Add the following block to the ``write_files`` section: |
| 152 | + |
| 153 | +.. code-block:: console |
| 154 | +
|
| 155 | + - path: /etc/resolv.conf |
| 156 | + permissions: 0644 |
| 157 | + content: | |
| 158 | + nameserver 8.8.8.8 |
| 159 | + nameserver 8.8.4.4 |
| 160 | + domain your.domain.name |
| 161 | + options single-request |
| 162 | +
|
| 163 | +
|
| 164 | +.. _`cluster size`: https://github.com/coreos/etcd/blob/master/Documentation/optimal-cluster-size.md |
| 165 | +.. _`CoreOS`: https://coreos.com/ |
| 166 | +.. _`Deis changelog`: https://github.com/deis/deis/blob/master/CHANGELOG.md |
| 167 | +.. _`etcd`: https://github.com/coreos/etcd |
| 168 | +.. _`install CoreOS to disk`: https://coreos.com/docs/running-coreos/bare-metal/installing-to-disk/ |
| 169 | +.. _`iPXE`: https://coreos.com/docs/running-coreos/bare-metal/booting-with-ipxe/ |
| 170 | +.. _`PXE`: https://coreos.com/docs/running-coreos/bare-metal/booting-with-pxe/ |
0 commit comments