|
2 | 2 |
|
3 | 3 | Deis clusters can be provisioned anywhere [CoreOS](https://coreos.com/) can, including on your own hardware. To get CoreOS running on raw hardware, you can boot with [PXE](https://coreos.com/docs/running-coreos/bare-metal/booting-with-pxe/) or [iPXE](https://coreos.com/docs/running-coreos/bare-metal/booting-with-ipxe/) - this will boot a CoreOS machine running entirely from RAM. Then, you can [install CoreOS to disk](https://coreos.com/docs/running-coreos/bare-metal/installing-to-disk/). |
4 | 4 |
|
5 | | -Considerations when deploying Deis: |
| 5 | +## Generate SSH key |
| 6 | +To avoid problems deploying/launching apps later on it is necessary to install [CoreOS](https://coreos.com/) to disk with a SSH key without a passphrase. The following command will generate a new keypair named "deis". |
| 7 | + |
| 8 | +```console |
| 9 | +$ ssh-keygen -q -t rsa -f ~/.ssh/deis -N '' -C deis |
| 10 | +``` |
| 11 | + |
| 12 | +## Customize user-data |
| 13 | + |
| 14 | +### Discovery URL |
| 15 | +Edit [user-data](../coreos/user-data) and add a new discovery URL. |
| 16 | +You can get a new one by sending a request to http://discovery.etcd.io/new. |
| 17 | + |
| 18 | +### SSH Key |
| 19 | +Add the public key part for the SSH key generated in the first step to the [user-data](../coreos/user-data) file: |
| 20 | + |
| 21 | +```yaml |
| 22 | +ssh_authorized_keys: |
| 23 | + - ssh-rsa AAAAB3... deis |
| 24 | +``` |
| 25 | +
|
| 26 | +### Update $private_ipv4 |
| 27 | +[CoreOS](https://coreos.com/) on bare metal doesn't detect the `$private_ipv4` reliably. Replace all occurences in the [user-data](../coreos/user-data) with the (private) IP address of the node. |
| 28 | + |
| 29 | +### Add environment |
| 30 | +Since [CoreOS](https://coreos.com/) doesn't detect private and public IP adresses the `/etc/environmnet` file doesn't get written on boot. Add it to the `write_files` section of [user-data](../coreos/user-data) |
| 31 | + |
| 32 | +```yaml |
| 33 | + - path: /etc/environment |
| 34 | + permissions: 0644 |
| 35 | + content: | |
| 36 | + COREOS_PUBLIC_IPV4=<your public ip> |
| 37 | + COREOS_PRIVATE_IPV4=<your private ip> |
| 38 | +``` |
| 39 | + |
| 40 | +## Install CoreOS to disk |
| 41 | +Assuming you have booted your bare metal server into [CoreOS](https://coreos.com/) you can perform now perform the installation to disk. |
| 42 | + |
| 43 | +### Provide the config file to the installer |
| 44 | +Save the [user-data](../coreos/user-data) to your bare metal machine. The example assumes you transferred the config to `/tmp/config` |
| 45 | + |
| 46 | +### Start the installation |
| 47 | +```console |
| 48 | +coreos-install -C alpha -c /tmp/config -d /dev/sda |
| 49 | +``` |
| 50 | + |
| 51 | +This will install the current [CoreOS](https://coreos.com/) release to disk. If you want to install the recommended [CoreOS](https://coreos.com/) version check the [Deis changelog](../../CHANGELOG.md) |
| 52 | +and specify that version by appending the `-V` parameter to the install command, e.g. `-V 402.2.0`. |
| 53 | + |
| 54 | +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. |
| 55 | + |
| 56 | +## Initialize the cluster |
| 57 | +Once your server(s) are all provisioned you can proceed to install Deis. Use the hostname of one of your machines in the next step. |
| 58 | + |
| 59 | +```console |
| 60 | +$ ssh-add ~/.ssh/deis |
| 61 | +$ export FLEETCTL_TUNNEL=your.server.name.here |
| 62 | +$ cd ../.. && make run |
| 63 | +``` |
| 64 | + |
| 65 | +## Use Deis! |
| 66 | +After that, register with Deis! |
| 67 | +```console |
| 68 | +$ deis register http://deis.example.org |
| 69 | +username: deis |
| 70 | +password: |
| 71 | +password (confirm): |
| 72 | +email: info@opdemand.com |
| 73 | +``` |
| 74 | + |
| 75 | +## Considerations when deploying Deis: |
6 | 76 | * Use machines with ample disk space and RAM (we use [large instances](https://aws.amazon.com/ec2/instance-types/) on EC2, for comparison) |
7 | 77 | * Choose an appropriate [cluster size](https://github.com/coreos/etcd/blob/master/Documentation/optimal-cluster-size.md) |
8 | | -* Supply our [cloud config file](../coreos/user-data), making sure to use a [new discovery URL](https://discovery.etcd.io/new) |
9 | | -* Use the `alpha` channel of CoreOS |
10 | 78 |
|
11 | | -We hope to improve our documentation around bare metal provisioning. If you're deployed Deis on bare metal and think you can help improve this documentation, please submit a pull request. Thanks! |
| 79 | +## Known problems |
| 80 | + |
| 81 | +### Hostname is localhost |
| 82 | +If your hostname after installation to disk is `localhost` set the hostname in [user-data](../coreos/user-data) before installation: |
| 83 | + |
| 84 | +```yaml |
| 85 | +hostname: your-hostname |
| 86 | +``` |
| 87 | + |
| 88 | +The hostname must not be the fully qualified domain name! |
| 89 | + |
| 90 | +### Slow name resolution |
| 91 | + |
| 92 | +Certain DNS servers and firewalls have problems with glibc sending out requests for IPv4 and IPv6 addresses in parallel. The solution is to set the option `single-request` in `/etc/resolv.conf`. This can best be accomplished in the [user-data](../coreos/user-data) when installing [CoreOS](https://coreos.com/) to disk. Add the following block to the `write_files` section: |
| 93 | + |
| 94 | +```yaml |
| 95 | + - path: /etc/resolv.conf |
| 96 | + permissions: 0644 |
| 97 | + content: | |
| 98 | + nameserver 8.8.8.8 |
| 99 | + nameserver 8.8.4.4 |
| 100 | + domain your.domain.name |
| 101 | + options single-request |
| 102 | +``` |
0 commit comments