Managing Kubernetes Clusters with Rancher

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

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
  1. Configure the rancher/rancher container to run on the rancher-server EC2 instance. This EC2 instance has Docker installed and running at the start of the lab.
  2. 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.

Create an Elastic Kubernetes Service (EKS) Cluster in Rancher
  1. 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).
  2. Add the AWS access key and secret to the Rancher console.
  3. Go to Clusters in the Rancher console and create an EKS cluster.
  4. 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 a K3s Cluster and Import It into Rancher
  1. Configure K3s to run on the k3s-server EC2 instance.
  2. Set up the Rancher console to import the K3s cluster.
  3. Take the kubectl command generated by Rancher and run in the K3s cluster to complete the import.

Additional Resources

You are an engineer on the Shared Services team of a geological surveying company. The company has recently completed a successful containerization effort, moving all workloads into containers for faster development and more reliable deployment and operations. This includes both cloud-based workloads in AWS' Elastic Kubernetes Service and edge-based workloads that manage IoT sensors that the field surveyors use to collect the data. Now that all workloads are running in containers, the company is having trouble keeping track of everything. Security is concerned that several IoT sensors have missed key updates and a few EKS clusters are running unapproved versions of Kubernetes.

Your task is to evaluate Rancher as a solution to this problem. Create a prototype Rancher installation and use Rancher to set up an EKS Cluster. Additionally, you will need to set up a K3s cluster to demonstrate how to import the existing IoT K3s workloads into an enterprise Rancher solution.

You solution must include:

  • A Rancher instance running on the rancher-server EC2 instance. Rancher currently runs as a docker container rancher/rancher.
  • An EKS cluster created by Rancher. Rancher can authenticate to AWS using the Access Key and Secret Key provided by the lab.
  • A single node K3s cluster running on the k3s-server EC2 instance.

If you get stuck, be sure to check the lab guide or the solution video. Good luck!

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?