whereabouts icon indicating copy to clipboard operation
whereabouts copied to clipboard

Address already in use error

Open yaocw2020 opened this issue 3 years ago • 2 comments

Use helm to install whereabouts with tag latest(e9b7828b942a3e30a2919ac4a78744e65af1f092) in k3s(v1.20.4+k3s1)

Here is cni config

{
	"name": "mynet",
	"type": "ipvlan",
	"master": "eth0",
	"ipam": {
        "type": "whereabouts",
        "range": "192.168.2.0/24"
	}
}

Here is ippool

apiVersion: whereabouts.cni.cncf.io/v1alpha1
kind: IPPool
metadata:
  creationTimestamp: "2021-03-24T04:05:04Z"
  generation: 45
  managedFields:
  - apiVersion: whereabouts.cni.cncf.io/v1alpha1
    fieldsType: FieldsV1
    fieldsV1:
      f:spec:
        .: {}
        f:allocations:
          .: {}
          f:0:
            .: {}
            f:id: {}
            f:podref: {}
        f:range: {}
    manager: whereabouts
    operation: Update
    time: "2021-03-24T04:05:04Z"
  name: 192.168.2.0-24
  namespace: kube-system
  resourceVersion: "3761766"
  uid: bccd893a-1ea0-4dc2-83fa-fe3838dae1ee
spec:
  allocations:
    "0":
      id: eb3e40806fbfb91964bbac7a90f66da11b5048e69f3fe8b67719d7c254f1b611
      podref: default/demo-6c46cbb8b8-6kg9c
  range: 192.168.2.0/24

Pod create failed and describe the pod.

NAME                    READY   STATUS              RESTARTS   AGE
demo-6c46cbb8b8-6kg9c   0/1     ContainerCreating   0          12m
Events:
  Type     Reason                  Age                  From             Message
  ----     ------                  ----                 ----             -------
  Normal   Scheduled               <unknown>                             Successfully assigned default/demo-6c46cbb8b8-6kg9c to worker
  Warning  FailedCreatePodSandBox  6m3s                 kubelet, worker  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "48d5ab03a0adbb5fdc9fe963abbda159b8201319063ea95efd372f2b8e33ab8b": failed to add IP addr {Version:4 Interface:0xc000014c80 Address:{IP:192.168.2.1 Mask:ffffff00} Gateway:<nil>} to "eth0": address already in use
  Warning  FailedCreatePodSandBox  5m51s                kubelet, worker  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "7985036785d7f5b06d7ad82c1d43621129fdad717c9f56c522d6fcdd8ee371e8": failed to add IP addr {Version:4 Interface:0xc00028a240 Address:{IP:192.168.2.1 Mask:ffffff00} Gateway:<nil>} to "eth0": address already in use
  Warning  FailedCreatePodSandBox  5m39s                kubelet, worker  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "194241486fe6c249bcc29dd5608d4a040c74f4ba599c87d87b07cdd09c20e9fc": failed to add IP addr {Version:4 Interface:0xc0000142c8 Address:{IP:192.168.2.1 Mask:ffffff00} Gateway:<nil>} to "eth0": address already in use
  Warning  FailedCreatePodSandBox  5m26s                kubelet, worker  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "1b83fccbd50cb2205c00e5e4c27184f3cbe22fe98ef20587b6d74de57224c56e": failed to add IP addr {Version:4 Interface:0xc0000b63b0 Address:{IP:192.168.2.1 Mask:ffffff00} Gateway:<nil>} to "eth0": address already in use
  Warning  FailedCreatePodSandBox  5m14s                kubelet, worker  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "2d3cb80b561a68fd7160b9bac5abb789368becb0e316a0a926e87b89628fb10f": failed to add IP addr {Version:4 Interface:0xc000106d40 Address:{IP:192.168.2.1 Mask:ffffff00} Gateway:<nil>} to "eth0": address already in use
  Warning  FailedCreatePodSandBox  5m1s                 kubelet, worker  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "e5a97cd775ee2ea654b7497ccf8df89d1fe3b27010c4be80e9c170eb48b34ee4": failed to add IP addr {Version:4 Interface:0xc00028a240 Address:{IP:192.168.2.1 Mask:ffffff00} Gateway:<nil>} to "eth0": address already in use
  Warning  FailedCreatePodSandBox  4m48s                kubelet, worker  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "559ec328e7f8230c6362f4be7435505e203375e3d1a1ab9c0d8f83e716cbb144": failed to add IP addr {Version:4 Interface:0xc0000b6d50 Address:{IP:192.168.2.1 Mask:ffffff00} Gateway:<nil>} to "eth0": address already in use
  Warning  FailedCreatePodSandBox  4m34s                kubelet, worker  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "38dca0cb7059faa34daf9835b12416d85aa67bd1d558014723cc2a36ca447e07": failed to add IP addr {Version:4 Interface:0xc000216240 Address:{IP:192.168.2.1 Mask:ffffff00} Gateway:<nil>} to "eth0": address already in use
  Warning  FailedCreatePodSandBox  4m21s                kubelet, worker  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "569ea5c9cb82b9a209dede2d2be2803826e7e56459c660acd6c96785ed285a41": failed to add IP addr {Version:4 Interface:0xc000098330 Address:{IP:192.168.2.1 Mask:ffffff00} Gateway:<nil>} to "eth0": address already in use
  Warning  FailedCreatePodSandBox  33s (x17 over 4m8s)  kubelet, worker  (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "7686f3edb965a352b959da8ec1ff5f0252596ab13d04c2aa51e8b7ace03504b2": failed to add IP addr {Version:4 Interface:0xc000190240 Address:{IP:192.168.2.1 Mask:ffffff00} Gateway:<nil>} to "eth0": address already in use

yaocw2020 avatar Mar 24 '21 04:03 yaocw2020

This may be related to what I am seeing, though my error is different because I am ensuring my test pods are scheduled to different nodes.

When using the kubernetes data store, I observe that every allocation just clobbers the previous (I only ever see the most recently launched pod under allocations podref) and they only ever get the first address in the range.

ctrahey avatar Mar 30 '21 02:03 ctrahey

I have confirmed that Issue 97 was my issue, and I suspect it might be yours too.

I built master just now, pushed to my mixed-arch repo ctrahey/whereabouts with the tag fix-97

ctrahey avatar Mar 30 '21 02:03 ctrahey