{"id":428,"date":"2025-11-21T07:49:45","date_gmt":"2025-11-21T07:49:45","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=428"},"modified":"2025-11-21T07:49:45","modified_gmt":"2025-11-21T07:49:45","slug":"setup-rancher-on-kubernetes-cluster","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=428","title":{"rendered":"Setup Rancher on Kubernetes Cluster"},"content":{"rendered":"<p>In this blog, you will learn to set up Rancher on your Kubernetes cluster to manage your multiple Kubernetes clusters.<\/p>\n<p>By the end of this blog, you will have learned.<\/p>\n<ol>\n<li>Understand key Rancher features<\/li>\n<li>The installation of Rancher on Kubernetes<\/li>\n<li>Adding Kubernetes clusters on Rancher<\/li>\n<\/ol>\n<h2 id=\"what-is-rancher\">What is Rancher?<\/h2>\n<p>Lest say you are working in a project that runs applications on Kubernetes. <\/p>\n<p>At first, you might have just one Kubernetes cluster. But as the project grows, you may have clusters in different environments for development, testing, and production<\/p>\n<p>Also, you might have clusters spread across different cloud providers (AWS, Azure, Google Cloud) for multi-cloud strategy. Some clusters might be running in your own data centers.<\/p>\n<p>Now, how do you manage all these clusters? How do you plan the upgrades? How do you enforce security policies for all the clusters?<\/p>\n<p>Well, here is where Rancher comes in to play.<\/p>\n<p><a href=\"https:\/\/github.com\/rancher\/rancher?ref=devopscube.com\" rel=\"noreferrer\">Rancher<\/a> is a free management platform that acts as a &#8220;control center&#8221; for all your Kubernetes clusters. You can manage all your clusters from a single interface, whether they are in AWS, Azure, on-premises, or at the edge.<\/p>\n<p>When we say Rancher helps &#8220;manage&#8221; clusters, here is what you can actually do with it.<\/p>\n<ol>\n<li><strong>Cluster Operations: <\/strong>You can <a href=\"https:\/\/devopscube.com\/setup-kubernetes-cluster-kubeadm\/\" rel=\"noreferrer\">create a new Kubernetes cluster<\/a> with a few clicks. You can connect clusters you already have running anywhere. You can even safely <a href=\"https:\/\/devopscube.com\/upgrade-kubernetes-cluster-kubeadm\/\" rel=\"noreferrer\">upgrade kubernetes versions<\/a> across all clusters without downtime.<\/li>\n<li><strong>Application Management: <\/strong>You can deploy apps to any cluster from a catalog (like an app store for Kubernetes). Also you can move, update applications across multiple clusters simultaneously.<\/li>\n<li><strong>Security &amp; Compliance:<\/strong> You can create security policies like &#8220;<a href=\"https:\/\/devopscube.com\/run-kubernetes-pod-as-non-root-user\/\" rel=\"noreferrer\">no containers can run as root user<\/a>&#8220;. You can also scan for <a href=\"https:\/\/devopscube.com\/scan-docker-images-using-trivy\/\" rel=\"noreferrer\">vulnerabilities<\/a> in your running containers.<\/li>\n<li><strong>Day-to-Day Operations:<\/strong> You can view logs from all your applications in one place. Also, you can <a href=\"https:\/\/devopscube.com\/troubleshoot-kubernetes-pods\/\" rel=\"noreferrer\">debug pods<\/a> by performing SSH into containers without complex kubectl commands.<\/li>\n<\/ol>\n<p>Now that you have a high level idea of what Rancher is, lets get our hands dirty with a practical setup. So that it will all make sense for you.<\/p>\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n<ul>\n<li>Kubernetes cluster (v1.33 +)<\/li>\n<li>Nginx Ingress Controller [Kubernetes]<\/li>\n<li>Certmanager [Kubernetes]<\/li>\n<li><a href=\"https:\/\/devopscube.com\/create-helm-chart\/\" rel=\"noreferrer\">Helm<\/a> [Local Workstation]<\/li>\n<li><a href=\"https:\/\/devopscube.com\/kubectl-set-context\/\" rel=\"noreferrer\">Kubectl<\/a> [Local Workstation]<\/li>\n<\/ul>\n<p>If you want to know more about the hardware requirements, please refer to this <a href=\"https:\/\/ranchermanager.docs.rancher.com\/getting-started\/installation-and-upgrade\/installation-requirements?ref=devopscube.com\" rel=\"noreferrer\">official documentation<\/a>.<\/p>\n<p>Once you ensure all the prerequisites are available, we can pull the Helm chart to begin the installation.<\/p>\n<blockquote><p><strong>Note:<\/strong> At the time of writing this blog, Rancher is not supported for Kubernetes v1.34.<\/p><\/blockquote>\n<h2 id=\"set-up-nginx-controller-prerequisite\">Set up Nginx Controller  (Prerequisite)<\/h2>\n<p>Ingress controller and Cert Manager are two important components that are needed for the Rancher setup.<\/p>\n<p>The Rancher needs the Nginx Ingress Controller to route incoming traffic.<\/p>\n<p>To set up the Nginx Ingress Controller on your Kubernetes cluster, follow the guide &#8220;<a href=\"https:\/\/devopscube.com\/setup-ingress-kubernetes-nginx-controller\/\" rel=\"noreferrer\">Setup Nginx Ingress Controller On Kubernetes<\/a>&#8220;<\/p>\n<div class=\"kg-card kg-callout-card kg-callout-card-blue\">\n<div class=\"kg-callout-emoji\">\ud83d\udca1<\/div>\n<div class=\"kg-callout-text\">For this demo, Nginx is using the <b><strong style=\"white-space: pre-wrap;\">NodePort<\/strong><\/b> service type. This allows us to route the traffic without a Load Balancer.<\/p>\n<p>But in real production, you should use the <b><strong style=\"white-space: pre-wrap;\">LoadBalancer<\/strong><\/b> service type so the Ingress Controller creates a real Load Balancer to route the traffic.<\/div>\n<\/div>\n<h2 id=\"setup-cert-manager-prerequisite\">Setup Cert Manager (Prerequisite)<\/h2>\n<p>Rancher also needs <strong>Cert Manager<\/strong> to create TLS certificates for secure communication between the clusters you add.<\/p>\n<p>To set up a cert manager on a Kubernetes cluster, follow the guide &#8220;<a href=\"https:\/\/devopscube.com\/nginx-ingress-with-cert-manager\/\" rel=\"noreferrer\">Set up Cert Manager in a Kubernetes cluster<\/a>&#8220;<\/p>\n<div class=\"kg-card kg-callout-card kg-callout-card-blue\">\n<div class=\"kg-callout-emoji\">\ud83d\udca1<\/div>\n<div class=\"kg-callout-text\">n this demo, we use the Cert Manager <b><strong style=\"white-space: pre-wrap;\">without<\/strong><\/b> a real Certificate Authority, such as Let&#8217;s Encrypt. So, the Cert Manager only creates <b><strong style=\"white-space: pre-wrap;\">self-signed certificates<\/strong><\/b>.<\/p>\n<p>But in production, you should use <b><strong style=\"white-space: pre-wrap;\">Cert Manager with a trusted Certificate Authority<\/strong><\/b> to generate valid certificates.<\/div>\n<\/div>\n<h2 id=\"set-up-rancher-using-helm\">Set Up Rancher using Helm<\/h2>\n<p>The setup begins with the requirements to install Rancher.<\/p>\n<h3 id=\"step-1-add-the-rancher-repo\">Step 1: Add the Rancher Repo<\/h3>\n<p>First, we need to add the entire Rancher Helm repo on our local machine and update the repo to ensure we have the latest chart.<\/p>\n<pre><code class=\"language-bash\">helm repo add rancher-stable https:\/\/releases.rancher.com\/server-charts\/stable\n\nhelm repo update<\/code><\/pre>\n<p>You can now directly install Rancher, though you can pull this chart on your local machine if you want.<\/p>\n<p>To pull the chart, use the following command.<\/p>\n<pre><code class=\"language-bash\">helm pull rancher-stable\/rancher --untar<\/code><\/pre>\n<p>The following is the directory structure of the Helm chart.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-19.png\" class=\"kg-image\" alt=\"the directory structure of the rancher helm chart\" loading=\"lazy\" width=\"2000\" height=\"3275\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-19.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/10\/image-19.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1600\/2025\/10\/image-19.png 1600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-19.png 2206w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>Here, you can see the values file (<code>values.yaml<\/code>) that has all the modifiable parameters.<\/p>\n<p>The following are the container images used on this chart.<\/p>\n<ul>\n<li><code>docker.io\/rancher\/rancher<\/code><\/li>\n<li><code>rancher\/shell:v0.5.0<\/code><\/li>\n<li><code>rancher\/mirrored-bci-micro:15.6.24.2<\/code><\/li>\n<\/ul>\n<p>We are going to do a custom installation so that anyone can try on any type of Kubernetes cluster.<\/p>\n<h3 id=\"step-2-create-custom-values-file\">Step 2: Create Custom Values File<\/h3>\n<p>The customization we used to give a hostname to access the Rancher and give a custom password to access the Rancher dashboard.<\/p>\n<p>To do this, create a file called <code>custom-values.yaml<\/code> with the following settings.<\/p>\n<pre><code class=\"language-yaml\">hostname: 4.246.120.68.sslip.io\n\ningress:\n  ingressClassName: \"nginx\"\n\n  tls:\n    source: rancher\n  \nbootstrapPassword: \"devops123\"<\/code><\/pre>\n<p>In the above configuration, we have added <\/p>\n<ul>\n<li><strong>Hostname<\/strong> &#8211; Change the <a href=\"https:\/\/devopscube.com\/ip-address-tutorial\/\" rel=\"noreferrer\">IP<\/a> with your node&#8217;s public IP or the DNS name of the Load Balancer created by the Ingress Controller.<\/li>\n<li><strong>Ingress Class<\/strong> &#8211; Name of the Ingress Class<\/li>\n<li><strong>TLS Certificate source<\/strong> &#8211; Source to create <a href=\"https:\/\/devopscube.com\/configure-ingress-tls-kubernetes\/\" rel=\"noreferrer\">TLS certificates<\/a> for Ingress<\/li>\n<li><strong>Password<\/strong> &#8211; Custom login password for Rancher<\/li>\n<\/ul>\n<p>The <code>*.sslip.io<\/code> is the wildcard DNS name and is required because, in Ingress, to attach TLS certificates, a domain name is required. This is only required for the testing environment.<\/p>\n<div class=\"kg-card kg-callout-card kg-callout-card-blue\">\n<div class=\"kg-callout-emoji\">\ud83d\udca1<\/div>\n<div class=\"kg-callout-text\">Instead of LB DNS, we can provide a hostname like <code spellcheck=\"false\" style=\"white-space: pre-wrap;\">rancher.techiescamp.com<\/code> if we already have a domain name and DNS service like <b><strong style=\"white-space: pre-wrap;\">Route53.<\/strong><\/b><\/p>\n<p>Using &#8220;rancher&#8221; as TLS source means that we are telling Rancher to use self-signed certificates.<\/p><\/div>\n<\/div>\n<h3 id=\"step-3-install-rancher\">Step 3: Install Rancher<\/h3>\n<p> Now, we are ready for the installation with the custom values file. <\/p>\n<p>Use the following command to install Rancher on a Kubernetes cluster.<\/p>\n<pre><code class=\"language-bash\">helm install rancher rancher-stable\/rancher \\\n  --namespace cattle-system \\\n  --create-namespace \\\n  -f custom-values.yaml<\/code><\/pre>\n<p>Once the installation is completed, you can see the instructions on the terminal on how to log in to Rancher.<\/p>\n<blockquote><p>Note: The Rancher pods will take 5 to 10 minutes to completly up and running<\/p><\/blockquote>\n<p>Before we login, we can check the status of the Rancher Pods.<\/p>\n<pre><code class=\"language-bash\">kubectl -n cattle-system get po<\/code><\/pre>\n<p>By default, Rancher will deploy with three replications for high availability.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-197.png\" class=\"kg-image\" alt=\"the list of pods from the rancher deployment\" loading=\"lazy\" width=\"2000\" height=\"937\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-197.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/10\/image-197.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1600\/2025\/10\/image-197.png 1600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w2400\/2025\/10\/image-197.png 2400w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>This confirms that all the Rancher pods are running without any issues. <\/p>\n<h3 id=\"step-6-access-rancher-ui\">Step 6: Access Rancher UI<\/h3>\n<p>Open any web browser and paste the URL <code>https:\/\/4.246.120.68.sslip.io:32001<\/code>, You will see a login page where you need to enter the password.<\/p>\n<div class=\"kg-card kg-callout-card kg-callout-card-blue\">\n<div class=\"kg-callout-emoji\">\u26a0\ufe0f<\/div>\n<div class=\"kg-callout-text\"><code spellcheck=\"false\" style=\"white-space: pre-wrap;\">32001<\/code> is the nodeport number of the Nginx Ingress controller service. If you are using Load Balancer, the Node Port number is not required.<\/div>\n<\/div>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-198.png\" class=\"kg-image\" alt=\"accessing the rancher from a browser\" loading=\"lazy\" width=\"833\" height=\"687\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-198.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-198.png 833w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>Since we use the HTTPS URL, it is showing as &#8220;Not secure&#8221; because we have used an untrusted SSL certificate created by Rancher.<\/p>\n<p>On the next page, you will need to confirm the Rancher server URL.<\/p>\n<p>Since we are not using DNS, we can give the Node&#8217;s IP address as the server URL.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-199.png\" class=\"kg-image\" alt=\"the welcome page of the rancher\" loading=\"lazy\" width=\"1686\" height=\"910\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-199.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/10\/image-199.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1600\/2025\/10\/image-199.png 1600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-199.png 1686w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>After clicking the &#8220;Continue&#8221; button, we can see the dashboard.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-26.png\" class=\"kg-image\" alt=\"the dashboard of the rancher on kubernets\" loading=\"lazy\" width=\"1173\" height=\"710\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-26.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/10\/image-26.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-26.png 1173w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>By default, we can see that a cluster is added to Rancher. This is a cluster where we install the Rancher. <\/p>\n<p>Now, we are ready to add clusters to Rancher to manage them.<\/p>\n<h2 id=\"adding-kubernetes-clusters-to-rancher\">Adding Kubernetes Clusters to Rancher<\/h2>\n<p>For this demo, I am using a Kind cluster, but you can use any Kubernetes cluster, even managed clusters like EKS, AKS, and <a href=\"https:\/\/devopscube.com\/setup-ingress-gke-ingress-controller\/\" rel=\"noreferrer\">GKE<\/a> as well.<\/p>\n<p>Assuming you already have a cluster, and if you want to set up a Kind cluster, you can refer to this blog &#8211;&gt; <a href=\"https:\/\/devopscube.com\/kubernetes-kind-cluster-tutorial-setup-and-deploy-apps\/\" rel=\"noreferrer\"><strong>Kubernetes Kind Cluster Tutorial<\/strong><\/a><strong>.<\/strong><\/p>\n<p>From the dashboard, click the &#8220;Import Existing&#8221; button to add a cluster.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-109.png\" class=\"kg-image\" alt=\"importig a cluster on Rancher\" loading=\"lazy\" width=\"1774\" height=\"1114\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-109.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/10\/image-109.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1600\/2025\/10\/image-109.png 1600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-109.png 1774w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>If the cluster is not a managed cluster, such as EKS, AKS, or GKE, choose the &#8220;Generic&#8221;<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-110.png\" class=\"kg-image\" alt=\"adding a cluster on rancher\" loading=\"lazy\" width=\"2000\" height=\"1061\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-110.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/10\/image-110.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1600\/2025\/10\/image-110.png 1600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w2400\/2025\/10\/image-110.png 2400w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>A &#8220;<a href=\"https:\/\/devopscube.com\/consul-service-discovery-beginners-guide\/\" rel=\"noreferrer\">Cluster Management<\/a>&#8221; page will open. Here, you need to provide a name for the cluster that you are going to add.<\/p>\n<p>This page has some other settings that we can configure, such as.<\/p>\n<p><strong>Basic &#8211; <\/strong>Cluster version management settings<\/p>\n<p><strong>Members Roles &#8211; <\/strong>Controls who can access the cluster with the defined level of permission (By default, the Admin user will be added)<\/p>\n<p><strong>Labels &amp; Annotations &#8211; <\/strong>Adding labels to clusters to identify and organize them (e.g., <code>environment: production<\/code>)<\/p>\n<p><strong>Registries &#8211; <\/strong>Configure the registries to pull images on a private environment (JFrog, Harbor, or Private Docker Hub)<\/p>\n<p><strong>Advanced &#8211; <\/strong>Settings for the Rancher Agent (Configure as variables). <\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-111.png\" class=\"kg-image\" alt=\"filling to add a cluster to rancher\" loading=\"lazy\" width=\"1169\" height=\"772\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-111.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/10\/image-111.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-111.png 1169w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>On the next page, we will get instructions to deploy the Rancher agent on the cluster that we want to add to the Rancher.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-200.png\" class=\"kg-image\" alt=\"the command to install the rancher agent on a kubernets cluster\" loading=\"lazy\" width=\"949\" height=\"885\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-200.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-200.png 949w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>Here, we have chosen the second command to install the Rancher agent on the Kind cluster because we have not used a valid SSL for the Rancher.<\/p>\n<p>To ensure that the Rancher agent is deployed in the cluster, use the following command.<\/p>\n<pre><code class=\"language-bash\">kubectl -n cattle-system get po<\/code><\/pre>\n<p>You will get the following output.<\/p>\n<pre><code class=\"language-bash\">NAME                                   READY   STATUS      RESTARTS   AGE\n\ncattle-cluster-agent-c4655cd8d-4zr9s   1\/1     Running     0          48m\ncattle-cluster-agent-c4655cd8d-ptp5q   1\/1     Running     0          49m\nhelm-operation-fr6fl                   0\/2     Completed   0          46m\nhelm-operation-vgnhz                   0\/2     Completed   0          46m\nrancher-webhook-6ddf589c5d-l4qsm       1\/1     Running     0          46m<\/code><\/pre>\n<p>Once the agent starts running, we can see the same UI page turn with the information of the added cluster.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-201.png\" class=\"kg-image\" alt=\"the dashborad of the added cluster in rancher\" loading=\"lazy\" width=\"940\" height=\"650\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-201.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-201.png 940w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>Here, you can see all the nodes of the Kind cluster. If you want to see the detailed information of a particular node, click on the node name.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-202.png\" class=\"kg-image\" alt=\"the detailed information of the control plane of the added cluster in rancher\" loading=\"lazy\" width=\"1188\" height=\"957\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-202.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/10\/image-202.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-202.png 1188w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>In the next section, we perform a simple operation of deploying a Pod via Rancher.<\/p>\n<h2 id=\"testing-a-deployment-from-rancher\">Testing a Deployment from Rancher<\/h2>\n<p>For testing, we are deploying an Nginx pod on a Kind cluster from the Rancher dashboard.<\/p>\n<p>Navigate to Workloads &#8211;&gt; Pods &#8211;&gt; Click the &#8220;Create&#8221; button.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-223.png\" class=\"kg-image\" alt=\"selecting the pod configuration on rancher to create a pod\" loading=\"lazy\" width=\"1265\" height=\"476\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-223.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/10\/image-223.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-223.png 1265w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>On the next page, you need to fill a form of Pod details such as pod name, container name, image name, etc then click &#8220;Create&#8221; button.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-224.png\" class=\"kg-image\" alt=\"filling the details on rancher form to deploy a pod \" loading=\"lazy\" width=\"926\" height=\"898\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-224.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-224.png 926w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<div class=\"kg-card kg-callout-card kg-callout-card-blue\">\n<div class=\"kg-callout-emoji\">\ud83d\udca1<\/div>\n<div class=\"kg-callout-text\">If you are familiar with YAML, then select the &#8220;<b><strong style=\"white-space: pre-wrap;\">Edit as YAML<\/strong><\/b>&#8221; button and change it with your settings.<\/div>\n<\/div>\n<p>You can see the status of the Pod creation as well as the information.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-225.png\" class=\"kg-image\" alt=\"the status of the pod creation in the rancher dashboard\" loading=\"lazy\" width=\"936\" height=\"378\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-225.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-225.png 936w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>Once the creation is successfully completed, you can see the following output.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-226.png\" class=\"kg-image\" alt=\"after creating the pod, the available options to make the modification on the deployment\" loading=\"lazy\" width=\"926\" height=\"525\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/10\/image-226.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/10\/image-226.png 926w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>If you click the three dots, you will see options like opening the pod shell, viewing logs, editing the configuration, cloning, downloading the pod&#8217;s YAML file, or deleting the pod.<\/p>\n<h2 id=\"rancher-operations\">Rancher Operations<\/h2>\n<p>Rancher is not only a dashboard to view all your cluster, deploy pods or troubleshoot.<\/p>\n<ol>\n<li>We can set a <strong>certralized authentication<\/strong> for all clusters by integrating systems like active directory, LDAP, GitHub, SAML or Okta<\/li>\n<li>We can directly deploy tools like Prometheus and Istio from the Rancher&#8217;s <strong>Apps &amp; Marketplace<\/strong> using helm charts.<\/li>\n<li>We can group namespaces across clusters for the multi cluster project management. We can also set quotas, permissions and policies for these groups.<\/li>\n<li>We can create Kubernetes clusters using cluster templates, and even create new Rancher managed clusters.<\/li>\n<li>Rancher Fleet is a GitOps method to manage applications across clusters like ArgoCD. It keeps on sync with the version contorl systems such as GitHub.<\/li>\n<\/ol>\n<h2 id=\"rancher-case-studies\">Rancher Case Studies<\/h2>\n<p>Rancher is already using by many organizations. Here are the few examples.<\/p>\n<ul>\n<li><a href=\"https:\/\/www.wwt.com\/case-study\/rancher-kubernetes-management-provides-increased-efficiency?ref=devopscube.com\" rel=\"noreferrer\">World Wide Technologs (WWT)<\/a> uses Rancher to quickly spin up Kubernetes clusters so that their development team can test a new features and applications.<\/li>\n<li><a href=\"https:\/\/www.suse.com\/c\/rancher_blog\/driving-kubernetes-adoption-in-finance-with-rancher\/?ref=devopscube.com\" rel=\"noreferrer\">Inventx<\/a> is a financial and insureence provider using Rancher to manage their multi cluster hybrid setup also to manage certrailzed compliance for the clusters.<\/li>\n<\/ul>\n<h2 id=\"clean-up-the-rancher-setup\">Clean up the Rancher Setup<\/h2>\n<p>If you want to clean the reancher setup, you can run the following YAML.<\/p>\n<pre><code class=\"language-bash\">kubectl create -f https:\/\/raw.githubusercontent.com\/rancher\/rancher-cleanup\/main\/deploy\/rancher-cleanup.yaml\n<\/code><\/pre>\n<p>This will run a Kubernetes Job to clean all the Rancher-related resources. To watch the cleanup, use the following command.<\/p>\n<pre><code class=\"language-bash\">kubectl -n kube-system logs -l job-name=cleanup-job -f\n<\/code><\/pre>\n<p>This will take a bit of time to complete the cleanup. Once it is completed, use the following command to verify <\/p>\n<pre><code class=\"language-bash\"># Check namespaces\nkubectl get namespaces | grep cattle\nkubectl get namespaces | grep fleet\n\n# Check CRDs\nkubectl get crd | grep cattle.io<\/code><\/pre>\n<p>Once verified, we need to remove the job as well.<\/p>\n<pre><code class=\"language-bash\">kubectl delete -f https:\/\/raw.githubusercontent.com\/rancher\/rancher-cleanup\/main\/deploy\/rancher-cleanup.yaml\n<\/code><\/pre>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>This blog covered the setup of Rancher on a Kubernetes cluster and a demo of how to add a cluster and perform operations on it from the Rancher dashboard.<\/p>\n<p>There is more you can do with the Rancher like authentication, upgradation or even create Rancher Kubernetes clusters.<\/p>\n<p>Explore them, and we will also cover those topics in the upcoming blogs.<\/p>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/setup-rancher-on-kubernetes-cluster\/\" target=\"_blank\" rel=\"noopener noreferrer\">Setup Rancher on Kubernetes Cluster \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/setup-rancher-on-kubernetes-cluster\/<\/p>\n","protected":false},"author":1,"featured_media":429,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-428","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=428"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/428\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/429"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}