Rancher is an open-source container management platform that simplifies deploying and managing Kubernetes clusters across multiple environments, including on-premises servers, cloud providers, and hybrid setups. It’s particularly helpful for teams and organizations looking to manage clusters across various environments efficiently. But How to use rancher for managing kubernetes cluster?

Key Features of Rancher:

  1. Multi-Cluster Management: Rancher enables centralized management of multiple Kubernetes clusters, allowing you to create, configure, and monitor clusters from a single interface.
  2. User Access Control: It provides granular role-based access control (RBAC), making it easier to manage permissions and ensure secure access across clusters.
  3. Application Catalog: Rancher offers a catalog of pre-configured applications, based on Helm charts, to quickly deploy popular tools like databases, CI/CD systems, and monitoring tools.
  4. Project and Namespace Management: You can organize Kubernetes namespaces into projects, making it easier to group resources and manage them within a multi-tenant environment.
  5. Built-in Monitoring and Alerts: Rancher integrates with Prometheus and Grafana for monitoring and provides alerting capabilities, helping to manage the health and performance of clusters and applications.
  6. CICD Support: Rancher supports CI/CD pipeline creation, making it easier to automate deployment workflows for containerized applications.

Here’s a basic overview of how you can start using Rancher to manage Kubernetes clusters:

Set Up Rancher

  • Install Rancher on a server or VM. Rancher can run as a Docker container, making it straightforward to install.
  • Once installed, you can access the Rancher UI through a web browser to manage clusters and applications.

Install Rancher inside docker

Please note. I assumed that you was docker installed already in your machine.

# Install rancher
docker run -d \
   --name=rancher \
   --restart=unless-stopped -p 8080:80 -p 5443:443 \
   --privileged rancher/rancher:v2.7.6

Get your init password and access your rancher at https://127.0.0.1:5443

# get init password
docker logs rancher 2>&1 | grep "Bootstrap Password:"

# Example output
2024/11/07 11:37:03 [INFO] Bootstrap Password: 45w7bqvh6cg5blvxwkmp85g4hqkw6x2d2wfp84gs7wpqdhxfk7q64b

Fill Password with yours

After that, you must create new password. Here i used random password like 8P7kxXcuEcjxEoLl

Provision Kubernetes Clusters:

  • Through Rancher’s UI, you can create new Kubernetes clusters or import existing ones. Rancher supports various cloud providers (AWS, Azure, GCP) and also allows for custom node setups.
  • Rancher also simplifies creating clusters on hosted providers like EKS (Amazon), AKS (Azure), and GKE (Google).

Import Cluster

If you don’t have cluster, you can create one. Read this post about build cluster using RKE

Step:

  • From Dashboard Page, click Import
  • Next, click generate
  • Add some name like “my-cluster”
  • Below is picture showing command that you can import your cluster

Using Rancher makes Kubernetes cluster management significantly easier, especially in multi-cluster and hybrid setups.

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *