In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to set up Rancher 2.0in offline or intranet environment. It is very detailed and has certain reference value. Interested friends must finish reading it.
Private mirror library
Because all Rancher-related services run in containers, the first thing you need is to store containers in the environment. In the example in this article, we will use Docker Registry (Docker Image Repository). If you already have an image repository, you can skip these steps.
Note: in Rancher 2.0, only image repositories without authentication can obtain all the images needed to start and run Rancher 2.0. This does not affect the configurable image repositories used in the workload.
To run Docker Registry, you need to run an instance of a registry:2 image. We will expose the default port (5000) and mount a host directory to make sure we have enough space (at least we need 8GB) and get the appropriate Imax O performance.
Docker run-d-p 5000 name registry 5000-- restart=always-- name registry-v / opt/docker-registry:/var/lib/registry registry:2 makes the Rancher image run
After the mirror repository is set up, start synchronizing the required mirrors to run Rancher 2.0. In this step, we will discuss two scenarios:
Scenario 1: you have a host with access to DockerHub to extract and save images, and a separate host with access to your private image repository for push images.
Scenario 2: you have a host that can access DockerHub and private image repositories.
Scenario 1: one host accesses the DockerHub and the other accesses the private image repository
With each version update release (https://github.com/rancher/rancher/releases/tag/v2.0.0) of Rancher, plug-ins are provided for this scenario. You need the following script:
* * rancher-save-images.sh:** this script will pull all the required images from DockerHub and save all images as a rancher-images.tar.gz compressed file. You can transfer this file to an internal deployment host that has access to your private image repository.
* * rancher-load-images.sh:** this script will load images from rancher-images.tar.gz and push them to your private image repository. The hostname rancher-load-images.sh registry.yourdomain.com:5000 of the private image repository needs to be provided in the first parameter of the script.
The flow of scenario one
Scenario 2: a host with access to DockerHub and private image repositories
For this scenario, every time the version of Rancher is updated
(https://github.com/rancher/rancher/releases/tag/v2.0.0), will provide a file called rancher-images.txt. This file contains all the images needed to run Rancher 2.0. You can bind it to any existing automation service to synchronize any images you might have, or you can use the script / Docker image I show below.
The flow of scenario 2
Configure Rancher to use a private image repository
The last step of the process is to configure Rancher, using the private image repository as the source for obtaining images. This can be configured by using system-default-registry in the Setting view.
Setting bar
If you want to use a private image repository, do not use https:// or http:// as a prefix when configuring settings
Doing so ensures that rancher/rancher-agent containers that are used to add nodes to the cluster will use this value as a prefix. Other images that need to be used also need to be configured in this way.
If you want to configure when you start the rancher/rancher container, you can use the environment variable CATTLE_SYSTEM_DEFAULT_REGISTRY
For example:
Docker run-d-p 80:80-p 443-e CATTLE_SYSTEM_DEFAULT_REGISTRY=registry.yourdomain.com:5000 registry.yourdomain.com:5000/rancher/rancher:v2.0.0 create a cluster
You can access the Rancher 2.0 UI by running the IP of the host where the rancher/rancher container resides. It takes about 1 minute to start at first, and you will be prompted to set a password on your first visit.
Set password
Next, you need to configure URL, and the node will contact the Rancher 2.0 installation through this address. By default, it displays the IP address where you accessed UI, but you can change it here if you want to use the DNS name or load balancer.
In the Global view, click Add Cluster
_ add cluster _
This article will take you through the creation of a custom cluster without advanced options. To configure advanced options in your cluster, please refer to the relevant documentation.
Add a custom cluster called testcluster
Click Next to create a testcluster cluster.
In the next interface, you will get a generated command to start on the node you want to add to the cluster. The images used in this command should be automatically prefixed with the private image repository you configured.
Add nodes to the cluster
Now, for the nodes you want to add, you can choose which roles to use for them, and you can choose to configure the IP of that node. If not specified, IP is automatically detected. Please also refer to the documentation for the meaning of Node Roles.
Configure access to the image repository in the project
As mentioned earlier, Rancher 2.0 does not currently support the use of private image repositories with authentication to run images required by Rancher 2.0. In this case, however, Rancher 2.0 supports workloads in project.
To configure the image repository with authentication, you can open your project in the cluster (the Default project is automatically created for you). In the Default project, you can navigate to Resources- > Registries to configure the image repository for the workload.
Configure the image repository in the default settings of project
Click Add Registry
Add Image Warehouse
Fill in the information required to access the image repository:
The above is all the contents of the article "how to set up Rancher 2.0 in an offline or intranet environment". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.