Rancher Deep Dive
local graph
Rancher Deep Dive
Section titled “Rancher Deep Dive”chapter_01
Section titled “chapter_01”node-book_rancher-deep-dive_chapter-01-introduction-to-rancher-and-kubernetes — Introduction to Rancher and Kubernetes
chapter_02
Section titled “chapter_02”node-book_rancher-deep-dive_chapter-02-rancher-and-kubernetes-high-level-architecture — Rancher and Kubernetes High-Level Architecture
chapter_03
Section titled “chapter_03”node-book_rancher-deep-dive_chapter-03-creating-a-single-node-rancher — Creating a Single Node Rancher
chapter_04
Section titled “chapter_04”node-book_rancher-deep-dive_chapter-04-creating-an-rke-and-rke2-cluster — Creating an RKE and RKE2 Cluster
chapter_05
Section titled “chapter_05”node-book_rancher-deep-dive_chapter-05-deploying-rancher-on-a-hosted-kubernetes-cluster — Deploying Rancher on a Hosted Kubernetes Cluster
chapter_06
Section titled “chapter_06”node-book_rancher-deep-dive_chapter-06-creating-an-rke-cluster-using-rancher — Creating an RKE Cluster Using Rancher
chapter_07
Section titled “chapter_07”node-book_rancher-deep-dive_chapter-07-deploying-a-hosted-cluster-with-rancher — Deploying a Hosted Cluster with Rancher
chapter_08
Section titled “chapter_08”node-book_rancher-deep-dive_chapter-08-importing-an-externally-managed-cluster-into-rancher — Importing an Externally Managed Cluster into Rancher
chapter_09
Section titled “chapter_09”node-book_rancher-deep-dive_chapter-09-cluster-configuration-backup-and-recovery — Cluster Configuration Backup and Recovery
chapter_10
Section titled “chapter_10”node-book_rancher-deep-dive_chapter-10-monitoring-and-logging — Monitoring and Logging
chapter_11
Section titled “chapter_11”node-book_rancher-deep-dive_chapter-11-bring-storage-to-kubernetes-using-longhorn — Bring Storage to Kubernetes Using Longhorn
chapter_12
Section titled “chapter_12”node-book_rancher-deep-dive_chapter-12-scaling-in-kubernetes — Scaling in Kubernetes
chapter_13
Section titled “chapter_13”node-book_rancher-deep-dive_chapter-13-load-balancer-configuration-and-ssl-certificates — Load Balancer Configuration and SSL Certificates
chapter_14
Section titled “chapter_14”node-book_rancher-deep-dive_chapter-14-rancher-and-kubernetes-troubleshooting — Rancher and Kubernetes Troubleshooting
chapter_15
Section titled “chapter_15”node-book_rancher-deep-dive_chapter-15-setting-up-a-ci-cd-pipeline-and-image-registry — Setting Up a CI/CD Pipeline and Image Registry
chapter_16
Section titled “chapter_16”node-book_rancher-deep-dive_chapter-16-creating-and-using-helm-charts — Creating and Using Helm Charts
chapter_17
Section titled “chapter_17”node-book_rancher-deep-dive_chapter-17-resource-management — Resource Management
Preface
Section titled “Preface”Rancher and Kubernetes have been driving the wave of DevOps adoption for both on-premises and cloud workloads. This book will guide you through the history of Rancher and Kubernetes and how they came into being. We will dive into how to design, build, and manage your Rancher environment. We will then build upon Rancher, deploying a range of cluster types, including RKE, RKE2, k3s, EKS, and GKE. With each of these cluster types, we will go over how they work, design a solution around them, and finally, deploy them using Rancher.
We will then shift into getting your clusters production-ready. This includes how we back up and restore the different cluster types and monitor the health of our clusters and the application hosted on them. Then, we will dive into how to provide the additional services needed outside of core Kubernetes services, including persistent storage with Longhorn, security/compliance using OPA Gatekeeper, and how to bring dynamic scaling to our clusters.
We will then close the book by covering how to build and deploy our application in a Rancher/Kubernetes ecosystem using tools such as Drone CI for our CI/CD pipeline and Harbor for hosting build artifacts. We will then dive into the deep topic of Helm charts and how they bring package management to our clusters. Finally, we will close by covering resource management and cost reporting to address the goal of turning IT from a black hole into which you throw money into the profit center it can be.
Who this book is for
Section titled “Who this book is for”This book primarily targets DevOps engineers looking to deploy Kubernetes with Rancher, including how Rancher changed how clusters are built and managed using RKE (Rancher Kubernetes Engine) and RKE2/k3s. It is also for people who want to learn more about the Day 2 task part of the Kubernetes and Rancher ecosystem.
What this book covers
Section titled “What this book covers”Chapter 1, Introduction to Rancher and Kubernetes, explores the history of Rancher and its earlier products, and how Kubernetes changed the whole picture.
Chapter 2, Rancher and Kubernetes High-Level Architecture, discusses the different products that make up the Rancher ecosystem, including the Rancher server, RKE1/2, and k3s.
Chapter 3, Creating a Single Node Rancher, delves into a single node Rancher install, and the limitations of using it in addition to how to migrate to an HA setup.
Chapter 4, Creating an RKE and RKE2 Cluster, looks at RKE1 and 2, how they work, and the rules for architecting a solution using them.
Chapter 5, Deploying Rancher on a Hosted Kubernetes Cluster, covers how to install Rancher on a hosted Kubernetes cluster such as Google Kubernetes Engine (GKE), Amazon Elastic Container Service (EKS) for Kubernetes, Azure Kubernetes Service (AKS), or Digital Ocean’s Kubernetes Service (DOKS).
Chapter 6, Creating an RKE Cluster Using Rancher, demonstrates how to use Rancher to deploy a downstream RKE cluster along with the rules of architecting this type of cluster.
Chapter 7, Deploying a Hosted Cluster with Rancher, uses cloud providers to deploy hosted Kubernetes clusters using Rancher for managing the cluster over time.
Chapter 8, Importing an Externally Managed Cluster into Rancher, shows how to bring any kind of Kubernetes into Rancher and how Rancher can gain access to imported clusters.
Chapter 9, Cluster Configuration Backup and Recovery, describes how you back up an RKE1/2 cluster using etcd backups in addition to how to restore a cluster from a backup.
Chapter 10, Monitoring and Logging, explains how to use Rancher monitoring to deploy Prometheus, Grafana, and alert manager for monitoring the health of your cluster, in addition to how to use Banzai Cloud Logging to capture your pod logs.
Chapter 11, Bring Storage to Kubernetes Using Longhorn, explores why you would need persistent storage in your Kubernetes cluster and how Longhorn can solve this problem, including how Longhorn works and how to architect a solution using Longhorn.
Chapter 12, Security and Compliance Using OPA Gatekeeper, talks about how to enforce standards and security in your Kubernetes cluster using tools such as OPA Gatekeeper and NeuVector.
Chapter 13, Scaling in Kubernetes, delves into using Horizontal Pod Autoscaler (HPA), Vertical Pod Autoscaler (VPA), and Cluster Autoscaler to dynamically scale your environment.
Chapter 14, Load Balancer Configuration and SSL Certificates, explains how to publish applications hosted in Kubernetes to the outside world using ingresses and load balancers.
Chapter 15, Rancher and Kubernetes Troubleshooting, explains how to recover from some of the most common failures and issues, including how to detect and prevent them in the future along with how to reproduce these issues in a lab environment.
Chapter 16, Setting Up a CI/CD Pipeline and Image Registry, explains what a CI/CD pipeline is and how we can use it to deploy applications in a standardized and controlled process, along with deploying Drone CI and Harbor to support your applications.
Chapter 17, Creating and Using Helm Charts, describes Helm charts and how we can use Helm to package applications both from public and private and then how to publish them in a Kubernetes cluster.
Chapter 18, Resource Management, explains how to manage resources inside your Kubernetes cluster along with monitoring and controlling the cost of hosted applications in Kubernetes.
To get the most out of this book
Section titled “To get the most out of this book”This book assumes that you have a basic understanding of Linux server administration, including basic Bash scripting, installing packages, and automating tasks at scale. In addition, we are going to assume that you have a basic understanding of most cloud platforms, such as AWS, GCP, vSphere, or Azure.

It is also recommended to have a lab environment to deploy Rancher and RKE1/2 clusters. An important note: most cloud providers offer trail credits that should be more than enough to spin up small lab clusters.
Finally, Kubernetes and Rancher are ever-changing, so it is important to remember that version numbers will need to be changed as time moves on. So, it is highly recommended to review the release notes of each product and software before picking a version.
Conventions used
Section titled “Conventions used”There are a number of text conventions used throughout this book.
Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “It is pretty common to rename the local cluster to something more helpful, such as rancher-prod or rancher-west.”
A block of code is set as follows:
helm repo add prometheus-community https://prometheus-community.github.io/helm-chartshelm repo updatehelm upgrade –install -n monitoring monitoring prometheus-community/kube-prometheus-stackBold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: “With Rancher logging, it is recommended to deploy via the App Marketplace in the Rancher UI by going to Cluster Tools and clicking on the Logging app.”
Tips or Important Notes
Appear like this.
Source: