Skip to content
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

Problem with sdnbridge and transparent mode witout IP range for the network #63

Open
fredericpougnault opened this issue Oct 1, 2021 · 2 comments

Comments

@fredericpougnault
Copy link

I want to use sdnbridge with transparent mode and an external DHCP.

Below my cni configuration file :
{
"cniVersion": "0.2.0",
"name": "transparent",
"apiVersion":2,
"type": "sdnbridge",
"Master": "Ethernet"
}

I created a pod with containerd and crictl with the command line below:

  • crictl.exe runp .\pod.json
    This is my pod.json file:
    {
    "metadata": {
    "name": "Windows",
    "namespace": "default",
    "attempt": 1,
    "uid": "hdishd83djaidwnduwk28bcsb"
    },
    "log_directory": "/tmp"
    }

When I execute the command to create the pod my network is create like this :

ActivityId : 0E550024-EA46-4A66-A049-2C9AED114943
AdditionalParams :
CurrentEndpointCount : 0
Extensions : {@{Id=E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A; IsEnabled=False; Name=Plateforme de filtrage Microsoft Windows}, @{Id=E9B59CFA-2BE1-4B21-828F-B6FBDBDDC017; IsEnabled=False; Name=Microsoft Azure VFP Switch Extension},
@{Id=EA24CD6C-D17A-4348-9190-09F0D5BE83DD; IsEnabled=True; Name=Capture NDIS Microsoft}}
Flags : 0
Health : @{LastErrorCode=0; LastUpdateTime=132775553966352126}
ID : 60B2C11D-381C-4F84-91F1-DB1FB2BD9447
IPv6 : False
InterfaceConstraint : @{InterfaceGuid=00000000-0000-0000-0000-000000000000}
LayeredOn : 83B8B8AA-F92D-4451-857E-F0FE36698358
MacPools : {@{EndMacAddress=00-15-5D-15-CF-FF; StartMacAddress=00-15-5D-15-C0-00}}
MaxConcurrentEndpoints : 0
Name : transparent
Policies : {}
Resources : @{AdditionalParams=; AllocationOrder=0; Health=; ID=0E550024-EA46-4A66-A049-2C9AED114943; PortOperationTime=0; State=1; SwitchOperationTime=0; VfpOperationTime=0; parentId=6267B624-6EF8-42EE-8DF9-5EE3044E8707}
State : 1
TotalEndpoints : 0
Type : Transparent
Version : 38654705669

But my pods cannot connect to this network.
The command exit with this error :

time="2021-10-01T11:50:00+02:00" level=fatal msg="run pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "7f493333cfbfe44d82a7e5b87f2050558d25885d1266cc69822c2a5828766c30": netplugin failed: "{\"level\":\"debug\",\"msg\":\"[cni-net] Plugin wcn-net version .\",\"time\":\"2021-10-01T11:49:56+02:00\"}\n{\"level\":\"debug\",\"msg\":\"[net] Network interface: {Index:19 MTU:1500 Name:Ethernet HardwareAddr:c4:37:72:08:35:6f Flags:up|broadcast|multicast} with IP addresses: [fe80::b1df:fcb3:e3fb:cc43/64 10.249.5.50/24]\",\"time\":\"2021-10-01T11:49:56+02:00\"}\n{\"level\":\"debug\",\"msg\":\"[net] Network interface: {Index:23 MTU:1500 Name:Ethernet 3 HardwareAddr:c4:37:72:f9:92:22 Flags:up|broadcast|multicast} with IP addresses: [fe80::f40e:d97e:3699:d3d5/64 10.249.3.249/24]\",\"time\":\"2021-10-01T11:49:56+02:00\"}\n{\"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\":\"2021-10-01T11:49:56+02:00\"}\n{\"level\":\"debug\",\"msg\":\"[cni-net] Plugin started.\",\"time\":\"2021-10-01T11:49:56+02:00\"}\n{\"level\":\"debug\",\"msg\":\"[cni-net] Processing ADD command with args {ContainerID:7f493333cfbfe44d82a7e5b87f2050558d25885d1266cc69822c2a5828766c30 Netns:057764d1-434b-4c86-8c7e-6329e33bce53 IfName:eth0 Args:K8S_POD_NAMESPACE=default;K8S_POD_NAME=Windows;K8S_POD_INFRA_CONTAINER_ID=7f493333cfbfe44d82a7e5b87f2050558d25885d1266cc69822c2a5828766c30;K8S_POD_UID=hdishd83djaidwnduwk28bcsb;IgnoreUnknown=1 Path:C:/opt/cni/bin}.\",\"time\":\"2021-10-01T11:49:56+02:00\"}\n{\"level\":\"debug\",\"msg\":\"[cni-net] Read network configuration \\u0026{CniVersion:0.2.0 Name:transparent Type:sdnbridge Ipam:{Type: Environment: AddrSpace: Subnet: Address: QueryInterval: Routes:[]} DNS:{Nameservers:[] Domain: Search:[] Options:[]} OptionalFlags:{LocalRoutePortMapping:false AllowAclPortMapping:false} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}.\",\"time\":\"2021-10-01T11:49:56+02:00\"}\n{\"level\":\"debug\",\"msg\":\"Parsing port mappings from []\",\"time\":\"2021-10-01T11:49:56+02:00\"}\n{\"level\":\"info\",\"msg\":\"[cni-net] Creating network.\",\"time\":\"2021-10-01T11:49:56+02:00\"}\n{\"level\":\"debug\",\"msg\":\"hcn::HostComputeNetwork::Create id=\",\"time\":\"2021-10-01T11:49:56+02:00\"}\n{\"level\":\"debug\",\"msg\":\"hcn::HostComputeNetwork::Create JSON: {\\\"Name\\\":\\\"transparent\\\",\\\"Type\\\":\\\"transparent\\\",\\\"MacPool\\\":{},\\\"Dns\\\":{},\\\"SchemaVersion\\\":{\\\"Major\\\":2,\\\"Minor\\\":0}}\",\"time\":\"2021-10-01T11:49:56+02:00\"}\npanic: runtime error: index out of range\n\ngoroutine 1 [running]:\ngithub.com/Microsoft/windows-container-networking/network.GetNetworkInfoFromHostComputeNetwork(0xc0000961e0, 0xc0000961e0)\n\t/home/nagiesek/repo/gopath/src/github.com/Microsoft/windows-container-networking/network/network.go:93 +0x612\ngithub.com/Microsoft/windows-container-networking/network.(*networkManager).CreateNetwork(0xc000098060, 0xc000052dd0, 0x0, 0x0, 0x0)\n\t/home/nagiesek/repo/gopath/src/github.com/Microsoft/windows-container-networking/network/manager.go:68 +0xe2\ngithub.com/Microsoft/windows-container-networking/common/core.getOrCreateNetwork(0xc000044620, 0xc000052dd0, 0xc00007c180, 0x40, 0x0, 0x0)\n\t/home/nagiesek/repo/gopath/src/github.com/Microsoft/windows-container-networking/common/core/network.go:241 +0xe2\ngithub.com/Microsoft/windows-container-networking/common/core.(*netPlugin).Add(0xc000044620, 0xc00009c310, 0x0, 0x0)\n\t/home/nagiesek/repo/gopath/src/github.com/Microsoft/windows-container-networking/common/core/network.go:127 +0x57e\ngithub.com/Microsoft/windows-container-networking/vendor/github.com/containernetworking/cni/pkg/skel.(*dispatcher).checkVersionAndCall(0xc000077e98, 0xc00009c310, 0x5cc600, 0xc000098690, 0xc000077e80, 0x0, 0x28)\n\t/home/nagiesek/repo/gopath/src/github.com/Microsoft/windows-container-networking/vendor/github.com/containernetworking/cni/pkg/skel/skel.go:185 +0x260\ngithub.com/Microsoft/windows-container-networking/vendor/github.com/containernetworking/cni/pkg/skel.(*dispatcher).pluginMain(0xc000077e98, 0xc000077e80, 0x0, 0xc000077e68, 0x5cc600, 0xc000098690, 0x59d28d, 0x11, 0x53df1a)\n\t/home/nagiesek/repo/gopath/src/github.com/Microsoft/windows-container-networking/vendor/github.com/containernetworking/cni/pkg/skel/skel.go:221 +0x550\ngithub.com/Microsoft/windows-container-networking/vendor/github.com/containernetworking/cni/pkg/skel.PluginMainWithError(...)\n\t/home/nagiesek/repo/gopath/src/github.com/Microsoft/windows-container-networking/vendor/github.com/containernetworking/cni/pkg/skel/skel.go:286\ngithub.com/Microsoft/windows-container-networking/cni.(*Plugin).Execute(0xc000078028, 0x5cc580, 0xc000044620, 0x0, 0xc000078020)\n\t/home/nagiesek/repo/gopath/src/github.com/Microsoft/windows-container-networking/cni/plugin.go:49 +0x225\ngithub.com/Microsoft/windows-container-networking/common/core.Core()\n\t/home/nagiesek/repo/gopath/src/github.com/Microsoft/windows-container-networking/common/core/core.go:47 +0x29c\nmain.main()\n\t/home/nagiesek/repo/gopath/src/github.com/Microsoft/windows-container-networking/plugins/sdnbridge/sdnbridge_windows.go:16 +0x27\n"".

I can the an error like index out of range, I think it's because my network doesn't have an IP range.

@nagiesek
Copy link
Contributor

nagiesek commented Oct 4, 2021

In transparent if you don't pass a network it will automatically pick one up from the vnet. You can see this in the error/logs with IP addresses: [fe80::b1df:fcb3:e3fb:cc43/64 10.249.5.50/24]

@nagiesek
Copy link
Contributor

nagiesek commented Oct 4, 2021

I don't really work on this stuff anymore but my guess would be that the issue is w/ the IPv6 address being picked up by the CNI.

@vikas-bh you might find this interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants