How to Install and Use Rancher: A Step‑by‑Step Guide for Kubernetes Management
This article explains what Rancher is, how to check system and software versions, and provides a detailed step‑by‑step guide to install Docker, pull the Rancher image, run the container with proper parameters, and configure access, clusters, alerts, and custom settings.
What is Rancher
Rancher is a Kubernetes management tool that lets you deploy and run clusters on any provider or location. It can create clusters from managed Kubernetes services, provision nodes and install Kubernetes, or import existing clusters. Rancher adds unified authentication and RBAC across clusters, fine‑grained monitoring, alerting, log forwarding, Helm integration via an Application Catalog, and supports CI/CD integration or its built‑in Fleet for automated workload deployment and upgrades. It is a full‑stack Kubernetes container management platform.
This document records how to install and use Rancher.
Checking System and Software Versions
# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
# uname -a
Linux CentOS7K8SMaster01063 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
# kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.4", GitCommit:"c27b913fddd1a6c480c229191a087698aa92f0b1", GitTreeState:"clean", BuildDate:"2019-02-28T13:37:52Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.4", GitCommit:"c27b913fddd1a6c480c229191a087698aa92f0b1", GitTreeState:"clean", BuildDate:"2019-02-28T13:30:26Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}Installation and Configuration
Install Docker
# Update repository
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# Install Docker packages
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginPull Rancher image (use version matching your Kubernetes version; for K8s 1.13.4 use Rancher v2.3.3)
docker pull rancher/rancher:v2.3.3Run the container
docker run --privileged -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:v2.3.3Parameter explanation:
# Run Docker
docker run
# Grant privileged mode (container has root access to the host)
--privileged
# Run in background
-d
# Restart automatically unless stopped
--restart=unless-stopped
# Port mapping
-p 80:80 -p 443:443
# Image to run
rancher/rancher:v2.3.3Access and initial setup (use HTTPS)
https://<ip>:<port>On first login change the admin password.
Set language to Chinese.
Add a cluster (import an existing one).
Cluster name cannot contain Chinese characters.
If using a self‑signed certificate, run the following command on the master node:
Configure alerts:
First add a notification channel.
Add alert rules in the default alert group by right‑clicking and selecting upgrade.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
