Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add baremetal quickstart #1936

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Use one of the following guides to deploy and provision Rancher and a Kubernetes
- [DigitalOcean](./digital-ocean-qs) (uses Terraform)
- [AWS](./amazon-aws-qs) (uses Terraform)
- [Vagrant](./quickstart-vagrant)
- [Bare metal](./quickstart-baremetal)

If you prefer, the following guide will take you through the same process in individual steps. Use this if you want to run Rancher in a different provider, on prem, or if you would just like to see how easy it is.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: Bare metal Quick Start
weight: 200
---
Rancher should work with any modern Linux distribution and any modern Docker version. Rancher has been tested and is supported with Ubuntu, CentOS, Oracle Linux, RancherOS, and RedHat Enterprise Linux.

<br>
The following steps quickly deploy a Rancher Server on `bare metal` (aka a computer with no operating system).

## Prerequisites

- Download the latest [rancheros.iso](https://github.com/rancher/os/releases) file and create bootable device
- Computer allows access to boot menu, has at least one hard drive, and network has DHCP server
- Computer's first hard drive can be erased


## Getting Started

1. Boot PC using bootable media (may have to press F12 to get to the boot menu, then select the bootable device)

2. Once you get to a `rancher` prompt, change the rancher password: `sudo passwd rancher` (You will need this password when you ssh to this instance.)

3. Run `ifconfig -a` to get the ip address of this instance.

4. From another computer `ssh rancher@<ip from previous step>` (for example, `ssh [email protected]`)

5. Create a `cloud-config.yml` file. Here is an example file (with the ssh-rsa line truncated for brevity):

```
hostname: apple.example.com

rancher:
network:
interfaces:
eth*:
dhcp: false
eth0:
address: 192.168.0.101/24
gateway: 192.168.0.1
dns:
nameservers:
- 192.168.0.171
- 8.8.8.8

ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC...jJw== XXX
```

6. Install Rancher OS to the hard drive. Run `sudo ros install -i rancher/os:latest -c cloud-config.yml -d /dev/sda` (Note: This will wipe out any existing operating system on this computer.)

7. Reboot and remove the bootable media when installation is complete.

8. From another computer `ssh rancher@<ip from cloud-config.yml file>` (using the example above `ssh [email protected]`)

9. Start Rancher UI. Run `sudo docker run -d --restart=unless-stopped -p 9080:80 -p 9443:443 rancher/rancher` (Note: You can change the ports 9080 and/or 9443 if you want.)

10. Open up `https://<ip from cloud-config.yml file>:9443` (for example `https://192.168.0.101:9443`) and enter password for `admin` user.

11. Add a cluster. Enter `name`, click on "Next", then ensure all three options are checked ("worker", "etcd", "controlplane"). Copy the text.

12. Paste the text from prior step into the window from step 8 above. It will take a few minutes for all of the pieces to start.

### Want to add another worker node?

If you want to add another computer to the Rancher cluster, then follow these steps.

1. Follow the steps 1-8 from above. (be sure to change the ip address and hostname values in the cloud-config.yml file)

2. On the Cluster you want to add this computer (aka Node), click on `Edit`. You may only want the `worker` option checked. Copy the text.

3. Run the command from step 2 into the ssh'd connection to the second computer.

4. The node should now be added to the cluster.