-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use containerd with crictl on Windows Server 2022 #210
Comments
Have you also created a NAT network before trying to start containers with NAT networking? |
@daschott Please see my Creating a nat network section in my original post. I did and it created. Get-HnsNetwork ActivityId : 58261574-A434-494B-BF39-A698343E225D
AdditionalParams :
CurrentEndpointCount : 0
Extensions : {@{Id=E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A; IsEnabled=False; Name=Microsoft Windows Filtering Platform},
@{Id=F74F241B-440F-4433-BB28-00F89EAD20D8; IsEnabled=False; Name=Microsoft Azure VFP Switch Extension},
@{Id=430BDADD-BAB0-41AB-A369-94B67FA5BE0A; IsEnabled=True; Name=Microsoft NDIS Capture}}
Flags : 8
Health : @{LastErrorCode=0; LastUpdateTime=132924426122016395}
ID : 94530BEE-C40A-4F25-9CAF-19BBE91E748F
IPv6 : False
LayeredOn : 490CA4AE-EB76-4F4D-831C-F6580C4934A1
MacPools : {@{EndMacAddress=00-15-5D-5F-CF-FF; StartMacAddress=00-15-5D-5F-C0-00}}
MaxConcurrentEndpoints : 0
Name : nat
NatName : NAT9EB86A6C-8942-4B54-8F11-135F3849E2D5
Policies : {@{Type=VLAN; VLAN=1}}
State : 1
Subnets : {@{AdditionalParams=; AddressPrefix=10.0.0.0/16; Flags=0; GatewayAddress=10.0.0.1; Health=;
ID=AB6315D3-D415-4C69-9C2C-0E07E5995146; IpSubnets=System.Object[]; ObjectType=5; Policies=System.Object[]; State=0}}
TotalEndpoints : 0
Type : NAT
Version : 55834574851
Resources : @{AdditionalParams=; AllocationOrder=2; Allocators=System.Object[]; CompartmentOperationTime=0; Flags=0; Health=;
ID=58261574-A434-494B-BF39-A698343E225D; PortOperationTime=0; State=1; SwitchOperationTime=0; VfpOperationTime=0;
parentId=67604C6B-D935-4FC5-8A40-282135C362DA} |
I experience the same with curl.exe -LO "https://github.com/lippertmarkus/containerd-installer/releases/download/v0.0.3/containerd-installer.exe"
.\containerd-installer.exe --debug --containerd-version "1.6.1"
[Environment]::SetEnvironmentVariable("Path", "$($env:path);C:\Program Files\containerd", [System.EnvironmentVariableTarget]::Machine)
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") Afterwards running a container on Windows Server 2019 works: ctr i pull mcr.microsoft.com/windows/nanoserver:1809
ctr run --cni -rm mcr.microsoft.com/windows/nanoserver:1809 test curl.exe https://example.org
{"level":"debug","msg":"[cni-net] Plugin wcn-net version .","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"[net] Network interface: {Index:4 MTU:1500 Name:Ethernet HardwareAddr:00:22:48:5c:62:0f Flags:up|broadcast|multicast} with IP addresses: [fe80::e4be:a00:f1d5:266a/64 10.0.0.6/24]","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"[net] Network interface: {Index:1 MTU:-1 Name:Loopback Pseudo-Interface 1 HardwareAddr: Flags:up|loopback|multicast} with IP addresses: [::1/128 127.0.0.1/8]","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"[net] Network interface: {Index:13 MTU:1500 Name:vEthernet (nat) HardwareAddr:00:15:5d:bd:ee:5f Flags:up|broadcast|multicast} with IP addresses: [fe80::a14f:e9fd:1b46:c580/64 172.24.64.1/20]","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"[cni-net] Plugin started.","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"[cni-net] Processing ADD command with args {ContainerID:default-test Netns:ce201286-3dd9-4974-a8e4-108d3b104548 IfName:eth0 Args: Path:/opt/cni/bin}.","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"[cni-net] Read network configuration \u0026{CniVersion:0.2.0 Name:nat Type:nat Ipam:{Type: Environment: AddrSpace: Subnet:172.24.64.0/20 Address: QueryInterval: Routes:[{Dst:{IP:\u003cnil\u003e Mask:\u003cnil\u003e} GW:\u003cnil\u003e}]} DNS:{Nameservers:[] Domain: Search:[] Options:[]} OptionalFlags:{LocalRoutePortMapping:false AllowAclPortMapping:false} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}.","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"Parsing port mappings from []","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"[cni-net] Found network 407bddba-9e12-4191-b584-df13a6380a5d with subnet [{{172.24.64.0 fffff000} 172.24.64.1 []}].","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"[cni-net] Creating a new Endpoint","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"hcn::HostComputeEndpoint::Create id=","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"hcn::HostComputeEndpoint::Create JSON: {\"Name\":\"default-test_nat\",\"HostComputeNetwork\":\"407bddba-9e12-4191-b584-df13a6380a5d\",\"IpConfigurations\":[{}],\"Dns\":{},\"Routes\":[{\"NextHop\":\"172.24.64.1\",\"DestinationPrefix\":\"0.0.0.0/0\"}],\"SchemaVersion\":{\"Major\":2,\"Minor\":0}}","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"hcn::HostComputeEndpoint::AddNamespaceEndpoint id=13615a0d-5346-4ab7-b13f-87a38fd96ca0","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"hcn::HostComputeNamespace::ModifyNamespaceSettings id=ce201286-3dd9-4974-a8e4-108d3b104548","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"[cni-net] result: IP4:{IP:{IP:172.24.68.178 Mask:fffff000} Gateway:172.24.64.1 Routes:[]}, DNS:{Nameservers:[] Domain: Search:[] Options:[]}","time":"2022-03-22T18:04:26Z"}
{"level":"debug","msg":"[cni-net] Plugin stopped.","time":"2022-03-22T18:04:26Z"}
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1256 100 1256 0 0 1653 0 --:--:-- --:--:-- --:--:-- 1656
{"level":"debug","msg":"[cni-net] Plugin wcn-net version .","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"[net] Network interface: {Index:4 MTU:1500 Name:Ethernet HardwareAddr:00:22:48:5c:62:0f Flags:up|broadcast|multicast} with IP addresses: [fe80::e4be:a00:f1d5:266a/64 10.0.0.6/24]","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"[net] Network interface: {Index:1 MTU:-1 Name:Loopback Pseudo-Interface 1 HardwareAddr: Flags:up|loopback|multicast} with IP addresses: [::1/128 127.0.0.1/8]","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"[net] Network interface: {Index:13 MTU:1500 Name:vEthernet (nat) HardwareAddr:00:15:5d:bd:ee:5f Flags:up|broadcast|multicast} with IP addresses: [fe80::a14f:e9fd:1b46:c580/64 172.24.64.1/20]","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"[cni-net] Plugin started.","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"[cni-net] Processing DEL command with args {ContainerID:default-test Netns: IfName:eth0 Args: Path:/opt/cni/bin}","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"[cni-net] Read network configuration \u0026{CniVersion:0.2.0 Name:nat Type:nat Ipam:{Type: Environment: AddrSpace: Subnet:172.24.64.0/20 Address: QueryInterval: Routes:[{Dst:{IP:\u003cnil\u003e Mask:\u003cnil\u003e} GW:\u003cnil\u003e}]} DNS:{Nameservers:[] Domain: Search:[] Options:[]} OptionalFlags:{LocalRoutePortMapping:false AllowAclPortMapping:false} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}.","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"Parsing port mappings from []","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"hcn::HostComputeNamespace::RemoveNamespaceEndpoint id=13615a0d-5346-4ab7-b13f-87a38fd96ca0","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"hcn::HostComputeNamespace::ModifyNamespaceSettings id=ce201286-3dd9-4974-a8e4-108d3b104548","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"hcn::HostComputeEndpoint::Delete id=13615a0d-5346-4ab7-b13f-87a38fd96ca0","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"[cni-net] DEL succeeded.","time":"2022-03-22T18:04:29Z"}
{"level":"debug","msg":"[cni-net] Plugin stopped.","time":"2022-03-22T18:04:29Z"} And on Windows Server 2022 it doesn't: ctr i pull mcr.microsoft.com/windows/nanoserver:ltsc2022
ctr run --cni -rm mcr.microsoft.com/windows/nanoserver:ltsc2022 test curl.exe https://example.org
{"level":"debug","msg":"[cni-net] Plugin wcn-net version .","time":"2022-03-22T18:31:07Z"}
{"level":"debug","msg":"[net] Network interface: {Index:5 MTU:1500 Name:Ethernet HardwareAddr:60:45:bd:8b:6d:c2 Flags:up|broadcast|multicast} with IP addresses: [fe80::31b3:7fb1:5fe5:36ed/64 10.0.0.4/24]","time":"2022-03-22T18:31:07Z"}
{"level":"debug","msg":"[net] Network interface: {Index:1 MTU:-1 Name:Loopback Pseudo-Interface 1 HardwareAddr: Flags:up|loopback|multicast} with IP addresses: [::1/128 127.0.0.1/8]","time":"2022-03-22T18:31:07Z"}
{"level":"debug","msg":"[net] Network interface: {Index:13 MTU:1500 Name:vEthernet (nat) HardwareAddr:00:15:5d:7d:96:13 Flags:up|broadcast|multicast} with IP addresses: [fe80::f542:9c67:7f4:d2fc/64 172.20.160.1/20]","time":"2022-03-22T18:31:07Z"}
{"level":"debug","msg":"[cni-net] Plugin started.","time":"2022-03-22T18:31:07Z"}
{"level":"debug","msg":"[cni-net] Processing DEL command with args {ContainerID:default-test Netns: IfName:eth0 Args: Path:/opt/cni/bin}","time":"2022-03-22T18:31:07Z"}
{"level":"debug","msg":"[cni-net] Read network configuration \u0026{CniVersion:0.2.0 Name:nat Type:nat Ipam:{Type: Environment: AddrSpace: Subnet:172.20.160.0/20 Address: QueryInterval: Routes:[{Dst:{IP:\u003cnil\u003e Mask:\u003cnil\u003e} GW:\u003cnil\u003e}]} DNS:{Nameservers:[] Domain: Search:[] Options:[]} OptionalFlags:{LocalRoutePortMapping:false AllowAclPortMapping:false} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}.","time":"2022-03-22T18:31:07Z"}
{"level":"debug","msg":"Parsing port mappings from []","time":"2022-03-22T18:31:07Z"}
{"level":"debug","msg":"[cni-net] Endpoint was not found error, err:Endpoint Id not found","time":"2022-03-22T18:31:07Z"}
{"level":"debug","msg":"[cni-net] Plugin stopped.","time":"2022-03-22T18:31:07Z"}
ctr: plugin type="nat" name="nat" failed (add): error creating endpoint hcnCreateEndpoint failed in Win32: IP address is either invalid or not part of any configured subnet(s). (0x803b001e) {"Success":false,"Error":"IP address is either invalid or not part of any configured subnet(s). ","ErrorCode":2151350302} : endpoint config &{ default-test_nat d41bb839-10a8-408c-b4c3-3ffe81e53845 [] [{ 0}] { [] [] []} [{172.20.160.1 0.0.0.0/0 0}] 0 {2 0}} Without CNI it's also working on Windows Server 2022:
So I think the issue is rather somewhere in the NAT CNI plugin https://github.com/microsoft/windows-container-networking |
My apologies @doggy8088 I missed that part. I am also able to reproduce this issue using Windows CNI plugins release v0.2.0. There is a change missing because the binaries in v0.2.0 release are outdated. There needs to be a new CNI release made that includes needed changes that correct this behavior for Windows Server 2022 support. In the meantime, can you try to build the CNI plugins yourself? Alternatively, I can also share the compiled binaries with you, just let me know. |
I can confirm it works when compiling the CNI plugins by myself. |
@daschott
|
Thank you for confirming. At this point, I think this is a different issue. To cover the original CNI issue, could you file a new issue in https://github.com/microsoft/windows-container-networking/ requesting a new CNI release? To cover the next issue, @cwilhit could you add the relevant CRI expects here to investigate? The CNI issue should be resolved with updated plugins @doggy8088 is currently using. |
@doggy8088 you specified a
|
@lippertmarkus After I created the But I still stuck at this issue: time="2022-03-23T19:14:32+08:00" level=fatal msg="starting the container \"34234d60deb6babf29594f257e5bb7b67f4aadbf2a8b742a66198086c2c57bf0\": rpc error: code = Unknown desc = failed to start containerd task \"34234d60deb6babf29594f257e5bb7b67f4aadbf2a8b742a66198086c2c57bf0\": hcs::System::CreateProcess 34234d60deb6babf29594f257e5bb7b67f4aadbf2a8b742a66198086c2c57bf0: The parameter is incorrect.: unknown" Do you have any idea what going on? |
@doggy8088 your pod/container specs are tailored to Linux. Can you try the ones here (with ltsc2022 image instead): https://lippertmarkus.com/2022/01/22/containerd-ctr-windows/#running-containers-with-crictl Those did work for me. |
@lippertmarkus It works for me too. Thank you so much! 😊 All the detailed steps are been posted in my blog. Sorry it's Traditional Chinese only.
|
Hi All
I downloaded https://github.com/microsoft/windows-container-networking/releases/tag/v0.3.0 and resolved the path microsoft/windows-container-networking#70 ,
setup
Until the create Pod error:
I repeated the test with Will and Markus's blog posts, but still the same error. |
Add some information
|
seems like you didn't set the runtime endpoint correctly:
|
Script from your blog:
screen shot |
I know what's causing the problem. When creating Pod for the first time, @lippertmarkus, thanks for your help. |
After running all windows configuration here, we got this error , on kube-proxy for windows, I am using flannel error while dialing open \\.\pipe\rancher_wins: The system cannot find the file specified." can someonw help here please |
Here are the steps I tried to install containerd on Windows Server 2022.
Install Windows Features
Install containerd 1.6.1
Configure container networking
Download
windows-container-networking-cni-amd64-v0.2.0.zip
file from microsoft/windows-container-networkingCreating a
nat
networkRunning a container using
ctr
Check Windows version
cmd /c ver
Here is my Windows Server 2022 version:
10.0.20348.587
Pull
mcr.microsoft.com/windows/nanoserver:ltsc2022
imageRunning a container
Running a Pod and Container using
crictl
Install
crictl
toolConfigure
crictl
configPull Pause container image (
k8s.gcr.io/pause:3.6
)Creating a sandbox / Pod
I stucked here. (
IP address is either invalid or not part of any configured subnet(s).
)I don't know how to fix the error!
The text was updated successfully, but these errors were encountered: