github.com/inflatablewoman/deis@v1.0.1-0.20141111034523-a4511c46a6ce/contrib/openstack/README.md (about)

     1  # Provision a Deis Cluster on OpenStack
     2  
     3  **NOTE**
     4  OpenStack support for Deis was contributed by @shakim. OpenStack support is untested by the Deis team, so we rely on the community to improve these scripts and to fix bugs.
     5  We greatly appreciate the help!
     6  
     7  ### Prerequisites:
     8  Make sure that the following utilities are installed and in your execution path:
     9  - nova
    10  - neutron
    11  
    12  ### Configure nova
    13  Create an `openrc.sh` file to match the following:
    14  ```
    15  [production]
    16  OS_AUTH_URL = {openstack_auth_url}
    17  OS_USERNAME = {openstack_username}
    18  OS_PASSWORD = {openstack_api_key}
    19  OS_TENANT_ID = {openstack_tenant_id}
    20  OS_TENANT_NAME = {openstack_tenant_name}
    21  ```
    22  
    23  (Alternatively, download OpenStack RC file from Horizon/Access & Security/API Access.)
    24  
    25  Source your nova credentials:
    26  
    27  ```console
    28  # source openrc.sh
    29  ```
    30  
    31  ### Set up your keys
    32  Choose an existing keypair or upload a new public key, if desired.
    33  
    34  ```console
    35  $ nova keypair-add --pub-key ~/.ssh/deis.pub deis-key
    36  ```
    37  
    38  ### Customize user-data
    39  
    40  Create a user-data file with a new discovery URL this way:
    41  
    42  ```console
    43  $ make discovery-url
    44  ```
    45  
    46  Or copy [`contrib/coreos/user-data.example`](../coreos/user-data.example) to `contrib/coreos/user-data` and follow the directions in the `etcd:` section to add a unique discovery URL.
    47  
    48  ### Choose number of instances
    49  By default, the provision script will provision 3 servers. You can override this by setting `DEIS_NUM_INSTANCES`:
    50  ```console
    51  $ DEIS_NUM_INSTANCES=5 ./provision-openstack-cluster.sh deis-key
    52  ```
    53  
    54  Note that for scheduling to work properly, clusters must consist of at least 3 nodes and always have an odd number of members.
    55  For more information, see [optimal etcd cluster size](https://github.com/coreos/etcd/blob/master/Documentation/optimal-cluster-size.md).
    56  
    57  Deis clusters of less than 3 nodes are unsupported.
    58  
    59  ### Deis network settings
    60  The script creates a private network called 'deis' if no such network exists.
    61  
    62  By default, the deis subnet IP range is set to 10.21.12.0/24. To override it and the default DNS settings, set the following variables:
    63  ```console
    64  $ export DEIS_CIDR=10.21.12.0/24
    65  $ export DEIS_DNS=10.21.12.3,8.8.8.8
    66  ```
    67  
    68  **_Please note that this script does not handle floating IPs or routers. These should be provisioned manually either by Horizon or CLI_**
    69  
    70  ### Run the provision script
    71  Run the [Openstack provision script](provision-openstack-cluster.sh) to spawn a new CoreOS cluster.
    72  You'll need to provide the name of the CoreOS image name (or ID), and the key pair you just added. Optionally, you can also specify a flavor name.
    73  ```console
    74  $ cd contrib/openstack
    75  $ ./provision-openstack-cluster.sh
    76  Usage: provision-openstack-cluster.sh <coreos image name/id> <key pair name> [flavor]
    77  $ ./provision-openstack-cluster.sh coreos deis-key
    78  ```
    79  
    80  ### Choose number of routers
    81  By default, the Makefile will provision 1 router. You can override this by setting `DEIS_NUM_ROUTERS`:
    82  ```console
    83  $ export DEIS_NUM_ROUTERS=2
    84  ```
    85  
    86  ## Configure Deis
    87  Set the default domain used to anchor your applications:
    88  
    89  ```console
    90  $ deisctl config platform set domain=mycluster.local
    91  ```
    92  
    93  For this to work, you'll need to configure DNS records so you can access applications hosted on Deis. See [Configuring DNS](http://docs.deis.io/en/latest/managing_deis/configure-dns/#dns-records) for details.
    94  
    95  If you want to allow `deis run` for one-off admin commands, you must provide an SSH private key that allows Deis to gather container logs on CoreOS hosts:
    96  
    97  ```console
    98  $ deisctl config platform set sshPrivateKey=<path-to-private-key>
    99  ```
   100  
   101  ### Initialize the cluster
   102  Once the cluster is up:
   103  * **If required, allocate and associate floating IPs to any or all of your hosts**
   104  * Get the IP address of any of the machines from Openstack
   105  * set DEISCTL_TUNNEL and install the platform:
   106  
   107  ```console
   108  $ export DEISCTL_TUNNEL=23.253.219.94
   109  $ deisctl install platform && deisctl start platform
   110  ```
   111  
   112  The installer will deploy Deis and make sure the services start properly.
   113  
   114  ### Use Deis!
   115  After that, register with Deis!
   116  ```console
   117  $ deis register http://deis.example.org
   118  username: deis
   119  password:
   120  password (confirm):
   121  email: info@opdemand.com
   122  ```
   123  
   124  ## Hack on Deis
   125  
   126  See [Hacking on Deis](http://docs.deis.io/en/latest/contributing/hacking/).