|
| 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 | +.. important:: |
| 72 | + |
| 73 | + Deis runs on CoreOS version 494.5.0 or later in the Stable channel. |
| 74 | + |
| 75 | +If you don't already have a suitable CoreOS image and your OpenStack install allows you to upload |
| 76 | +your own images, the following snippet will use the latest CoreOS image from the stable channel: |
| 77 | + |
| 78 | +.. code-block:: console |
| 79 | +
|
| 80 | + $ wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_openstack_image.img.bz2 |
| 81 | + $ bunzip2 coreos_production_openstack_image.img.bz2 |
| 82 | + $ glance image-create --name coreos \ |
| 83 | + --container-format bare \ |
| 84 | + --disk-format qcow2 \ |
| 85 | + --file coreos_production_openstack_image.img \ |
| 86 | + --is-public True |
| 87 | +
|
| 88 | +
|
| 89 | +Generate a New Discovery URL |
| 90 | +---------------------------- |
| 91 | + |
| 92 | +.. include:: ../_includes/_generate-discovery-url.rst |
| 93 | + |
| 94 | + |
| 95 | +Choose number of instances |
| 96 | +-------------------------- |
| 97 | + |
| 98 | +For scheduling to work properly, clusters must consist of at least 3 nodes and always have an odd |
| 99 | +number of members. Please refer to :ref:`system-requirements` for more information about cluster |
| 100 | +size requirements. |
| 101 | + |
| 102 | +Instruct the provision script to launch the desired number of nodes: |
| 103 | + |
| 104 | +.. code-block:: console |
| 105 | +
|
| 106 | + $ export DEIS_NUM_INSTANCES=3 |
| 107 | +
|
| 108 | +
|
| 109 | +Deis network settings |
| 110 | +--------------------- |
| 111 | + |
| 112 | +The script creates a private network called 'deis' if no such network exists. |
| 113 | + |
| 114 | +By default, the deis subnet IP range is set to 10.21.12.0/24. To override it and the default |
| 115 | +DNS settings, set the following variables: |
| 116 | + |
| 117 | +.. code-block:: console |
| 118 | +
|
| 119 | + $ export DEIS_CIDR=10.21.12.0/24 |
| 120 | + $ export DEIS_DNS=10.21.12.3,8.8.8.8 |
| 121 | +
|
| 122 | +.. note:: |
| 123 | + |
| 124 | + This script does not handle floating IPs or routers. These should be provisioned manually by |
| 125 | + either Horizon or the CLI. |
| 126 | + |
| 127 | + |
| 128 | +Run the provision script |
| 129 | +------------------------ |
| 130 | + |
| 131 | +If you have a fairly straightforward OpenStack install, you should be able to use the provided |
| 132 | +provisioning script. This script assumes you are using neutron and have security-groups enabled. |
| 133 | + |
| 134 | +Run the ``provision-openstack-cluster.sh`` to spawn a new CoreOS cluster. You'll need to provide |
| 135 | +the name of the CoreOS image name (or ID), and the key pair you just added. Optionally, you can also |
| 136 | +specify a flavor name. |
| 137 | + |
| 138 | +.. code-block:: console |
| 139 | +
|
| 140 | + $ cd contrib/openstack |
| 141 | + $ ./provision-openstack-cluster.sh |
| 142 | + Usage: provision-openstack-cluster.sh <coreos image name/id> <key pair name> [flavor] |
| 143 | + $ ./provision-openstack-cluster.sh coreos deis-key |
| 144 | +
|
| 145 | +
|
| 146 | +You can override the name of the internal network to use by setting the environment variable |
| 147 | +``DEIS_NETWORK=internal``. If this doesn't exist the script will try to create it with the default |
| 148 | +CIDR which requires your OpenStack cluster to support tenant VLANs. |
| 149 | + |
| 150 | +You can also override the name of the security group to attach to the instances by setting |
| 151 | +``DEIS_SECGROUP=deis_test``. If this doesn't exist the script will attempt to create it. |
| 152 | +If you are creating your own security groups you can use the provision script as a guide. Make sure |
| 153 | +that you have a rule to enable full communication inside the security group, or you will have a bad day. |
| 154 | + |
| 155 | +Manually start the instances |
| 156 | +---------------------------- |
| 157 | + |
| 158 | +Start the instances and ensure they're operational before continuing. |
| 159 | + |
| 160 | +Configure floating IPs |
| 161 | +---------------------- |
| 162 | + |
| 163 | +You will want to attach a floating IP to at least one of your instances. You'll do that like this: |
| 164 | + |
| 165 | +.. code-block:: console |
| 166 | +
|
| 167 | + $ nova floating-ip-create <pool> |
| 168 | + $ nova floating-ip-associate deis-1 <IP provided by above command> |
| 169 | +
|
| 170 | +Deploy a load balancer |
| 171 | +---------------------- |
| 172 | + |
| 173 | +It is recommended that you deploy a load balancer for user requests to your Deis cluster. |
| 174 | +See :ref:`configure-load-balancers` for more details on using load balancers with Deis. |
| 175 | + |
| 176 | +Configure DNS |
| 177 | +------------- |
| 178 | + |
| 179 | +See :ref:`configure-dns` for more information on properly setting up your DNS records with Deis. |
| 180 | + |
| 181 | +Install Deis Platform |
| 182 | +--------------------- |
| 183 | + |
| 184 | +Now that you've finished provisioning a cluster, please refer to :ref:`install_deis_platform` to |
| 185 | +start installing the platform. |
| 186 | + |
| 187 | +.. _`contrib/openstack`: https://github.com/deis/deis/tree/master/contrib/openstack |
| 188 | +.. _`Shlomo Hakim`: https://github.com/shakim |
0 commit comments