78 lines
1.9 KiB
Markdown
78 lines
1.9 KiB
Markdown
sudo vim /etc/rancher/k3s/registries.yaml
|
|
|
|
```yaml
|
|
mirrors:
|
|
docker.io:
|
|
endpoint:
|
|
- "https://docker.1ms.run"
|
|
- "https://docker.m.daocloud.io"
|
|
- "https://docker.1panel.live"
|
|
- "https://docker-0.unsee.tech"
|
|
- "https://dytt.online"
|
|
- "https://lispy.org"
|
|
- "https://docker.xiaogenban1993.com"
|
|
- "https://666860.xyz"
|
|
- "https://hub.rat.dev"
|
|
- "https://demo.52013120.xyz"
|
|
- "https://proxy.vvvv.ee"
|
|
- "https://registry.cyou"
|
|
- "http://hub-mirror.c.163.com"
|
|
|
|
# rancher 镜像加速
|
|
"rancher":
|
|
endpoint:
|
|
- "https://docker.1ms.run/rancher"
|
|
|
|
configs:
|
|
"docker.1ms.run":
|
|
tls:
|
|
insecure_skip_verify: true
|
|
|
|
```
|
|
|
|
```bash
|
|
# Master 节点重启 k3s
|
|
sudo systemctl restart k3s
|
|
|
|
# Worker 节点重启 k3s-agent
|
|
sudo systemctl restart k3s-agent
|
|
```
|
|
|
|
## container ctr
|
|
|
|
```bash
|
|
vim /etc/containerd/config.toml
|
|
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry]
|
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
|
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
|
|
endpoint = [
|
|
"https://docker.1panel.live",
|
|
"https://docker.1ms.run",
|
|
"https://dytt.online",
|
|
"https://docker-0.unsee.tech",
|
|
"https://lispy.org",
|
|
"https://docker.xiaogenban1993.com",
|
|
"https://666860.xyz",
|
|
"https://hub.rat.dev",
|
|
"https://docker.m.daocloud.io",
|
|
"https://demo.52013120.xyz",
|
|
"https://proxy.vvvv.ee",
|
|
"https://registry.cyou"
|
|
]
|
|
|
|
|
|
sudo systemctl restart containerd
|
|
sudo ctr image pull docker.io/library/verdaccio:latest
|
|
|
|
# K3s 使用 k8s.io 命名空间
|
|
sudo ctr -n k8s.io images pull docker.m.daocloud.io/rancher/mirrored-pause:3.6
|
|
|
|
sudo ctr -n k8s.io images tag docker.m.daocloud.io/rancher/mirrored-pause:3.6 docker.io/rancher/mirrored-pause:3.6
|
|
|
|
sudo ctr -n k8s.io images delete docker.m.daocloud.io/rancher/mirrored-pause:3.6
|
|
|
|
# 查看镜像
|
|
sudo ctr -n k8s.io images ls | grep pause
|
|
``` |