Best practices for deploying Rancher v2.x and Rancher provisioned Kubernetes clusters in China
This document (000020037) is provided subject to the disclaimer at the end of this document.
Situation
Task
Users might experience a slow or unstable connection to GitHub and Docker Hub from China. As a result, Rancher Docker images and catalogs should be configured to use the Alibaba Cloud Docker image registry and Gitee git repositories, when deploying Rancher and downstream clusters within China. This article details how to configure these in Rancher Kubernetes Engine (RKE) CLI or Rancher v2.x provisioned clusters.
Pre-requisites
- A Rancher v2.x instance, being deployed in China, either a single Docker container or a Highly Available (HA) installation in Kubernetes
Configure the Alibaba Cloud Docker image repository for installation of Rancher v2.x
A single Docker container installation of Rancher
Specify the repository URL in the docker run
command, e.g.:
docker run -itd -p 80:80 -p 443:443 \
--restart=unless-stopped \
-e CATTLE_AGENT_IMAGE="registry.cn-hangzhou.aliyuncs.com/rancher/rancher-agent:v2.4.2" \
registry.cn-hangzhou.aliyuncs.com/rancher/rancher:v2.4.2
A Highly Available (HA) installation of Rancher in a Kubernetes cluster
Specify private_registries in the RKE configuration file (cluster.yaml), e.g.:
nodes:
- address: x.x.x.x
internal_address: y.y.y.y
user: ubuntu
role: [controlplane,worker,etcd]
private_registries:
- url: registry.cn-hangzhou.aliyuncs.com
is_default: true
Helm v2 installation only
Specify the tiller-image for tiller initialisation. e.g.:
helm init --service-account tiller --tiller-image registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:<tag>
The list of tiller image tags are available here.
Downstream clusters
Configure the system-default-registry for Rancher, setting the value to registry.cn-hangzhou.aliyuncs.com
, per the following example:
Configure the Gitte git repository for Rancher App catalogs
Having installed Rancher, replace the default catalog URLs with the equivalent Gitee URLs, per the following table:
Rancher Catalog URL | Rancher GitHub URL | Rancher Gitee URL |
---|---|---|
https://git.rancher.io/helm3-charts | https://github.com/rancher/helm3-charts | https://gitee.com/rancher/helm3-charts |
https://git.rancher.io/charts | https://github.com/rancher/charts | https://gitee.com/rancher/charts |
https://git.rancher.io/system-charts | https://github.com/rancher/system-charts | https://gitee.com/rancher/system-charts |
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000020037
- Creation Date: 06-May-2021
- Modified Date:06-May-2021
-
- SUSE Rancher
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com