github.com/greenboxal/deis@v1.12.1/docs/installing_deis/openstack.rst (about)

     1  :title: Installing Deis on OpenStack
     2  :description: How to provision a multi-node Deis cluster on OpenStack
     3  
     4  .. _deis_on_openstack:
     5  
     6  OpenStack
     7  =========
     8  
     9  Please :ref:`get the source <get_the_source>` and refer to the scripts in `contrib/openstack`_
    10  while following this documentation.
    11  
    12  .. important::
    13  
    14      OpenStack support for Deis was originally contributed by `Shlomo Hakim`_ and has been updated
    15      by Deis community members. OpenStack support is untested by the Deis team, so we rely on
    16      the community to improve this documentation and to fix bugs. We greatly appreciate the help!
    17  
    18  
    19  Check System Requirements
    20  -------------------------
    21  
    22  Please refer to :ref:`system-requirements` for resource considerations when choosing a machine
    23  size to run Deis.
    24  
    25  Prerequisites
    26  -------------
    27  
    28  Make sure that the following utilities are installed and in your execution path:
    29  
    30  * nova
    31  * neutron
    32  * glance
    33  
    34  Configure OpenStack
    35  -------------------
    36  
    37  Create an ``openrc.sh`` file to match the following:
    38  
    39  .. code-block:: console
    40  
    41      $ export OS_AUTH_URL={openstack_auth_url}
    42      $ export OS_USERNAME={openstack_username}
    43      $ export OS_PASSWORD={openstack_password}
    44      $ export OS_TENANT_NAME={openstack_tenant_name}
    45  
    46  
    47  (Alternatively, download OpenStack RC file from Horizon/Access & Security/API Access.)
    48  
    49  Source your nova credentials:
    50  
    51  .. code-block:: console
    52  
    53      $ source openrc.sh
    54  
    55  
    56  Set up your keys
    57  ----------------
    58  
    59  Choose an existing keypair or upload a new public key, if desired.
    60  
    61  .. code-block:: console
    62  
    63      $ nova keypair-add --pub-key ~/.ssh/deis.pub deis-key
    64  
    65  
    66  Upload a CoreOS image to Glance
    67  -------------------------------
    68  
    69  You need to have a relatively recent CoreOS image.
    70  
    71  If you don't already have a suitable CoreOS image and your OpenStack install allows you to upload
    72  your own images, the following snippet will use the latest CoreOS image from the stable channel:
    73  
    74  .. code-block:: console
    75  
    76      $ wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_openstack_image.img.bz2
    77      $ bunzip2 coreos_production_openstack_image.img.bz2
    78      $ glance image-create --name coreos \
    79        --container-format bare \
    80        --disk-format qcow2 \
    81        --file coreos_production_openstack_image.img \
    82        --is-public True
    83  
    84  
    85  Generate a New Discovery URL
    86  ----------------------------
    87  
    88  .. include:: ../_includes/_generate-discovery-url.rst
    89  
    90  
    91  Choose number of instances
    92  --------------------------
    93  
    94  A Deis cluster must have 3 or more nodes. See :ref:`cluster-size` for more details.
    95  
    96  Instruct the provision script to launch the desired number of nodes:
    97  
    98  .. code-block:: console
    99  
   100      $ export DEIS_NUM_INSTANCES=3
   101  
   102  
   103  Deis network settings
   104  ---------------------
   105  
   106  The script creates a private network called 'deis' if no such network exists.
   107  
   108  By default, the deis subnet IP range is set to 10.21.12.0/24. To override it and the default
   109  DNS settings, set the following variables:
   110  
   111  .. code-block:: console
   112  
   113      $ export DEIS_CIDR=10.21.12.0/24
   114      $ export DEIS_DNS=10.21.12.3,8.8.8.8
   115  
   116  .. note::
   117  
   118      This script does not handle floating IPs or routers. These should be provisioned manually by
   119      either Horizon or the CLI.
   120  
   121  
   122  Run the provision script
   123  ------------------------
   124  
   125  If you have a fairly straightforward OpenStack install, you should be able to use the provided
   126  provisioning script. This script assumes you are using neutron and have security-groups enabled.
   127  
   128  Run the ``provision-openstack-cluster.sh`` to spawn a new CoreOS cluster. You'll need to provide
   129  the name of the CoreOS image name (or ID), and the key pair you just added. Optionally, you can also
   130  specify a flavor name.
   131  
   132  .. code-block:: console
   133  
   134      $ cd contrib/openstack
   135      $ ./provision-openstack-cluster.sh
   136      Usage: provision-openstack-cluster.sh <coreos image name/id> <key pair name> [flavor]
   137      $ ./provision-openstack-cluster.sh coreos deis-key
   138  
   139  
   140  You can override the name of the internal network to use by setting the environment variable
   141  ``DEIS_NETWORK=internal``.  If this doesn't exist the script will try to create it with the default
   142  CIDR which requires your OpenStack cluster to support tenant VLANs.
   143  
   144  You can also override the name of the security group to attach to the instances by setting
   145  ``DEIS_SECGROUP=deis_test``.  If this doesn't exist the script will attempt to create it.
   146  If you are creating your own security groups you can use the provision script as a guide.  Make sure
   147  that you have a rule to enable full communication inside the security group, or you will have a bad day.
   148  
   149  Manually start the instances
   150  ----------------------------
   151  
   152  Start the instances and ensure they're operational before continuing.
   153  
   154  Configure floating IPs
   155  ----------------------
   156  
   157  You will want to attach a floating IP to at least one of your instances.  You'll do that like this:
   158  
   159  .. code-block:: console
   160  
   161      $ nova floating-ip-create <pool>
   162      $ nova floating-ip-associate deis-1 <IP provided by above command>
   163  
   164  Deploy a load balancer
   165  ----------------------
   166  
   167  It is recommended that you deploy a load balancer for user requests to your Deis cluster.
   168  See :ref:`configure-load-balancers` for more details on using load balancers with Deis.
   169  
   170  Configure DNS
   171  -------------
   172  
   173  See :ref:`configure-dns` for more information on properly setting up your DNS records with Deis.
   174  
   175  Install Deis Platform
   176  ---------------------
   177  
   178  Now that you've finished provisioning a cluster, please refer to :ref:`install_deis_platform` to
   179  start installing the platform.
   180  
   181  .. _`contrib/openstack`: https://github.com/deis/deis/tree/master/contrib/openstack
   182  .. _`Shlomo Hakim`: https://github.com/shakim