Just another simple CNI IPAM!
You can use it as macvlan, bridge .. cni ipam backend. I've tried whereabouts before, it’s easy to use but there are more bugs and performance issues, such as IP conflict.
The whereabouts ipam has several bad design patterns:
1 use a large configmap maintaining ip assign records, which doesn’t work good in large network.
2 use daemonset instance for leader election, and iterate for the whole ip ranges to allocate just one ip. which may lead to ip conflict in a high concurrent case.
IP conflict is unacceptable, So I write my own!
You can manually setup network for each node or just specify a /16
pod cidr, it will slice subnet for each node.
Since we maintain the IP state machine, there will be no ip conflict bug.
Best practice Multus CNI + Macvlan|Bridge + Claude IPAM
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
annotations:
k8s.v1.cni.cncf.io/resourceName: mellanox.com/roce
name: roce-macvlan
namespace: default
spec:
config: '{ "type": "macvlan", "cniVersion": "0.3.1", "name": "roce-macvlan",
"ipam": { "type": "claude", "range": "172.10.0.0/16" } }'
export DOCKER_IMAGE=<your own registry>/claude-cni
make docker-build
make docker-push
# dependency: you should deploy your own etcd.
# modify the claude-config cm, speciy the etcdEndpoints.
cd deploy/base
kustomize build | kubectl apply -f -