windows下部署containerd.exe

1. 通过github containerd项目下载最新release包

截止目前最新windows版release包为:
https://github.com/containerd/containerd/releases/download/v1.4.3/cri-containerd-cni-1.4.3-windows-amd64.tar.gz

2. 解压contaienrd压缩包

使用7z,360压缩之类的软件都可以
图1
图2

3. 生成containerd配置文件

进入powershell命令行,通过命令生成配置文件

.\containerd.exe config default | Out-File config.toml -Encoding ascii

图3

4. 查看并修改containerd配置文件

通过[plugins.“io.containerd.grpc.v1.cri”.cni]可以了解到containerd安装目录默认为"C:\Program Files\containerd"
图4

修改root和state目录
root = “C:\Program Files\containerd\root”
state = “C:\Program Files\containerd\state”
图5

修改[plugins.“io.containerd.internal.v1.opt”]
path = “C:\Program Files\containerd\root\opt”
图6

5. 安装containerd

重命名解压目录为containerd,并拷贝到"C:\Program Files"目录下
目录结构:
图6

用户变量PATH中添加containerd目录:
图7

6. 启动containerd

启动powershell或者cmd,运行containerd

PS C:\Users> containerd
time="2020-12-27T11:25:08.727261100+08:00" level=info msg="starting containerd" revision=269548fa27e0089a8b8278fc4fc781d7f65a939b version=v1.4.3
time="2020-12-27T11:25:08.776253900+08:00" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1
time="2020-12-27T11:25:08.778255000+08:00" level=info msg="loading plugin \"io.containerd.snapshotter.v1.windows-lcow\"..." type=io.containerd.snapshotter.v1
time="2020-12-27T11:25:08.793245100+08:00" level=info msg="loading plugin \"io.containerd.snapshotter.v1.windows\"..." type=io.containerd.snapshotter.v1
time="2020-12-27T11:25:08.795221000+08:00" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." type=io.containerd.metadata.v1
time="2020-12-27T11:25:08.795221000+08:00" level=info msg="metadata content store policy set" policy=shared
time="2020-12-27T11:25:08.928697700+08:00" level=info msg="loading plugin \"io.containerd.differ.v1.walking\"..." type=io.containerd.differ.v1
time="2020-12-27T11:25:08.928697700+08:00" level=info msg="loading plugin \"io.containerd.gc.v1.scheduler\"..." type=io.containerd.gc.v1
time="2020-12-27T11:25:08.935673800+08:00" level=info msg="loading plugin \"io.containerd.service.v1.introspection-service\"..." type=io.containerd.service.v1
time="2020-12-27T11:25:08.935673800+08:00" level=info msg="loading plugin \"io.containerd.service.v1.containers-service\"..." type=io.containerd.service.v1
time="2020-12-27T11:25:08.935673800+08:00" level=info msg="loading plugin \"io.containerd.service.v1.content-service\"..." type=io.containerd.service.v1
time="2020-12-27T11:25:08.936671000+08:00" level=info msg="loading plugin \"io.containerd.differ.v1.windows-lcow\"..." type=io.containerd.differ.v1
time="2020-12-27T11:25:08.936671000+08:00" level=info msg="loading plugin \"io.containerd.differ.v1.windows\"..." type=io.containerd.differ.v1
time="2020-12-27T11:25:08.936671000+08:00" level=info msg="loading plugin \"io.containerd.service.v1.diff-service\"..." type=io.containerd.service.v1
time="2020-12-27T11:25:08.936671000+08:00" level=info msg="loading plugin \"io.containerd.service.v1.images-service\"..." type=io.containerd.service.v1
time="2020-12-27T11:25:08.936671000+08:00" level=info msg="loading plugin \"io.containerd.service.v1.leases-service\"..." type=io.containerd.service.v1
time="2020-12-27T11:25:08.936671000+08:00" level=info msg="loading plugin \"io.containerd.service.v1.namespaces-service\"..." type=io.containerd.service.v1
time="2020-12-27T11:25:08.937660600+08:00" level=info msg="loading plugin \"io.containerd.service.v1.snapshots-service\"..." type=io.containerd.service.v1
time="2020-12-27T11:25:08.937660600+08:00" level=info msg="loading plugin \"io.containerd.runtime.v2.task\"..." type=io.containerd.runtime.v2
time="2020-12-27T11:25:08.950724500+08:00" level=info msg="loading plugin \"io.containerd.service.v1.tasks-service\"..." type=io.containerd.service.v1
time="2020-12-27T11:25:08.952650800+08:00" level=info msg="loading plugin \"io.containerd.internal.v1.restart\"..." type=io.containerd.internal.v1
time="2020-12-27T11:25:08.982036400+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.containers\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.982036400+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.content\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.982961500+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.diff\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.982961500+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.events\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.983982700+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.healthcheck\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.983982700+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.images\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.983982700+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.leases\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.983982700+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.namespaces\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.984982300+08:00" level=info msg="loading plugin \"io.containerd.internal.v1.opt\"..." type=io.containerd.internal.v1
time="2020-12-27T11:25:08.986959400+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.snapshots\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.986959400+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.tasks\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.986959400+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.version\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.986959400+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.cri\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:08.987964200+08:00" level=info msg="Start cri plugin with config {PluginConfig:{ContainerdConfig:{Snapshotter:windows DefaultRuntimeName:runhcs-wcow-process DefaultRuntime:{Type: Engine: PodAnnotations:[] ContainerAnnotations:[] Root: Options:<nil> PrivilegedWithoutHostDevices:false BaseRuntimeSpec:} UntrustedWorkloadRuntime:{Type: Engine: PodAnnotations:[] ContainerAnnotations:[] Root: Options:<nil> PrivilegedWithoutHostDevices:false BaseRuntimeSpec:} Runtimes:map[runhcs-wcow-process:{Type:io.containerd.runhcs.v1 Engine: PodAnnotations:[] ContainerAnnotations:[] Root: Options:<nil> PrivilegedWithoutHostDevices:false BaseRuntimeSpec:}] NoPivot:false DisableSnapshotAnnotations:false DiscardUnpackedLayers:false} CniConfig:{NetworkPluginBinDir:C:\\Program Files\\containerd\\cni\\bin NetworkPluginConfDir:C:\\Program Files\\containerd\\cni\\conf NetworkPluginMaxConfNum:1 NetworkPluginConfTemplate:} Registry:{Mirrors:map[docker.io:{Endpoints:[https://registry-1.docker.io]}] Configs:map[] Auths:map[] Headers:map[]} ImageDecryption:{KeyModel:} DisableTCPService:true StreamServerAddress:127.0.0.1 StreamServerPort:0 StreamIdleTimeout:4h0m0s EnableSelinux:false SelinuxCategoryRange:0 SandboxImage:mcr.microsoft.com/oss/kubernetes/pause:1.4.0 StatsCollectPeriod:10 SystemdCgroup:false EnableTLSStreaming:false X509KeyPairStreaming:{TLSCertFile: TLSKeyFile:} MaxContainerLogLineSize:16384 DisableCgroup:false DisableApparmor:false RestrictOOMScoreAdj:false MaxConcurrentDownloads:3 DisableProcMount:false UnsetSeccompProfile: TolerateMissingHugetlbController:false DisableHugetlbController:false IgnoreImageDefinedVolumes:false} ContainerdRootDir:C:\\Program Files\\containerd\\root ContainerdEndpoint:\\\\.\\pipe\\containerd-containerd RootDir:C:\\Program Files\\containerd\\root\\io.containerd.grpc.v1.cri StateDir:C:\\Program Files\\containerd\\state\\io.containerd.grpc.v1.cri}"
time="2020-12-27T11:25:08.998450200+08:00" level=info msg="Connect containerd service"
time="2020-12-27T11:25:09.016395900+08:00" level=info msg="Get image filesystem path \"C:\\\\Program Files\\\\containerd\\\\root\\\\io.containerd.snapshotter.v1.windows\""
time="2020-12-27T11:25:09.036063400+08:00" level=info msg="Start subscribing containerd event"
time="2020-12-27T11:25:09.036800700+08:00" level=info msg="loading plugin \"io.containerd.grpc.v1.introspection\"..." type=io.containerd.grpc.v1
time="2020-12-27T11:25:09.078592000+08:00" level=info msg=serving... address="\\\\.\\pipe\\containerd-containerd.ttrpc"
time="2020-12-27T11:25:09.079562400+08:00" level=info msg=serving... address="\\\\.\\pipe\\containerd-containerd"
time="2020-12-27T11:25:09.080561900+08:00" level=info msg="containerd successfully booted in 0.355301s"
time="2020-12-27T11:25:09.093553900+08:00" level=info msg="Start recovering state"
time="2020-12-27T11:25:09.112853000+08:00" level=info msg="Start event monitor"
time="2020-12-27T11:25:09.113851500+08:00" level=info msg="Start snapshots syncer"
time="2020-12-27T11:25:09.113851500+08:00" level=info msg="Start cni network conf syncer"
time="2020-12-27T11:25:09.113851500+08:00" level=info msg="Start streaming server"

另开一个终端运行containerd客户端命令ctr,测试containerd服务:
图8

大功告成!

后记:
  windwos版本的containerd貌似不支持linux容器,只支持windows容器(win内核),所以呵呵了!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小森饭

你的鼓励是我最大的创作动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值