To improve performance in large-scale clusters and reduce allocation contention, you can enable Fast IPAM by specifying a node_slice_size.
Requirements:
- You must run the Whereabouts controller (manifest in
doc/crds/node-slice-controller.yaml). - The Whereabouts daemonset and the controller must be in the same namespace as your
NetworkAttachmentDefinition.
Configuration:
Adding the node_slice_size field triggers Fast IPAM mode. The value determines the size of the CIDR allocated per node.
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: whereabouts-fast-ipam
spec:
config: '{
"cniVersion": "0.3.0",
"name": "whereaboutsexample",
"type": "macvlan",
"master": "eth0",
"mode": "bridge",
"ipam": {
"type": "whereabouts",
"range": "192.168.2.0/24",
"node_slice_size": "/22"
}
}'
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: whereabouts-fast-ipam
spec:
config: '{
"cniVersion": "0.3.0",
"name": "whereaboutsexample",
"type": "macvlan",
"master": "eth0",
"mode": "bridge",
"ipam": {
"type": "whereabouts",
"range": "192.168.2.0/24",
"node_slice_size": "/22"
}
}'