DevOps运维技术栈

containerd 相关项目集中发布全新大版本

KubeCon 北美 2024 [2]于 11 月 12 至 15 日在盐湖城盛大召开。就在会前一周,containerd v2.0 [3]、 nerdctl (contaiNERD CTL) v2.0 [4] 和 Lima v1.0 [5]集中发布 🎉。

containerd 相关项目集中发布全新大版本

01

containerd v2.0

containerd 是业界标准的容器运行时, 被 Docker 和多个基于 Kubernetes 的产品使用,如 Azure Kubernetes Service (AKS)、 Amazon Elastic Kubernetes Service (EKS) 和 Google Kubernetes Engine (GKE)。

containerd 最初由 Docker, Inc. 于 2015 年[6]开发, 当时 containerd 作为 Docker 的守护进程,旨在提供一个极简的方式来管理容器的生命周期。

2017 年[7] containerd 被捐献给了云原生计算基金会 (CNCF)[8], 同一年发布的 v1.0 [9]开始支持非 Docker 的使用场景。后来对 Kubernetes 的支持在 v1.1 [10](2018 年)中实现。

最新 containerd v2.0 主要移除了过去九年中被弃用的一些旧特性。这是一次重大变更,所以主版本号从 v1 升到了 v2。

本次新版本发布,DaoCloud 有两位 Maintainer 参与其中:Kay Yan [11]和 Iceber Gu [12]。移除特性

使用 containerd v1.6.27+ 或 v1.7.12+ 的用户可以通过运行以下命令来检查自己是否在使用这些已移除的特性:

ctr deprecations list

新增特性

其他显著变化

另请参阅

02

nerdctl v2.0

nerdctl [29](contaiNERD CTL) 是 containerd 所使用的类似 Docker 那样的命令行工具

nerdctl 在 2021年[30] 成为containerd 的一个子项目,并于 2022 年发布了 v1.0。

nerdctl v2.0 默认为无根模式启用 detach-netns

detach-netns 模式可能听起来类似于利用 SECCOMP_IOCTL_NOTIF_ADDFD 加速无根容器中套接字系统调用的 bypass4netns。也就是说,bypass4netns 加速了容器, detach-netns 与之不同的是通过将镜像留在主机网络命名空间中来加速负责拉取和推送镜像的运行时层。容器在“分离”的网络命名空间中执行,这样容器可以获得用于容器间通信的 IP 地址。

nerdctl v2.0 的其他主要变化包括添加了 nerdctl run --systemd 用于在容器中运行 systemd。此外,由于 GitHub 用户 @apostasie 的大量重构和测试,本次发布的稳定性得到了显著提高。

另请参阅 nerdctl v2.0 发布说明[31]

03

Lima v1.0

Lima [32]是一个命令行工具, 通过运行一个具有自动文件系统共享和端口转发的 Linux 虚拟机, 可以在桌面操作系统(如 macOS)上运行 containerd 和 nerdctl。Lima 的功能与 WSL2、Docker Machine 和 Vagrant 相当。

Lima 于 2022 年加入 CNCF,于 2024 年 9 月加入了 CNCF Sandbox。Lima 已被多个知名第三方项目改编,如 Colima [33]、 Rancher Desktop [34]和 AWS 的 Finch [35]。 Lima 还被包括 NTT Communications 在内的多个组织使用[36]

以下 Lima 项目在 GitHub 上得到的 Star 数变化趋势图。

另请参阅 Lima v1.0 发布说明[37]

04

参考

[1] 新闻稿:
https://medium.com/nttlabs/containerd-v2-0-nerdctl-v2-0-lima-v1-0-93026b5839f8

[2] KubeCon 北美 2024:
https://events.linuxfoundation.org/kubecon-cloudnativecon-north-america/

[3] containerd v2.0:
https://github.com/containerd/containerd

[4]  nerdctl v2.0:
https://github.com/containerd/nerdctl

[5] Lima v1.0:
https://lima-vm.io/

[6] 2015 年:
http://web.archive.org/web/20151217223538/https://containerd.tools/

[7] 2017 年:
https://www.cncf.io/announcements/2017/03/29/containerd-joins-cloud-native-computing-foundation/

[8] 云原生计算基金会 (CNCF):
https://cncf.io/

[9] v1.0:
https://github.com/containerd/containerd/releases/tag/v1.0.0

[10]v1.1:
https://github.com/containerd/containerd/releases/tag/v1.1.0

[11] Kay Yan:
https://github.com/yankay

[12] Iceber Gu:
https://github.com/Iceber

[13] containerd-shim-runc-v1:
https://github.com/containerd/containerd/pull/8262

[14] 对 AUFS 的支持:
https://github.com/containerd/containerd/pull/8263

[15] 对 Kubernetes CRI v1alpha2 API 的支持:
https://github.com/containerd/containerd/pull/8276

[16] 对“Docker Schema 1”镜像的支持现已被禁用:
https://github.com/containerd/containerd/pull/9765

[17] v20.10:
https://github.com/moby/moby/pull/41295

[18] OCI Image Spec:
https://github.com/opencontainers/image-spec

[19] Kubernetes 用户命名空间:
https://kubernetes.io/docs/concepts/workloads/pods/user-namespaces/

[20] Kubernetes 递归只读挂载:
https://kubernetes.io/docs/concepts/storage/volumes/#read-only-mounts

[21] Kubernetes 1.30:只读卷挂载终于可以真正实现只读了:
https://kubernetes.io/blog/2024/04/23/recursive-read-only-mounts/

[22] 镜像验证插件:
https://github.com/containerd/containerd/blob/v2.0.0/docs/image-verification.md

[23] 沙箱CRI:
https://github.com/containerd/containerd/issues/4131

[24] NRI:
https://github.com/containerd/nri

[25] CDI:
https://github.com/cncf-tags/container-device-interface

[26] Kubernetes 设备插件:
https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/4009-add-cdi-devices-to-device-plugin-api

[27] containerd 2.0 官方文档:
https://github.com/containerd/containerd/blob/v2.0.0/docs/containerd-2.0.md

[28] containerd 2.0.0 发布说明:
https://github.com/containerd/containerd/releases/tag/v2.0.0

[29] nerdctl:
https://github.com/containerd/nerdctl

[30] 2021年:
https://github.com/containerd/project/issues/69

[31] nerdctl v2.0 发布说明:
https://github.com/containerd/nerdctl/releases/tag/v2.0.0

[32] Lima:
https://lima-vm.io/

[33] Colima:
https://github.com/abiosoft/colima

[34] Rancher Desktop:
https://rancherdesktop.io/

[35] AWS 的 Finch:
https://aws.amazon.com/blogs/opensource/introducing-finch-an-open-source-client-for-container-development/

[36] Lima 还被包括 NTT Communications 在内的多个组织使用:https://github.com/lima-vm/lima/discussions/2390#discussioncomment-9732082

[37] Lima v1.0 发布说明:
https://github.com/lima-vm/lima/releases/tag/v1.0.0

退出移动版