Skip to content

Cilium IPAM

Use a CiliumPodIPPool as the IPAM source for an ImpNetwork instead of the internal allocator.

Prerequisites

  • Cilium installed on the cluster
  • CiliumPodIPPool CRD present

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 automatically

The 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 pool

The 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: 30

spec.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 ipam

Failure Modes

SymptomCauseFix
VM start fails, agent logs show pool lookup failureCiliumPodIPPool missingCreate pool or correct poolRef
Allocation subnet resolution errorPool has no spec.cidrsConfigure CIDR in pool
Pool lookup fails entirelyCilium CRD not installedInstall Cilium or set provider: internal

Rollback

bash
kubectl patch impnetwork vm-net-a -n default \
  --type=merge -p '{"spec":{"ipam":{"provider":"internal"}}}'