<commit_before>:title: Installing Deis on Bare Metal
:description: How to provision a multi-node Deis cluster on Bare Metal

.. _deis_on_bare_metal:

Bare Metal
==========

Deis clusters can be provisioned anywhere `CoreOS`_ can, including on your own hardware.

Please :ref:`get the source <get_the_source>` and refer to the scripts in `contrib/bare-metal`_
while following this documentation.

To get CoreOS running on raw hardware, you can boot with `PXE`_ or `iPXE`_ - this will boot a CoreOS
machine running entirely from RAM. Then, you can `install CoreOS to disk`_.

.. important::

    Deis requires CoreOS version 494.1.0 or more recent.


Check System Requirements
-------------------------

Please refer to :ref:`system-requirements` for resource considerations when choosing a
machine size to run Deis.


Generate SSH Key
----------------

.. include:: ../_includes/_generate-ssh-key.rst


Customize user-data
-------------------


Generate a New Discovery URL
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. include:: ../_includes/_generate-discovery-url.rst


SSH Key
^^^^^^^

Add the public key part for the SSH key generated in the first step to the user-data file:

.. code-block:: console

    ssh_authorized_keys:
      - ssh-rsa AAAAB3... deis


Update $private_ipv4
^^^^^^^^^^^^^^^^^^^^

`CoreOS`_ on bare metal doesn't detect the ``$private_ipv4`` reliably. Replace all occurences in
the user-data with the (private) IP address of the node.


.. include:: ../_includes/_private-network.rst

Add Environment
^^^^^^^^^^^^^^^

Since `CoreOS`_ doesn't detect private and public IP adresses, ``/etc/environment`` file doesn't
get written on boot. Add it to the `write_files` section of the user-data file:

.. code-block:: console

      - path: /etc/environment
        permissions: 0644
        content: |
          COREOS_PUBLIC_IPV4=<your public ip>
          COREOS_PRIVATE_IPV4=<your private ip>


Install CoreOS to disk
----------------------

Assuming you have booted your bare metal server into `CoreOS`_, you can perform now perform the
installation to disk.

Provide the config file to the installer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Save the user-data file to your bare metal machine. The example assumes you transferred the config
to ``/tmp/config``


Start the installation
^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: console

    coreos-install -C beta -c /tmp/config -d /dev/sda


This will install the latest `CoreOS`_ beta release to disk. The Deis provision scripts for other
platforms typically specify a CoreOS version - currently, ``494.1.0``. To specify a CoreOS
version, append the ``-V`` parameter to the install command, e.g. ``-V 494.1.0``.

After the installation has finished, reboot your server. Once your machine is back up, you should
be able to log in as the `core` user using the `deis` ssh key.
<commit_msg>docs(baremetal): fix typo<commit_after>:title: Installing Deis on Bare Metal
:description: How to provision a multi-node Deis cluster on Bare Metal

.. _deis_on_bare_metal:

Bare Metal
==========

Deis clusters can be provisioned anywhere `CoreOS`_ can, including on your own hardware.

Please :ref:`get the source <get_the_source>` and refer to the scripts in `contrib/bare-metal`_
while following this documentation.

To get CoreOS running on raw hardware, you can boot with `PXE`_ or `iPXE`_ - this will boot a CoreOS
machine running entirely from RAM. Then, you can `install CoreOS to disk`_.

.. important::

    Deis requires CoreOS version 494.1.0 or more recent.


Check System Requirements
-------------------------

Please refer to :ref:`system-requirements` for resource considerations when choosing a
machine size to run Deis.


Generate SSH Key
----------------

.. include:: ../_includes/_generate-ssh-key.rst


Customize user-data
-------------------


Generate a New Discovery URL
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. include:: ../_includes/_generate-discovery-url.rst


SSH Key
^^^^^^^

Add the public key part for the SSH key generated in the first step to the user-data file:

.. code-block:: console

    ssh_authorized_keys:
      - ssh-rsa AAAAB3... deis


Update $private_ipv4
^^^^^^^^^^^^^^^^^^^^

`CoreOS`_ on bare metal doesn't detect the ``$private_ipv4`` reliably. Replace all occurences in
the user-data with the (private) IP address of the node.


.. include:: ../_includes/_private-network.rst

Add Environment
^^^^^^^^^^^^^^^

Since `CoreOS`_ doesn't detect private and public IP adresses, ``/etc/environment`` file doesn't
get written on boot. Add it to the `write_files` section of the user-data file:

.. code-block:: console

      - path: /etc/environment
        permissions: 0644
        content: |
          COREOS_PUBLIC_IPV4=<your public ip>
          COREOS_PRIVATE_IPV4=<your private ip>


Install CoreOS to disk
----------------------

Assuming you have booted your bare metal server into `CoreOS`_, you can now perform the
installation to disk.

Provide the config file to the installer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Save the user-data file to your bare metal machine. The example assumes you transferred the config
to ``/tmp/config``


Start the installation
^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: console

    coreos-install -C beta -c /tmp/config -d /dev/sda


This will install the latest `CoreOS`_ beta release to disk. The Deis provision scripts for other
platforms typically specify a CoreOS version - currently, ``494.1.0``. To specify a CoreOS
version, append the ``-V`` parameter to the install command, e.g. ``-V 494.1.0``.

After the installation has finished, reboot your server. Once your machine is back up, you should
be able to log in as the `core` user using the `deis` ssh key.

{'fraction_non_alphanumeric': 0.15140350877192982, 'fraction_numerical': 0.008421052631578947, 'mean_word_length': 3.371932515337423, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3084624', 'n_tokens_mistral': 1723, 'n_tokens_neox': 1602, 'n_words': 691}