(11) K8S visualization tool Rancher learning and installation

1. Overview of Rancher background

Over the past few years, container technologies such as Docker and container orchestration engines such as Kubernetes have gained significant attention and adoption, revolutionizing the deployment, scalability, and management of applications.
However, with the rapid development of container technology, the management and operation of container clusters become more and more complex. For different container orchestration engines and cloud platforms, different tools and interfaces need to be learned and mastered, which brings certain challenges to developers and operation and maintenance personnel.
In order to simplify the management and operation of container clusters, Rancher came into being. Rancher provides a unified container management platform designed to provide users with a unified interface and tools, whether running on Kubernetes, Docker Swarm, Mesos or other container orchestration engines, can be centrally managed through Rancher.

2. Rancher features

  • Multi-cluster management: Rancher allows users to manage multiple container clusters in a unified interface, whether based on Kubernetes or other container orchestration engines. This allows users to easily manage and monitor multiple clusters, improving operational efficiency.

  • Application Catalog: Rancher provides an application catalog that contains templates for various commonly used containerized applications. Users can choose templates that suit their needs, quickly deploy and manage containerized applications, and simplify the application deployment process.

  • Network and load balancing: Rancher provides network and load balancing functions, allowing users to easily define network communication and load balancing policies between containers. This helps in building complex application architectures and ensures proper communication and load balancing between containers.

  • Security and access control: Rancher provides security-related features, including role-based access control, user authentication, audit logs, and more. This helps users secure container clusters and control user access to clusters and applications.

3. Advantages of Rancher

  • Simplified container management: Rancher provides an intuitive interface and tools that allow users to easily manage and operate container clusters without deep knowledge of the underlying container orchestration engine.
  • Cross-platform support: Rancher supports multiple container orchestration engines and cloud platforms, enabling users to use the same tools and interfaces for container management in different environments.
  • Improve productivity: Through Rancher's automation and integration functions, users can quickly deploy and expand containerized applications, reducing tedious configuration and management work, and improving team productivity.

4. Rancher uses

Rancher can be used in various scenarios and purposes, including but not limited to:

  • Deployment and management of containerized applications: Rancher provides an easy-to-use interface and tools that allow users to quickly deploy, manage, and scale containerized applications.
  • Container management across multiple cloud platforms and data centers: Rancher supports multiple cloud platforms and data centers, and users can manage container clusters in different environments in a unified manner.
  • Container management in a multi-tenant environment: Rancher provides a multi-tenant function that can divide container clusters into different tenants and provide independent access control and resource isolation.

All in all, Rancher is a feature-rich, easy-to-use container management platform that simplifies the deployment and management process of containerized applications and improves team efficiency and productivity. It is suitable for a variety of scenarios, from individual developers to large enterprises, can benefit from Rancher's features and functions

5. Rancher use

Chinese address https://docs.rancher.cn/

Environmental preparation

OS: Centos 7
docker version: docker-ce-20.10.10-3.el7
rancher version: v2.5.7

Install docker here without going into details, please refer to the previous article (2) K8S common cluster architecture construction

Create a mount directory

mkdir -p /data/rancher_home/rancher
mkdir -p /data/rancher_home/auditlog

Deploy Rancher (understandable as the master node of k8s)

docker run -d --privileged --restart=unless-stopped -p 80:80 -p 443:443 \
-v /data/rancher_home/rancher:/var/lib/rancher \
-v /data/rancher_home/auditlog:/var/log/auditlog \
--name my_rancher1 rancher/rancher:v2.5.7

Log in

Access the address of the Rancher server. By default, the following http://<服务器IP地址>Rancher server can be accessed. After visiting this address in the browser, the welcome page of Rancher will appear. Set an administrator password and login credentials. Note that if you are asked to enter the CurrentPassword for the first time, adminjust enter it.

insert image description here
switch language
insert image description here

Add cluster configuration RancherAgent node (understandable as k8s working node)

Overview:

Rancher Agent is a component in the Rancher project, which is used to communicate with the Rancher console and perform specified operations. It acts as a bridge between the Rancher console and the Kubernetes cluster and is responsible for deploying and managing workloads in the cluster.
The Rancher Agent runs on each node and receives instructions and reports the status of the node by establishing a connection with the Rancher Server (that is, the Rancher console). It is responsible for communicating operational instructions on the Rancher console to nodes, such as deploying containers, updating configurations, performing upgrades, etc. At the same time, it will also return the status information of the node to the Rancher console for administrators and users to view and manage.

Steps

1. Add cluster
insert image description here

2. Select Custom
insert image description here
3. Fill in the cluster name
insert image description here
4. Check the host option, copy the command, and click Finish
insert image description here
5. Add the host node
Make sure that docker is installed on the host of the RancherAgent node,
execute the command copied in step 4, and
return to the rancher interface after the installation is complete It can be seen
insert image description here
that the cluster is not ready because there are many images to be downloaded, so wait patiently, it will take half an hour or more.
After completion, you can see that it has changed to the Active state
insert image description here

Guess you like

Origin blog.csdn.net/csdn570566705/article/details/131048892