-
curl -sfLk https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.9+k3s1 sh -s - --disable traefik --disable-default-registry-endpoint centos7 vi /etc/rancher/k3s/registries.yaml mirrors:
"docker.io":
endpoint:
- "https://uph96ue9.mirror.aliyuncs.com",
- "https://mirror.ccs.tencentyun.com",
- "https://hub-mirror.c.163.com",
- "https://mirror.baidubce.com"
"ccr.ccs.tencentyun.com":
endpoint:
- "https://ccr.ccs.tencentyun.com"
"registry.cn-hangzhou.aliyuncs.com":
endpoint:
- "https://registry.cn-hangzhou.aliyuncs.com"
configs:
"registry.cn-hangzhou.aliyuncs.com":
auth:
username: ihezebin
password: xxxx
"ccr.ccs.tencentyun.com":
auth:
username: 100009173056
password: xxxx sudo systemctl restart k3s
but if remove the docker config, like this:
![]() |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
What I want to achieve is something like docker's sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": [
"https://uph96ue9.mirror.aliyuncs.com",
"https://mirror.ccs.tencentyun.com",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
],
"exec-opts": ["native.cgroupdriver=systemd"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker |
Beta Was this translation helpful? Give feedback.
-
That's not valid YAML... you shouldn't put a trailing comma at the end of each list entry. You're not seeing anything in config.toml because it's throwing an error when loading your registries.yaml, which probably shows up in the logs if you'd looked at them. Either do mirrors:
"docker.io":
endpoint: ["https://uph96ue9.mirror.aliyuncs.com", "https://mirror.ccs.tencentyun.com"] or mirrors:
"docker.io":
endpoint:
- "https://uph96ue9.mirror.aliyuncs.com"
- "https://mirror.ccs.tencentyun.com"
but not mirrors:
"docker.io":
endpoint:
- "https://uph96ue9.mirror.aliyuncs.com",
- "https://mirror.ccs.tencentyun.com" |
Beta Was this translation helpful? Give feedback.
That's not valid YAML... you shouldn't put a trailing comma at the end of each list entry. You're not seeing anything in config.toml because it's throwing an error when loading your registries.yaml, which probably shows up in the logs if you'd looked at them.
Either do
or
but not