跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[Kubernetes] 本来想用 containerd 部署 k8s 来着,然后发现了点 containerd 强迫症的地方

发表于

因为之前一次装 k8s 用的是 docker+cri 插件的方法,很简单,也很方便,但是当时也是稀里糊涂的按照网上搜到的教程装的,了解到 containerd 是原生支持 k8s 的不需要安装什么插件,所以我想试试 containerd 。

然后问题来了,因为我用的源里面实在是没有 containerd ,所以我挂代理用最新的官方源下载的,但是下载完了配置好国内加速镜像之后拉去的时候会提示,直接在配置文件里设置镜像加速这种方法将会在新的版本中废弃,现在是在配置文件中指定路径然后再路径中指定镜像源的信息。

    [plugins."io.containerd.grpc.v1.cri".registry]
      config_path = "/etc/containerd/certs.d"

然后

[root@harbor containerd]# cat certs.d/hosts.toml 
server = "https://registry-1.docker.io"

[host."https://registry-1.docker.io"]
  capabilities = ["pull", "resolve"]
  [host."https://registry-1.docker.io".header]
    # Authorization = ["Basic <base64_encoded_auth>"]
  [host."https://registry-1.docker.io".tls]
    insecure_skip_verify = false
  [host."https://registry-1.docker.io".mirrors]
    endpoint = ["https://hub-mirror.c.163.com"]

这样配置好了之后发现,直接 ctr i pull nginx 这样是不行的,得敲完整的名称例如

ctr image pull docker.io/library/nginx:latest

我就感觉很不适应,明明 docker 得时候直接写镜像名称得时候默认去官网拉最新得那个 这让人很不舒服

然后问 ai ,ai 说配置成这样(加个[host."docker.io"])

server = "https://registry-1.docker.io"

[host."https://registry-1.docker.io"]
  capabilities = ["pull", "resolve"]
  [host."https://registry-1.docker.io".header]
    # 如果需要认证信息,可以在这里添加
    # Authorization = ["Basic <base64_encoded_auth>"]
  [host."https://registry-1.docker.io".tls]
    insecure_skip_verify = false
  [host."https://registry-1.docker.io".mirrors]
    endpoint = ["https://hub-mirror.c.163.com"]

[host."docker.io"]
  capabilities = ["pull", "resolve"]
  [host."docker.io".header]
    # 如果需要认证信息,可以在这里添加
    # Authorization = ["Basic <base64_encoded_auth>"]
  [host."docker.io".tls]
    insecure_skip_verify = false
  [host."docker.io".mirrors]
    endpoint = ["https://hub-mirror.c.163.com"]

就能自动把短名称补全成完整得镜像名称,这样就能直接更具名称去官网拉最新得,但是我改了之后还不行,

然后紧接着我发现个事,就是我啥也不配置也是可以更具完整镜像名称去拉去得

所以我现在怀疑

是不是我这里所有得配置其实都没生效啊?!

所以有懂得老哥么?

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.