Rancher provides a centralized hub for managing Kubernetes clusters across cloud service providers, data centers, and Internet of Things (IoT) devices. This allows organizations to standardize their Kubernetes version, access control, deployment, and lifecycles to simplify operations work. In this lab, we will go through the process of setting up a Rancher instance on an EC2 instance. We will go through the process of configuring Rancher to create an EKS cluster for us in our lab environment. Finally, we will install K3s, a lightweight, single-node Kubernetes distribution, on another EC2 instance and go through the process of importing that cluster into Rancher for central management. This will help you become familiar with how to use Rancher to create new Kubernetes clusters, as well as importing existing clusters hands-on.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Install and Configure Rancher
- Configure the
rancher/rancher
container to run on therancher-server
EC2 instance. This EC2 instance has Docker installed and running at the start of the lab. - In the Rancher console, go through the initial configuration.
Note: A real-world setup of Rancher should not be on only one node. Production instances of Rancher should be designed for high availability and fault tolerance.
- Configure the
- Create an Elastic Kubernetes Service (EKS) Cluster in Rancher
- Create an AWS access key and secret key in the IAM console for the
rancher_service_user
(the user will have some additional characters appended). - Add the AWS access key and secret to the Rancher console.
- Go to
Clusters
in the Rancher console and create an EKS cluster. - Compare the cluster in the Rancher console to the options and information available in the EKS console.
Note: Creating the EKS cluster can take 7-10 min. You may want to move on to the next objective and check back in on the EKS cluster’s status.
- Create an AWS access key and secret key in the IAM console for the
- Create a K3s Cluster and Import It into Rancher
- Configure K3s to run on the
k3s-server
EC2 instance. - Set up the Rancher console to import the K3s cluster.
- Take the
kubectl
command generated by Rancher and run in the K3s cluster to complete the import.
- Configure K3s to run on the