In this lab session we will aim to complete three exercises:
- Install Rancher on an RKE2 cluster
- Provision a downstream RKE2 cluster using Rancher
- Deploy an application using Fleet
Bonus rounds:
- Take an etcd snapshot of the downstream cluster
- Deploy an application or customize an existing addon using the Additional Manifests at the bottom of "Add-On Config" when editing the cluster
- Restore the etcd snapshot taken above, choosing the third option to also revert the app deployment
- Obtain your node IPs and private SSH keys from the instructor, these will be your nodes to use throughout the lab session
- There are two node IPs and private key files:
- The node with
r
is the Rancher node used in exercise 1 - The node with
ds
is the downstream node used in exercise 2
- The node with
- SSH username:
ec2-user
sudo
is available once logged in
- There are two node IPs and private key files:
Navigate to the Rancher install guide in the link below:
-
SSH into the Rancher node (with
r
in the name) -
Follow the steps to add the helm repo and create the
cattle-system
namespace. Choose thelatest
helm repository -
From step 3 onwards, in this lab the "Rancher-generated TLS certificate" approach is recommended, where cert-manager will need to be installed (step 4)
-
For step 5, a hostname is needed for Rancher. You can use your own custom domain name, however for lab purposes, it is recommended to generate a quick hostname with
.nip.io
, just append this to your Rancher node Public IP: eg,5.6.7.8.nip.io
- If you are unsure about the Public IP, use:
curl ifconfig.io
from the command line on the node - Use this hostname for the
--set hostname
flag when runninghelm install
, eg:--set hostname=5.6.7.8.nip.io
- Supply a bootstrap password to use when logging into Rancher for the first time with the
--set bootstrapPassword
flag - Replace the
<CHART_REPO>
portion of thehelm install
command withlatest
, if latest was the repo chosen in the first step of this exercise - Add the
--set replicas 1
flag, to use just one Rancher pod, as we're running a single node for this lab
Example command:
helm install rancher rancher-latest/rancher --namespace cattle-system --set hostname=35.88.67.40.nip.io --set replicas=1
- If you are unsure about the Public IP, use:
Navigate to the Downstream cluster configuration guide in the link below:
- SSH into the downstream node (with
ds
in the name) - Follow the steps in the configuration guide (link above) from step 2 (Create the Custom Cluster)
- At the end of step 2 you will use this node (with
ds
in the name) to run the provisioning command - Step 3 (Tag Resources) can be ignored
Pre-work:
- Clone this repo to the Rancher node (
r
):git clone https://github.com/rancherlabs/cfl-summit-lab.git
- Change directory to the
2a-downstream-cluster
directory of the cloned repo,terraform
is preinstalled on the node
- Update the
terraform.tfvars
file to update the required variables (aws credentials, region, url, token, vpc details etc.) - Initialise the terraform modules:
terraform init
- Create the resources:
terraform apply
Instructions to deploy a webserver using fleet are provided in this link
Take an etcd snapshot of the downstream cluster(s). Details in the link below:
Navigate to Cluster Management in the Rancher dashboard
- Click Edit Config on a downstream cluster
- Navigate to Add-On Config under Cluster Configuration
- Scroll down to Additional Manifest
- Paste in a HelmChart, or Kubernetes manifest
Example: https://docs.rke2.io/helm#using-the-helm-crd
Restore an etcd snapshot for the downstream cluster(s). Details in the link below:
Choose the last option, to restore etcd, Kubernetes versions and cluster configuration
cd 2a-downstream-cluster # if not in the directory
terraform destroy
See pre-work
directory for preparation of the initial lab environment