Don’t need IP leases? This is an optional feature. Skip if you don’t have available public IP addresses.
This guide shows how to enable IP leases on your Akash provider, allowing deployments to request static public IP addresses.
Time: 20-30 minutes
Prerequisites
Before starting, ensure you have:
- Provider installed and running (see Provider Installation)
- Pool of public IP addresses available for allocation
- Layer 2 network access to broadcast ARP for IP addresses
Important: IP leases require you have unallocated public IP addresses and the ability to use them with your provider’s network infrastructure.
STEP 1 - Install MetalLB
MetalLB provides load-balancing and IP address management for Kubernetes clusters.
Create Namespace
kubectl create namespace metallb-systemInstall via Helm
helm repo add metallb https://metallb.github.io/metallbhelm repo update
helm install metallb metallb/metallb \ --namespace metallb-system \ --version 0.14.9Verify Installation
kubectl -n metallb-system get podsExpected output:
NAME READY STATUS RESTARTS AGEmetallb-controller-xxx 1/1 Running 0 2mmetallb-speaker-xxx 1/1 Running 0 2mmetallb-speaker-yyy 1/1 Running 0 2mSTEP 2 - Configure IP Address Pool
Create a configuration file defining your public IP address pool.
Create Configuration
Replace the IP addresses with your actual public IP pool:
cat > metallb-config.yaml << 'EOF'---apiVersion: metallb.io/v1beta1kind: IPAddressPoolmetadata: name: default namespace: metallb-systemspec: addresses: - 203.0.113.0/28 # CIDR notation - 203.0.113.20-203.0.113.30 # Range notation - 203.0.113.50/32 # Single IP autoAssign: true avoidBuggyIPs: false---apiVersion: metallb.io/v1beta1kind: L2Advertisementmetadata: name: l2advertisement namespace: metallb-systemspec: ipAddressPools: - defaultEOFConfiguration options:
- addresses: List of IP ranges in CIDR, range, or single IP format
- autoAssign: Automatically assign IPs from this pool (default: true)
- avoidBuggyIPs: Avoid .0 and .255 addresses (default: false)
Apply Configuration
kubectl apply -f metallb-config.yamlVerify Configuration
kubectl -n metallb-system get ipaddresspoolkubectl -n metallb-system get l2advertisementSTEP 3 - Enable Strict ARP
MetalLB requires strictARP mode in kube-proxy for Layer 2 operation.
kubectl get configmap kube-proxy -n kube-system -o yaml | \sed -e "s/strictARP: false/strictARP: true/" | \kubectl apply -f - -n kube-systemRestart kube-proxy
kubectl -n kube-system rollout restart daemonset kube-proxySTEP 4 - Expose MetalLB Controller
The Akash IP Operator needs access to the MetalLB controller:
kubectl -n metallb-system expose deployment metallb-controller \ --name=controller \ --overrides='{"spec":{"ports":[{"protocol":"TCP","name":"monitoring","port":7472}]}}'Verify Service
kubectl -n metallb-system get svc controllerSTEP 5 - Install Akash IP Operator
Add Akash Helm Repository (if not already added)
helm repo add akash https://akash-network.github.io/helm-chartshelm repo updateInstall IP Operator
helm install akash-ip-operator akash/akash-ip-operator \ --namespace akash-servicesVerify IP Operator
kubectl -n akash-services get pods -l app=akash-ip-operatorExpected output:
NAME READY STATUS RESTARTS AGEakash-ip-operator-xxx 1/1 Running 0 2mSTEP 6 - Update Provider Configuration
Add IP lease capabilities to your provider attributes.
Edit provider.yaml
nano /root/provider/provider.yamlAdd the following attributes:
attributes: # ... existing attributes ... - key: ip-lease value: "true"Update Provider
cd /root/provider
helm upgrade akash-provider akash/provider \ -n akash-services \ -f provider.yaml \ --set bidpricescript="$(cat price_script.sh | openssl base64 -A)"STEP 7 - Verify IP Leases
Check IP Operator Logs
kubectl -n akash-services logs -l app=akash-ip-operatorLook for successful initialization messages.
Test with Deployment
Deploy a test workload that requests an IP:
---version: "2.0"
services: web: image: nginx:1.25.3 expose: - port: 80 as: 80 to: - global: true ip_name: myip
profiles: compute: web: resources: cpu: units: 0.5 memory: size: 512Mi storage: size: 512Mi placement: akash: pricing: web: denom: uakt amount: 1000
deployment: web: akash: profile: web count: 1After deployment, check if an IP was assigned:
kubectl -n lease get svcTroubleshooting
MetalLB Speaker Not Running
Check speaker logs:
kubectl -n metallb-system logs -l app.kubernetes.io/component=speakerEnsure nodes have the correct network permissions for Layer 2 ARP.
IPs Not Assigning
Check IP address pool:
kubectl -n metallb-system describe ipaddresspool defaultVerify the IP range is correct and not already in use.
IP Operator Errors
kubectl -n akash-services logs -l app=akash-ip-operator --tail=100Common issues:
- MetalLB controller service not accessible
- IP pool exhausted
- Network configuration blocking ARP
Next Steps
Your provider now supports IP leases!
Optional enhancements:
- TLS Certificates - Automatic SSL certificates for deployments
Resources:
- MetalLB Documentation - Official MetalLB docs
- Provider Verification - Health checks and verification
Monitor IP usage:
# Check allocated IPskubectl -n metallb-system get ipaddresspool default -o yaml
# View IP operator statuskubectl -n akash-services logs -l app=akash-ip-operator -f