API Reference
Packages
| Group / Version | Description |
|---|---|
| mikrolb.de/v1alpha1 | Initial 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.
| Field | Description | Default | Validation |
|---|---|---|---|
apiVersion string | mikrolb.de/v1alpha1 | ||
kind string | IPAllocation | ||
metadata ObjectMeta | Refer to Kubernetes API documentation for fields of metadata. | ||
spec IPAllocationSpec | Desired state of the IP allocation. | ||
status IPAllocationStatus | Observed state of the IP allocation. |
IPAllocationPhase
IPAllocationPhase defines the current phase of the IPAllocation.
Appears in: IPAllocationStatus
Underlying type: string
| Value | Description |
|---|---|
Pending | The IP allocation was not yet processed by the controller. This is the initial phase after creation. |
Allocated | An 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". |
Programmed | The allocated IP address has been successfully programmed for advertisement on the router. This is the final phase for advertised addresses. |
Failed | The 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
| Field | Description | Default | Validation |
|---|---|---|---|
ipFamily IPFamily | Desired IP family of the address to allocate. Must be either "IPv4" or "IPv6". | Optional Enum: [IPv4 IPv6] | |
poolName string | Name of the desired IP pool to allocate an address from. | Optional MaxLength: 253 Pattern: ^[a-z0-9]([a-z0-9\-\.]*[a-z0-9])?$ | |
address string | Specific IP address to allocate. Must be a valid IPv4 or IPv6 address. | Optional |
IPAllocationStatus
IPAllocationStatus defines the observed state of IPAllocation
Appears in: IPAllocation
| Field | Description | Default | Validation |
|---|---|---|---|
phase IPAllocationPhase | Phase is the current status phase of the allocation. | Pending | Optional |
address string | Address is the allocated IP address. This is only set if Phase is "Allocated" or "Programmed". | Optional | |
advertised boolean | Whether 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 string | InterfaceName 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 array | Conditions hold the latest available observations of the IPAllocation's state. | Optional | |
observedGeneration integer | ObservedGeneration 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.
| Field | Description | Default | Validation |
|---|---|---|---|
apiVersion string | mikrolb.de/v1alpha1 | ||
kind string | IPPool | ||
metadata ObjectMeta | Refer to Kubernetes API documentation for fields of metadata. | ||
spec IPPoolSpec | Desired state of the IP pool. | ||
status IPPoolStatus | Observed 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
| Field | Description | Default | Validation |
|---|---|---|---|
ipFamily IPFamily | IP family of the addresses in this pool. Must be either "IPv4" or "IPv6". | Required Enum: [IPv4 IPv6] | |
addresses string array | List 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 boolean | If false, IPs from this pool will not be auto-assigned to services. Services must explicitly request this pool via annotation. | true | |
avoidBuggyIPs boolean | If 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 boolean | Whether 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 string | Network 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
| Field | Description | Default | Validation |
|---|---|---|---|
totalAddresses string | Total number of allocatable addresses in this pool in a human-readable format, e.g. "256", "1K" or "1M". | Optional | |
allocatedAddresses string | Number of currently allocated addresses in a human-readable format, e.g. "256", "1K" or "1M". | Optional | |
freeAddresses string | Number of currently unallocated addresses in a human-readable format, e.g. "256", "1K" or "1M". | Optional | |
conditions Condition array | Conditions represent the latest available observations of the IP pool's state. | Optional | |
observedGeneration integer | ObservedGeneration 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 |