I've been following Gentle ContainerD on Windows Guide For You to setup ContainerD on my Windows 10 machine but somehow I can not start any example from this tutorial.
Command is: crictl.exe runp --runtime runhcs-wcow-process .\pod-config.yaml
Error is:
crictl.exe runp --runtime runhcs-wcow-process .\pod-config.yaml
time="2022-03-18T19:39:38+02:00" level=fatal msg="run pod sandbox:
rpc error: code = Unknown desc = failed to setup network for sandbox \"7db0b08199861ffc0a68b869990c2ce1e2cee29df2579f9502ec584fbd5d2913\": plugin type=\"nat\" name=\"natContainerD\" 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 &{ 7db0b08199861ffc0a68b869990c2ce1e2cee29df2579f9502ec584fbd5d2913_natContainerD 6160b2e0-4525-4bbc-b725-135c55fc741b [] [{ 0}] { [] [] []} [{172.22.208.1 0.0.0.0/0 0}] 0 {2 0}}"
I guess I didn't configured my cni
network right (?)
Here are steps what I did to setup network:
$subnet='10.0.0.0/16'
$gateway='10.0.0.1'
New-HnsNetwork -Type NAT -AddressPrefix $subnet -Gateway $gateway -Name "natContainerD"
Please note that I can not create network with name nat
because it was already exist (from Docker ?) os I named this one as natContainerD
Then I configure the cni
itself (as in tutorial above):
@"
{
"cniVersion": "0.2.0",
"name": "nat",
"type": "nat",
"master": "Internet",
"ipam": {
"subnet": "$subnet",
"routes": [
{
"gateway": "$gateway"
}
]
},
"capabilities": {
"portMappings": true,
"dns": true
}
}
"@ | Set-Content "$env:ProgramFiles\containerd\cni\conf\0-containerd-nat.conf" -Force
However, no matter what settings I change in this file, I am still unable to start any containers :(
Any suggestion ?