1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| # create a directory with the registry name sudo mkdir -p /var/snap/microk8s/current/args/certs.d/k8s.gcr.io
# create the hosts.toml file pointing to the mirror echo ' server = "https://k8s.gcr.io"
[host."https://registry.aliyuncs.com/v2/google_containers"] capabilities = ["pull", "resolve"] override_path = true ' | sudo tee -a /var/snap/microk8s/current/args/certs.d/k8s.gcr.io/hosts.toml
# 2 sudo mkdir -p /var/snap/microk8s/current/args/certs.d/registry.k8s.io echo ' server = "registry.k8s.io"
[host."https://registry.aliyuncs.com/v2/google_containers"] capabilities = ["pull", "resolve"] override_path = true ' | sudo tee -a /var/snap/microk8s/current/args/certs.d/registry.k8s.io/hosts.toml
|