This paper takes kubespray as an example, other approaches are similar.
- A cloud host in Hong Kong or other non-mainland China
- Cloud hosts need to install docker
git clone https://github.com/kubernetes-sigs/kubespray
This step needs to be performed on cloud hosts in non-mainland China. Let’s assume that his IP is
git clone https://github.com/duanhongyi/docker-mirrors
Let’s take modifying
/etc/hosts as an example and hijack DNS to this cloud host.
18.104.22.168 gcr.io quay.io
That’s good. You can install kubernetes happily.
ansible-playbook -i inventory/drycc/hosts.ini --become --become-user=root cluster.yml
After installation, you can also hijack the DNS of kubernetes to the cloud host.
Take coredns as an example:
kubectl edit ConfigMap/coredns -n kube-system
Modify the data item: