windows下部署containerd.exe
1. 通过github containerd项目下载最新release包
截止目前最新windows版release包为:
2. 解压contaienrd压缩包
使用7z,360压缩之类的软件都可以
3. 生成containerd配置文件
进入powershell命令行,通过命令生成配置文件
.\containerd.exe config default | Out-File config.toml -Encoding ascii
4. 查看并修改containerd配置文件
通过[plugins."io.containerd.grpc.v1.cri".cni]可以了解到containerd安装目录默认为"C:\Program Files\containerd"
修改root和state目录
root = "C:\\Program Files\\containerd\\root"
state = "C:\\Program Files\\containerd\\state"
修改[plugins."io.containerd.internal.v1.opt"]
path = "C:\\Program Files\\containerd\\root\\opt"
5. 安装containerd
重命名解压目录为containerd,并拷贝到"C:\\Program Files"目录下
目录结构:
用户变量PATH中添加containerd目录
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服务
大功告成!
后记:
windwos版本的containerd貌似不支持linux容器,只支持windows容器(win内核),所以呵呵了!