Skip to content

Failed to get management ip for cbr0 network with host-gw mode on windows. #1066

Closed
@song-jiang

Description

@song-jiang

Flanneld failed to get management ip and panic.

Expected Behavior

Flanneld should get management ip successfully.

Current Behavior

Running flanneld.exe on windows node. (AWS Windows_Server-1803-English-Core-ContainersLatest-2018.08.15, kubernetes 1.11.4, host-gw mode). Hit runtime error.

I1121 15:51:15.716306    4200 main.go:450] Searching for interface using 172.20.54.40
I1121 15:51:16.087282    4200 main.go:527] Using interface with name vEthernet (Ethernet 2) and address 172.20.54.40
I1121 15:51:16.089271    4200 main.go:544] Defaulting external address to interface address (172.20.54.40)
I1121 15:51:16.094280    4200 kube.go:126] Waiting 10m0s for node controller to sync
I1121 15:51:16.096278    4200 kube.go:309] Starting kube subnet manager
I1121 15:51:17.097267    4200 kube.go:133] Node controller sync successful
I1121 15:51:17.098264    4200 main.go:244] Created subnet manager: Kubernetes Subnet Manager - ec2amaz-p9t8oq5
I1121 15:51:17.101265    4200 main.go:247] Installing signal handlers
I1121 15:51:17.102265    4200 main.go:386] Found network config - Backend type: host-gw
I1121 15:51:17.103264    4200 hostgw_windows.go:73] HOST-GW config: {Name:cbr0 DNSServerList:}
I1121 15:51:17.121265    4200 hostgw_windows.go:157] Attempting to create HNSNetwork {"Name":"cbr0","Type":"L2Bridge","Subnets":[{"AddressPrefix":"10.244.11.0/24","GatewayAddress":"10.244.11.1"}]}
I1121 15:51:17.126268    4200 hostgw_windows.go:164] Waiting to get ManagementIP from HNSNetwork cbr0
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x10c8cfa]

goroutine 1 [running]:
main.main()
        /home/song/go/src/github.com/coreos/flannel/main.go:297 +0xbea

Possible Solution

  1. Create and attach endpoint to cbr0 network before checking management ip.
  2. Fix code to return non-nil error if checking for management ip timed out. Currently if timeout, RegisterNetwork still returns error as nil.
    https://github.com/coreos/flannel/blob/master/backend/hostgw/hostgw_windows.go#L170

Steps to Reproduce (for bugs)

  1. Start flanneld.exe

Context

Your Environment

  • Flannel version: current master
  • Backend used (e.g. vxlan or udp): host-gw
  • Etcd version:
  • Kubernetes version (if used): 1.11.4
  • Operating System and version: windows
  • Link to your project (optional):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions