Debugging IPAllocations
IPAllocation is the best place to debug why address assignment or programming failed for a Service.
What To Check First
IPAllocation is cluster-scoped, so there is no namespace on the object itself.
Start with a quick overview:
sh
kubectl get ipallocations.mikrolb.deThis already shows key state columns, including:
- configured family, pool, and requested address
- current allocated address
Status(phase)Ready,Reason, andMessage
Then inspect one object in detail:
sh
kubectl describe ipallocation <name>The describe output includes both conditions and Kubernetes events, which usually contain the most actionable error details.
Find IPAllocations For A Service
MikroLB stores the service reference in labels:
mikrolb.de/service-namespacemikrolb.de/service-name
Use selectors to filter allocations for one Service:
sh
kubectl get ipallocations.mikrolb.de \
-l mikrolb.de/service-namespace=default,mikrolb.de/service-name=demoRead The Status Model
Important status fields and conditions:
status.phase:Pending,Allocated,Programmed, orFailedstatus.conditions[type=Allocated]: whether an address could be chosenstatus.conditions[type=Programmed]: whether router programming succeededstatus.conditions[type=Ready]: overall readiness and primary reason
In practice:
Allocatedmeans address selection succeededProgrammedmeans advertisement/programming on RouterOS succeededReady=Truemeans allocation is usable for service traffic
Common Failure Reasons
The Reason and Message fields on conditions and events point to the exact failure class.
Allocation-stage failures
AddressInvalid: the requestedspec.addressis not a valid IPAddressAlreadyUsed: address already owned by another allocationAddressNotInPool: requested address does not belong to allowed pool(s)PoolNotFound: requestedspec.poolNamedoes not existPoolIPFamilyMismatch: requested family does not match pool familyPoolExhausted: no free address in the selected pool (or any auto-assign pool)
Programming-stage failures
ProgrammingFailedevent withBackendErrorcondition reason: MikroLB allocated an address, but RouterOS programming failed
Suggested Debug Flow
- Verify Service selection and annotations:
sh
kubectl -n <service-namespace> describe service <service-name>- List allocations for that service:
sh
kubectl get ipallocations.mikrolb.de \
-l mikrolb.de/service-namespace=<service-namespace>,mikrolb.de/service-name=<service-name>- Inspect failing allocation details and events:
sh
kubectl describe ipallocation <allocation-name>- Correlate with pool state:
sh
kubectl get ippool
kubectl describe ippool <pool-name>- If allocation succeeded but programming failed, inspect controller logs:
sh
kubectl -n mikrolb-system logs deploy/mikrolb-controllerTypical Fixes By Symptom
PoolNotFound: create the missing pool or fix the pool name annotationPoolIPFamilyMismatch: align service request family with poolipFamilyPoolExhausted: expand pool ranges/CIDRs or add another poolAddressNotInPool: request an address that is actually inside the selected poolAddressAlreadyUsed: choose a different explicit IP or let MikroLB auto-assignBackendError/ProgrammingFailed: verify RouterOS connectivity, credentials, and advertisement interface