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
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:

system-default-registry.png

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 URLRancher GitHub URLRancher Gitee URL
https://git.rancher.io/helm3-chartshttps://github.com/rancher/helm3-chartshttps://gitee.com/rancher/helm3-charts
https://git.rancher.io/chartshttps://github.com/rancher/chartshttps://gitee.com/rancher/charts
https://git.rancher.io/system-chartshttps://github.com/rancher/system-chartshttps://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

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center