k8snetworkplumbingwg / whereabouts

A CNI IPAM plugin that assigns IP addresses cluster-wide
Apache License 2.0
273 stars 120 forks source link

[BUG] Insane allocation in IPPool resource #403

Open OmniBerkshire opened 6 months ago

OmniBerkshire commented 6 months ago

Describe the bug We see this IPPool resource on one of our test clusters:

- apiVersion: whereabouts.cni.cncf.io/v1alpha1
  kind: IPPool
  metadata:
    creationTimestamp: "2023-08-01T17:52:22Z"
    generation: 14
    name: 1.2.3.0-24
    namespace: kube-system
    resourceVersion: "27149746"
    uid: 12345678-abcd-ef01-2345-6789abcdef01
  spec:
    allocations:
      "18446463705355360228":
        id: fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210
        podref: ns/ns-pod-9876543210-ddr9n
    range: 1.2.3.0/24

The IP and various UUIDs have been modified to protect the innocent.

Expected behavior I expected a sane value from 0-255 for the IP address key in the 'allocations' dictionary.

To Reproduce We have no idea how to reproduce this behavior. And believe me, we've tried.

Environment:

apiVersion: v1
kind: List
items:
- apiVersion: k8s.cni.cncf.io/v1
  kind: NetworkAttachmentDefinition
  metadata:
    annotations:
    creationTimestamp: "2023-04-30T22:38:57Z"
    generation: 1
    name: default
    namespace: some_other_ns
    resourceVersion: "36935446"
    uid: 28255717-da78-bbbd-a790-dcc10089d8d2
  spec:
    config: '{ "cniVersion": "0.3.1", "type": "macvlan", "master": "bond0.3", "mtu":
      9000, "ipam": { "type": "whereabouts", "datastore": "kubernetes", "kubernetes":
      { "kubeconfig": "/etc/cni/net.d/whereabouts.d/whereabouts.kubeconfig" }, "range":
      "1.2.3.0/24", "range_start": "1.2.3.225", "range_end": "1.2.3.254"
      } }'
{
  "datastore": "kubernetes",
  "kubernetes": {
    "kubeconfig": "/etc/cni/net.d/whereabouts.d/whereabouts.kubeconfig"
  },
  "reconciler_cron_expression": "30 4 * * *"
}

Additional info / context Add any other information / context about the problem here.