1 友情链接

2 二进制文件加速

2.1 使用方法

在原始 URL 上面加入 files.m.daocloud.io 的 前缀 就可以使用。比如:

1
2
3
4
5
# Helm 下载原始URL
wget https://get.helm.sh/helm-v3.9.1-linux-amd64.tar.gz

# 加速后的 URL
wget https://files.m.daocloud.io/get.helm.sh/helm-v3.9.1-linux-amd64.tar.gz

2.2 安装 Helm

1
2
3
4
5
6
7
cd /tmp
export HELM_VERSION="v3.9.3"

wget "https://files.m.daocloud.io/get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz"
tar -zxvf helm-${HELM_VERSION}-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
helm version

2.3 安装 KIND

1
2
3
4
5
6
7
cd /tmp
export KIND_VERSION="v0.22.0"

curl -Lo ./kind https://files.m.daocloud.io/github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64
chmod +x ./kind
mv ./kind /usr/bin/kind
kind version

2.4 安装 istio

1
2
3
4
5
6
cd /tmp
export ISTIO_VERSION="1.14.3"

wget "https://files.m.daocloud.io/github.com/istio/istio/releases/download/${ISTIO_VERSION}/istio-${ISTIO_VERSION}-linux-amd64.tar.gz"
tar -zxvf istio-${ISTIO_VERSION}-linux-amd64.tar.gz
# Do follow the istio docs to install istio

2.5 安装 nerdctl (代替 docker 工具)

1
2
3
4
5
6
7
export NERDCTL_VERSION="1.7.6"
mkdir -p nerdctl ;cd nerdctl
wget https://files.m.daocloud.io/github.com/containerd/nerdctl/releases/download/v${NERDCTL_VERSION}/nerdctl-full-${NERDCTL_VERSION}-linux-amd64.tar.gz
tar -zvxf nerdctl-full-${NERDCTL_VERSION}-linux-amd64.tar.gz
mkdir -p /opt/cni/bin ;cp -f libexec/cni/* /opt/cni/bin/ ;cp bin/* /usr/local/bin/ ;cp lib/systemd/system/*.service /usr/lib/systemd/system/
systemctl enable containerd ;systemctl start containerd --now
systemctl enable buildkit;systemctl start buildkit --now

3 docker镜像加速

3.1 使用方法

增加前缀 (推荐方式)。比如:

1
2
3
4
              docker.io/library/busybox
|
V
m.daocloud.io/docker.io/library/busybox

或者 支持的镜像仓库 的 前缀替换 就可以使用。比如:

1
2
3
4
           docker.io/library/busybox
|
V
docker.m.daocloud.io/library/busybox

3.2 通过 加速 安装 kubeadm

1
kubeadm config images pull --image-repository k8s-gcr.m.daocloud.io

3.3 通过 加速 安装 kind

1
kind create cluster --name kind --image m.daocloud.io/docker.io/kindest/node:v1.22.1

3.4 通过 加速 部署 应用(这里以 Ingress 为例)

1
2
3
4
5
wget -O image-filter.sh https://github.com/DaoCloud/public-image-mirror/raw/main/hack/image-filter.sh && chmod +x image-filter.sh

wget -O deploy.yaml https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/deploy/static/provider/baremetal/deploy.yaml

cat ./deploy.yaml | ./image-filter.sh | kubectl apply -f -

3.5 Docker 加速

添加到 /etc/docker/daemon.json

1
2
3
4
5
{
"registry-mirrors": [
"https://docker.m.daocloud.io"
]
}

4 helm 加速

1
helm repo add community https://release.daocloud.io/chartrepo/community