|
| 1 | +--- |
| 2 | +title: Rancher Kubernetes Engine |
| 3 | +description: Learn how to setup a Rancher cluster for your Coder deployment |
| 4 | +--- |
| 5 | + |
| 6 | +This deployment guide shows you how to set up a bare-metal Rancher Kubernetes |
| 7 | +Engine (RKE) cluster on which Coder can deploy. |
| 8 | + |
| 9 | +## Prerequisites |
| 10 | + |
| 11 | +See here for the full list of [Rancher requirements](https://rancher.com/docs/rke/latest/en/os/). |
| 12 | +You must have at least one Linux host (node) with the following utilities installed: |
| 13 | + |
| 14 | +### Binaries |
| 15 | + |
| 16 | +- [Docker](https://docs.docker.com/engine/install/) |
| 17 | +- [Helm](https://helm.sh/docs/intro/install/) |
| 18 | +- [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) |
| 19 | +- [rke](https://rancher.com/docs/rke/latest/en/installation/) |
| 20 | + |
| 21 | +### Storage |
| 22 | + |
| 23 | +Since Coder requires dynamic storage provisioning, you'll need to |
| 24 | +install a [Rancher-supported storage provisioner](https://rancher.com/docs/rancher/v2.6/en/cluster-admin/volumes-and-storage/provisioning-new-storage/#prerequisites). |
| 25 | +We recommend using [Longhorn](https://longhorn.io/), since it is tightly |
| 26 | +integrated with Rancher. |
| 27 | + |
| 28 | +### Networking |
| 29 | + |
| 30 | +To configure pod networking, you'll need to install a Container Network |
| 31 | +Interface (CNI) into the Rancher cluster. Here are [Rancher's recommended CNI providers](https://rancher.com/docs/rancher/v2.6/en/faq/networking/cni-providers/) |
| 32 | + |
| 33 | +## Setup |
| 34 | + |
| 35 | +1. Once you've installed the necessary dependencies, create a `cluster.yml` file |
| 36 | +to define the Rancher cluster configuration. Below is an example for a single-node |
| 37 | +cluster: |
| 38 | + |
| 39 | +```yaml |
| 40 | +nodes: |
| 41 | + - address: 10.206.0.2 |
| 42 | + user: ubuntu |
| 43 | + role: |
| 44 | + - controlplane |
| 45 | + - etcd |
| 46 | + - worker |
| 47 | + ssh_key_path: /home/ubuntu/.ssh/id_rsa |
| 48 | + ssh_agent_auth: true |
| 49 | +``` |
| 50 | +
|
| 51 | +> Ensure the user is a member of the docker group. |
| 52 | +
|
| 53 | +For a multi-node, high availability cluster, [see the Rancher documentation](https://rancher.com/docs/rke/latest/en/example-yamls/) |
| 54 | +for additional configuration values. |
| 55 | +
|
| 56 | +1. Deploy the cluster with the following command: |
| 57 | +
|
| 58 | +```console |
| 59 | +rke up --config cluster.yml |
| 60 | +``` |
| 61 | + |
| 62 | +1. After the cluster is brought up, create your `kubeconfig` file and copy over the |
| 63 | +Rancher-generated configuration: |
| 64 | + |
| 65 | +```console |
| 66 | +mkdir -p $HOME/.kube/ && cp kube_config_cluster.yml $HOME/.kube/config |
| 67 | +``` |
| 68 | + |
| 69 | +Once complete, you can now [install Coder](../installation.md) on to your |
| 70 | +Rancher cluster. |
0 commit comments