Git Product home page Git Product logo

Comments (5)

brandond avatar brandond commented on May 28, 2024

I believe this is a duplicate of #9341

Remove the second endpoint, you don't need to specify the default endpoint; it is always tried last - and on this specific release it triggers a bug in the registries configuration.

from k3s.

kingsd041 avatar kingsd041 commented on May 28, 2024

@brandond I removed the second default endpoint, but the situation is still the same.

root@ip-172-31-15-10:/etc/rancher/k3s# cat registries.yaml
mirrors:
  "docker.io":
    endpoint:
      - "https://docker.nju.edu.cn/"
root@ip-172-31-15-10:/etc/rancher/k3s#
root@ip-172-31-15-10:/etc/rancher/k3s# systemctl restart k3s
root@ip-172-31-15-10:/etc/rancher/k3s# crictl info | grep -A 5 "registry"
    "registry": {
      "configPath": "/var/lib/rancher/k3s/agent/etc/containerd/certs.d",
      "mirrors": null,
      "configs": null,
      "auths": null,
      "headers": null

from k3s.

brandond avatar brandond commented on May 28, 2024

I'm not sure that crictl info will show mirrors when configPath is in use; you have to actually look at the filesystem. Have you checked to confirm that /var/lib/rancher/k3s/agent/etc/containerd/certs.d/docker.io/hosts.toml exists and has the correct content?

ref: https://github.com/containerd/containerd/blob/main/docs/hosts.md

from k3s.

kingsd041 avatar kingsd041 commented on May 28, 2024

/var/lib/rancher/k3s/agent/etc/containerd/certs.d/docker.io/hosts.toml of v1.28.7+k3s1 shows the mirror I configured:

root@ip-172-31-4-143:~# cat /etc/rancher/k3s/registries.yaml
mirrors:
  "docker.io":
    endpoint:
      - "https://docker.nju.edu.cn/"

root@ip-172-31-4-143:~# cat /var/lib/rancher/k3s/agent/etc/containerd/certs.d/docker.io/hosts.toml
# File generated by k3s. DO NOT EDIT.
server = "https://registry-1.docker.io/v2"

[host."https://docker.nju.edu.cn/v2"]
  capabilities = ["pull", "resolve"]

However, I also tried the same operation using v1.28.5+k3s1. Using v1.28.5+k3s1, I can display the mirror information through crictl info:

root@ip-172-31-10-120:~# k3s -v
k3s version v1.28.5+k3s1 (5b2d1271)
go version go1.20.12

root@ip-172-31-10-120:~# crictl info | grep -A 5 "registry"
    "registry": {
      "configPath": "",
      "mirrors": {
        "docker.io": {
          "endpoint": [
            "https://docker.nju.edu.cn/"

root@ip-172-31-10-120:~# cat /etc/rancher/k3s/registries.yaml
mirrors:
  "docker.io":
    endpoint:
      - "https://docker.nju.edu.cn/"

Moreover, I also observed that the Containerd versions of v1.28.7+k3s1 and v1.28.5+k3s1 are both v1.7.11-k3s2, @brandond Do you know the reason why v1.28.7+k3s1 cannot display mirror through crictl info?

from k3s.

brandond avatar brandond commented on May 28, 2024

Because we switched to using hosts.d (configPath) instead of the deprecated inline mirrors config.

from k3s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.