CRD-Backed by Cilium Cluster-Pool IPAM
This is a quick tutorial walking through how to enable CRD-backed by Cilium cluster-pool IPAM. The purpose of this tutorial is to show how components are configured and resources interact with each other to enable users to automate or extend on their own.
For more details, see the section Cluster Scope (Default)
Enable Cluster-pool IPAM mode
Setup Cilium for Kubernetes using helm with the options:
--set ipam.mode=cluster-pool.Depending if you are using IPv4 and / or IPv6, you might want to adjust the
podCIDRallocated for your cluster’s pods with the options:--set ipam.operator.clusterPoolIPv4PodCIDRList=<IPv4CIDR>--set ipam.operator.clusterPoolIPv6PodCIDRList=<IPv6CIDR>
To adjust the CIDR size that should be allocated for each node you can use the following options:
--set ipam.operator.clusterPoolIPv4MaskSize=<IPv4MaskSize>--set ipam.operator.clusterPoolIPv6MaskSize=<IPv6MaskSize>
Note
For IPv6 cluster-pool IPAM, the difference between the cluster CIDR prefix length and the per-node mask size must not be greater than 16. For example, the default
fd00::/104pool withipam.operator.clusterPoolIPv6MaskSize=120is valid because the difference is 16. If you use a larger IPv6 pool such as/64, setipam.operator.clusterPoolIPv6MaskSizeto80or another value that keeps the difference at 16 or less. Otherwise, the operator fails to initialize the IPv6 allocator withNew CIDR set failed; the node CIDR size is too big.Deploy Cilium and Cilium-Operator. Cilium will automatically wait until the
podCIDRis allocated for its node by Cilium Operator.
Validate installation
Validate that Cilium has started up correctly
$ cilium-dbg status --all-addresses KVStore: Ok etcd: 1/1 connected, has-quorum=true: https://192.168.60.11:2379 - 3.3.12 (Leader) [...] IPAM: IPv4: 2/256 allocated, Allocated addresses: 10.0.0.1 (router) 10.0.0.3 (health)
Validate the
spec.ipam.podCIDRssection:$ kubectl get cn k8s1 -o yaml apiVersion: cilium.io/v2 kind: CiliumNode metadata: name: k8s1 [...] spec: ipam: podCIDRs: - 10.0.0.0/24