Before we Begin

We need to install RKE onto our Workstation first.

  1. From your workstation, open a web browser and navigate to RKE Releases page. Download the latest RKE installer applicable to your Operating System and Architecture:

  2. Copy the RKE binary to a folder in your $PATH and rename it rke (or rke.exe for Windows)

  3. Make the RKE binary that you just downloaded executable. Open Terminal, change directory to the location of the RKE binary, and then run one of the commands below.

    USING WINDOWS? The file is already an executable.

    $ chmod +x rke
    
  4. Confirm that RKE is now executable by running the following command:

$ rke --version

Alternative RKE macOS Install - Homebrew

RKE can also be installed and updated using Homebrew, a package manager for macOS.

  1. Install Homebrew. See https://brew.sh/ for instructions.

  2. Using brew, install RKE by running the following command in a Terminal window:

    $ brew install rke
    

If you have already installed RKE using brew, you can upgrade RKE by running:

$ brew upgrade rke

Creating the Cluster Configuration File

We simply need to execute

rks config --name cluster.yml

Then answer all the questions about our cluster like so:

atton16@Ae-MBP k8s % rke config --name cluster.yml
[+] Cluster Level SSH Private Key Path [~/.ssh/id_rsa]: 
[+] Number of Hosts [1]: 9
[+] SSH Address of host (1) [none]: 192.168.1.41
[+] SSH Port of host (1) [22]: 
[+] SSH Private Key Path of host (192.168.1.41) [none]: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.41) [ubuntu]: rancher
[+] Is host (192.168.1.41) a Control Plane host (y/n)? [y]: n
[+] Is host (192.168.1.41) a Worker host (y/n)? [n]: n
[+] Is host (192.168.1.41) an etcd host (y/n)? [n]: y
[+] Override Hostname of host (192.168.1.41) [none]: etcd1
[+] Internal IP of host (192.168.1.41) [none]: 192.168.1.41
[+] Docker socket path on host (192.168.1.41) [/var/run/docker.sock]: 
[+] SSH Address of host (2) [none]: 192.168.1.42
[+] SSH Port of host (2) [22]: 
[+] SSH Private Key Path of host (192.168.1.42) [none]: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.42) [ubuntu]: rancher
[+] Is host (192.168.1.42) a Control Plane host (y/n)? [y]: n
[+] Is host (192.168.1.42) a Worker host (y/n)? [n]: n
[+] Is host (192.168.1.42) an etcd host (y/n)? [n]: y
[+] Override Hostname of host (192.168.1.42) [none]: etcd2    
[+] Internal IP of host (192.168.1.42) [none]: 192.168.1.42
[+] Docker socket path on host (192.168.1.42) [/var/run/docker.sock]: 
[+] SSH Address of host (3) [none]: 192.168.1.43
[+] SSH Port of host (3) [22]: 
[+] SSH Private Key Path of host (192.168.1.43) [none]: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.43) [ubuntu]: rancher
[+] Is host (192.168.1.43) a Control Plane host (y/n)? [y]: n
[+] Is host (192.168.1.43) a Worker host (y/n)? [n]: n
[+] Is host (192.168.1.43) an etcd host (y/n)? [n]: y
[+] Override Hostname of host (192.168.1.43) [none]: etcd3
[+] Internal IP of host (192.168.1.43) [none]: 192.168.1.43 
[+] Docker socket path on host (192.168.1.43) [/var/run/docker.sock]: 
[+] SSH Address of host (4) [none]: 192.168.1.47
[+] SSH Port of host (4) [22]: 
[+] SSH Private Key Path of host (192.168.1.47) [none]: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.47) [ubuntu]: rancher
[+] Is host (192.168.1.47) a Control Plane host (y/n)? [y]: 
[+] Is host (192.168.1.47) a Worker host (y/n)? [n]: 
[+] Is host (192.168.1.47) an etcd host (y/n)? [n]: 
[+] Override Hostname of host (192.168.1.47) [none]: master1
[+] Internal IP of host (192.168.1.47) [none]: 192.168.1.47
[+] Docker socket path on host (192.168.1.47) [/var/run/docker.sock]: 
[+] SSH Address of host (5) [none]: 192.168.1.48
[+] SSH Port of host (5) [22]: 
[+] SSH Private Key Path of host (192.168.1.48) [none]: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.48) [ubuntu]: rancher
[+] Is host (192.168.1.48) a Control Plane host (y/n)? [y]: 
[+] Is host (192.168.1.48) a Worker host (y/n)? [n]: 
[+] Is host (192.168.1.48) an etcd host (y/n)? [n]: 
[+] Override Hostname of host (192.168.1.48) [none]: master2
[+] Internal IP of host (192.168.1.48) [none]: 192.168.1.48
[+] Docker socket path on host (192.168.1.48) [/var/run/docker.sock]: 
[+] SSH Address of host (6) [none]: 192.168.1.49
[+] SSH Port of host (6) [22]: 
[+] SSH Private Key Path of host (192.168.1.49) [none]: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.49) [ubuntu]: rancher
[+] Is host (192.168.1.49) a Control Plane host (y/n)? [y]: 
[+] Is host (192.168.1.49) a Worker host (y/n)? [n]: 
[+] Is host (192.168.1.49) an etcd host (y/n)? [n]: 
[+] Override Hostname of host (192.168.1.49) [none]: master3
[+] Internal IP of host (192.168.1.49) [none]: 192.168.1.49
[+] Docker socket path on host (192.168.1.49) [/var/run/docker.sock]: 
[+] SSH Address of host (7) [none]: 192.168.1.51
[+] SSH Port of host (7) [22]: 
[+] SSH Private Key Path of host (192.168.1.51) [none]: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.51) [ubuntu]: rancher
[+] Is host (192.168.1.51) a Control Plane host (y/n)? [y]: n
[+] Is host (192.168.1.51) a Worker host (y/n)? [n]: y
[+] Is host (192.168.1.51) an etcd host (y/n)? [n]: n
[+] Override Hostname of host (192.168.1.51) [none]: worker1
[+] Internal IP of host (192.168.1.51) [none]: 192.168.1.51
[+] Docker socket path on host (192.168.1.51) [/var/run/docker.sock]: 
[+] SSH Address of host (8) [none]: 192.168.1.52
[+] SSH Port of host (8) [22]: 
[+] SSH Private Key Path of host (192.168.1.52) [none]: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.52) [ubuntu]: rancher
[+] Is host (192.168.1.52) a Control Plane host (y/n)? [y]: n
[+] Is host (192.168.1.52) a Worker host (y/n)? [n]: y
[+] Is host (192.168.1.52) an etcd host (y/n)? [n]: n
[+] Override Hostname of host (192.168.1.52) [none]: worker2
[+] Internal IP of host (192.168.1.52) [none]: 192.168.1.52
[+] Docker socket path on host (192.168.1.52) [/var/run/docker.sock]: 
[+] SSH Address of host (9) [none]: 192.168.1.53
[+] SSH Port of host (9) [22]: 
[+] SSH Private Key Path of host (192.168.1.53) [none]: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.53) [ubuntu]: rancher
[+] Is host (192.168.1.53) a Control Plane host (y/n)? [y]: n
[+] Is host (192.168.1.53) a Worker host (y/n)? [n]: y
[+] Is host (192.168.1.53) an etcd host (y/n)? [n]: n
[+] Override Hostname of host (192.168.1.53) [none]: worker3
[+] Internal IP of host (192.168.1.53) [none]: 192.168.1.53
[+] Docker socket path on host (192.168.1.53) [/var/run/docker.sock]: 
[+] Network Plugin Type (flannel, calico, weave, canal) [canal]: 
[+] Authentication Strategy [x509]: 
[+] Authorization Mode (rbac, none) [rbac]: 
[+] Kubernetes Docker image [rancher/hyperkube:v1.17.4-rancher1]: 
[+] Cluster domain [cluster.local]: 
[+] Service Cluster IP Range [10.43.0.0/16]: 
[+] Enable PodSecurityPolicy [n]: 
[+] Cluster Network CIDR [10.42.0.0/16]: 
[+] Cluster DNS Service IP [10.43.0.10]: 
[+] Add addon manifest URLs or YAML files [no]:

RKE will generate the configuration file for you like so: