@@ -3315,16 +3315,32 @@ oom_score = -999
33153315 default_runtime_name = "runc"
33163316[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
33173317 runtime_type = "io.containerd.runc.v2"
3318- [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
3319- endpoint = ["https://mirror.gcr.io","https://registry-1.docker.io"]
3320- # Enable registry.k8s.io as the primary mirror for k8s.gcr.io
3321- # See: https://github.com/kubernetes/k8s.io/issues/3411
3322- [plugins."io.containerd.grpc.v1.cri".registry.mirrors."k8s.gcr.io"]
3323- endpoint = ["https://registry.k8s.io", "https://k8s.gcr.io",]
33243318[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
33253319 SystemdCgroup = ${systemdCgroup}
3320+ # enable hosts config
3321+ [plugins."io.containerd.grpc.v1.cri".registry]
3322+ config_path = "/etc/containerd/certs.d"
33263323EOF
33273324
3325+ # used for 5k node scale tests with private pull-through cache
3326+ if [[ -n " ${KUBERNETES_REGISTRY_PULL_THROUGH_HOST:- } " ]]; then
3327+ registry_config_dir=" /etc/containerd/certs.d/registry.k8s.io"
3328+ mkdir -p " ${registry_config_dir} "
3329+ {
3330+ # NOTE: we need literal double quotes around some of these values
3331+ echo ' server="' " ${KUBERNETES_REGISTRY_PULL_THROUGH_HOST} " ' "'
3332+ echo ' '
3333+ echo ' [host."' " ${KUBERNETES_REGISTRY_PULL_THROUGH_HOST} " ' "]'
3334+ echo ' override_path = true'
3335+ echo ' capabilities = ["pull", "resolve"]'
3336+ # TODO: this is a hack. https://github.com/containerd/containerd/issues/7385
3337+ echo ' [host."' " ${KUBERNETES_REGISTRY_PULL_THROUGH_HOST} " ' ".header]'
3338+ if [[ -n " ${KUBERNETES_REGISTRY_PULL_THROUGH_BASIC_AUTH_TOKEN:- } " ]]; then
3339+ echo " authorization = '" " ${KUBERNETES_REGISTRY_PULL_THROUGH_BASIC_AUTH_TOKEN} " " '"
3340+ fi
3341+ } > " ${registry_config_dir} /hosts.toml"
3342+ fi
3343+
33283344 if [[ " ${CONTAINER_RUNTIME_TEST_HANDLER:- } " == " true" ]]; then
33293345 cat >> " ${config_path} " << EOF
33303346# Setup a runtime with the magic name ("test-handler") used for Kubernetes
0 commit comments