Out of tree implementation of https://github.com/kubernetes/enhancements/tree/master/keps/sig-network/2593-multiple-cluster-cidrs
It allows users to use an ipam-controller that allocates IP ranges to Nodes, setting the node.spec.PodCIDRs fields. The ipam-controller is configured via CRDs
To build the binary for node-ipam-controller:
make build
To build the Docker image for node-ipam-controller:
make docker-build
Create a Kind cluster with disabled Node CIDRs allocation:
kind create cluster --config hack/test/kind/kind-cfg.yaml
Install ClusterCIDR CRD and configure node-ipam-controller to use dual mode (See the examples folder for more examples):
kubectl create -f charts/node-ipam-controller/gen/crds/networking.x-k8s.io_clustercidrs.yaml
kubectl create -f examples/clustercidr-dual.yaml
Run the controller outside the cluster by specifying Kind cluster kubeconfig:
./bin/manager --kubeconfig="$HOME"/.kube/config
To run the controller inside the cluster, a Docker image must first be loaded into a registry accessible within the Kind cluster.
docker build -t ghcr.io/sigs.k8s.io/node-ipam-controller:local -f Dockerfile .
docker save --output node-ipam-controller.tar ghcr.io/sigs.k8s.io/node-ipam-controller:local
kind load docker-image ghcr.io/sigs.k8s.io/node-ipam-controller:local
Check Kind documentation on how to use local container image registry.
Install node-ipam-controller in the cluster via helm:
helm install node-ipam-controller ./charts/node-ipam-controller --create-namespace --namespace nodeipam --set image.tag=local