Skip to content

API Reference

Packages

Group / VersionDescription
mikrolb.de/v1alpha1Initial release of the MikroLB API, providing IPPool and IPAllocation resources.

mikrolb.de/v1alpha1

Initial release of the MikroLB API, providing IPPool and IPAllocation resources.

Resource Types

IPAllocation Kind

IPAllocation tracks the allocation of a single IP address for a service. The service reference is stored in the labels mikrolb.de/service-namespace and mikrolb.de/service-name.

FieldDescriptionDefaultValidation
apiVersion stringmikrolb.de/v1alpha1
kind stringIPAllocation
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec IPAllocationSpecDesired state of the IP allocation.
status IPAllocationStatusObserved state of the IP allocation.

IPAllocationPhase

IPAllocationPhase defines the current phase of the IPAllocation.

Appears in: IPAllocationStatus
Underlying type: string

ValueDescription
PendingThe IP allocation was not yet processed by the controller. This is the initial phase after creation.
AllocatedAn IP address has been successfully allocated for the service. If the address is not configured for advertisement, this is the final phase. Otherwise, the controller will attempt to program the address on the router and transition to "Programmed".
ProgrammedThe allocated IP address has been successfully programmed for advertisement on the router. This is the final phase for advertised addresses.
FailedThe controller failed to allocate an IP address for the service or to program the allocated address on the router. This is a terminal phase.

IPAllocationSpec

IPAllocationSpec defines the desired ip family, pool or address to allocate for a service. Exactly one and no more of the fields must be specified.

Appears in: IPAllocation

FieldDescriptionDefaultValidation
ipFamily IPFamilyDesired IP family of the address to allocate. Must be either "IPv4" or "IPv6".Optional
Enum: [IPv4 IPv6]
poolName stringName of the desired IP pool to allocate an address from.Optional
MaxLength: 253
Pattern: ^[a-z0-9]([a-z0-9\-\.]*[a-z0-9])?$
address stringSpecific IP address to allocate. Must be a valid IPv4 or IPv6 address.Optional

IPAllocationStatus

IPAllocationStatus defines the observed state of IPAllocation

Appears in: IPAllocation

FieldDescriptionDefaultValidation
phase IPAllocationPhasePhase is the current status phase of the allocation.PendingOptional
address stringAddress is the allocated IP address. This is only set if Phase is "Allocated" or "Programmed".Optional
advertised booleanWhether the allocated address is configured for advertisement via ARP/NDP on the router. This is only set if Phase is "Allocated" or "Programmed".Optional
interfaceName stringInterfaceName is the name of the network interface the allocated address is advertised on. This is only definitly set in phase "Programmed" and might be set in phase "Allocated".Optional
conditions Condition arrayConditions hold the latest available observations of the IPAllocation's state.Optional
observedGeneration integerObservedGeneration is the most recent generation observed by the controller for this IPAllocation. It is used to detect if the spec has been updated since the last reconciliation.Optional

IPPool Kind

IPPool represents a pool of IP addresses that can be allocated to services. It defines the IP family, the list of addresses or CIDRs in the pool, and other configuration options. The status tracks the total number of addresses in the pool and how many are currently allocated.

FieldDescriptionDefaultValidation
apiVersion stringmikrolb.de/v1alpha1
kind stringIPPool
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec IPPoolSpecDesired state of the IP pool.
status IPPoolStatusObserved state of the IP pool.

IPPoolSpec

IPPoolSpec defines the desired state of an IP pool, including the IP family, the list of addresses or CIDRs in the pool, and other configuration options.

Appears in: IPPool

FieldDescriptionDefaultValidation
ipFamily IPFamilyIP family of the addresses in this pool. Must be either "IPv4" or "IPv6".Required
Enum: [IPv4 IPv6]
addresses string arrayList of CIDRs, ranges or individual IPs, e.g. "192.168.1.0/24", "10.0.0.5", "172.16.10.7-172.16.10.10" or "fd37:274a:df59::/64". You can use the prefix "!" to exclude specific addresses or ranges from the pool, e.g. "!10.1.2.3" or "!10.1.0.0/24". Exclusions take precedence over inclusions, so if an IP matches both an inclusion and an exclusion, it will be excluded.Required
MinItems: 1
autoAssign booleanIf false, IPs from this pool will not be auto-assigned to services. Services must explicitly request this pool via annotation.true
avoidBuggyIPs booleanIf true, IPs from this pool will be allocated in a way that avoids known buggy addresses (e.g. .0, .1, .255 in IPv4 subnets). This only has an effect if the pool contains CIDR blocks, and is ignored for explicitly listed IPs or ranges. Enabling this may reduce the number of usable addresses in small subnets.true
advertise booleanWhether IPs from this pool should be advertised via ARP/NDP on the router. If false, addresses are allocated, load balancers and SNAT are configured, but the address will NOT be configured on an interface in RouterOS.true
interfaceName stringNetwork interface the router will use for ARP/NDP advertisement. If empty, no interface hint is passed and the most suitable interface is determined by the router's routing table.Optional
Pattern: ^(|[a-zA-Z0-9][a-zA-Z0-9\-\.]*[a-zA-Z0-9])$

IPPoolStatus

IPPoolStatus defines the observed state of an IP pool, including the total number of addresses in the pool, how many are currently allocated, and any relevant conditions.

Appears in: IPPool

FieldDescriptionDefaultValidation
totalAddresses stringTotal number of allocatable addresses in this pool in a human-readable format, e.g. "256", "1K" or "1M".Optional
allocatedAddresses stringNumber of currently allocated addresses in a human-readable format, e.g. "256", "1K" or "1M".Optional
freeAddresses stringNumber of currently unallocated addresses in a human-readable format, e.g. "256", "1K" or "1M".Optional
conditions Condition arrayConditions represent the latest available observations of the IP pool's state.Optional
observedGeneration integerObservedGeneration is the most recent generation observed by the controller for this IPPool. It is used to detect if the spec has been updated since the last reconciliation.Optional