Cilium IPAM
Use a CiliumPodIPPool as the IPAM source for an ImpNetwork instead of the internal allocator.
Prerequisites
- Cilium installed on the cluster
CiliumPodIPPoolCRD present
Auto-managed pool (recommended)
When spec.ipam.provider: cilium is set, Imp automatically creates and owns the CiliumPodIPPool. You only need to reference it by name:
yaml
apiVersion: imp.dev/v1alpha1
kind: ImpNetwork
metadata:
name: vm-net-a
namespace: default
spec:
subnet: 10.44.0.0/24
ipam:
provider: cilium
cilium:
poolRef: vm-net-a # Imp creates this pool automaticallyThe pool CIDR defaults to spec.subnet. Override with spec.ipam.cilium.cidr:
yaml
spec:
ipam:
cilium:
poolRef: vm-net-a
cidr: 10.77.0.0/24 # use a different CIDR for the poolThe pool is deleted when the ImpNetwork is deleted.
Manual pool (advanced)
To manage the CiliumPodIPPool yourself, create it before the ImpNetwork and set the same poolRef. Imp will not modify a pool it does not own.
Example manual pool:
yaml
apiVersion: cilium.io/v2alpha1
kind: CiliumPodIPPool
metadata:
name: vm-net-a
spec:
ipv4:
cidrs:
- 10.77.0.0/24
maskSize: 30spec.subnet is still required for API compatibility. VM IP allocation uses the Cilium pool CIDR.
Verify
bash
kubectl get ciliumpodippool vm-net-a -o yaml
kubectl get impnetwork vm-net-a -n default -o jsonpath='{.spec.ipam.cilium.poolRef}'
kubectl -n imp-system logs ds/imp-agent | grep -i ipamFailure Modes
| Symptom | Cause | Fix |
|---|---|---|
| VM start fails, agent logs show pool lookup failure | CiliumPodIPPool missing | Create pool or correct poolRef |
| Allocation subnet resolution error | Pool has no spec.cidrs | Configure CIDR in pool |
| Pool lookup fails entirely | Cilium CRD not installed | Install Cilium or set provider: internal |
Rollback
bash
kubectl patch impnetwork vm-net-a -n default \
--type=merge -p '{"spec":{"ipam":{"provider":"internal"}}}'