In this guide we detail the enablement of IP Leases on a pre-existing Akash provider.
Please be aware of the following prerequisites prior to getting started.
NOTE - IP Leases enablement is an optional step for Akash providers. Some providers may not have available public IP address pools and/or other requirements for enabling this feature.
Prerequisites
- Provider IP Leases enablement is only supported for Akash providers built using Helm Charts
- Available pool of unallocated public IP addresses
Sections in this Guide
- Create the MetalLB Namespace
- MetalLB Install
- Enable strictARP in kube-proxy
- Akash Provider Update
- IP Operator
- Additional notes on the IP Operator
- Troubleshooting IP Leases Issues
Create the MetalLB Namespace
Issue the following command to create the necessary MetalLB namespace:
MetalLB Install
In this guide we present paths to install MetalLB both via Helm Charts and Kubespray. Please follow only the path applicable, ideal to your environment.
Sections within this guide:
- New MetalLB Deployment via Helm
- New MetalLB Deployment via Kubespray
- Migration of MetalLB Version 0.12.X to 0.13.x
Option 1: Deploy MetalLB with Helm
NOTE - If you plan to upgrade your MetalLB Helm-Chart in the future, ensure the metallb release notes are followed.
Expose your MetalLB Controller to the Akash IP Operator
Apply your MetalLB Config
NOTE - make sure you replace the example addresses with your IP ranges
Create the MetalLB Config
Apply the MetalLB Config
If you are using MetalLB with a kubernetes version that enforces Pod Security Admission (which is beta in k8s 1.23), make sure to label the metallb-system namespace with the following labels:
Option 2: Deploy MetalLB using Kubespray
Based on MetalLB via Kubespray guidance documented here
The Kubespray flags provided bellow should go into your Provider’s Kubespray inventory file and under the vars section. Our reference Provider Kubespray inventory file - used during initial Provider Kubernetes cluster build - is located here.
Expose your MetalLB Controller to the Akash IP Operator
- Kubespray your cluster with this config and then expose your MetalLB controller for the Akash IP Operator access it
Migrating MetalLB 0.12.X to 0.13.X
Perform the following only if you have upgraded your MetalLB from 0.12 (or prior) to 0.13 (or higher) version.
Based on https://metallb.universe.tf/configuration/migration_to_crds/
1). Save the old v0.12 configmap-based metallb config to a config.yaml
file
2). Use this command to migrate it to v0.13 (CRD-based format) - (resources.yaml
)
This will produce a new config file - resources.yaml
.
3). Apply the new config
4). Remove the old config
Example of Legacy v0.12 Metallb Configmap Based Config
config.yaml
Example of New metallb v0.13 CRD Based Config
resources.yaml
Enable strictARP in kube-proxy
If you’re using kube-proxy in IPVS mode, since Kubernetes v1.14.2 you have to enable strict ARP mode.
NOTE - this is not needed if you’re using kube-router as service-proxy because it is enabling strict ARP by default.
Achieve this by patching your kube-proxy config in current cluster:
- If using kubespray for your cluster deployment, make sure to add the following variable:
Akash Provider Update
IP Leases Provider Setting
Update your provider configuration with the necessary IP Leases setting. The setting will be added via an edit of your provider.yaml
file and subsequent provider Helm update as detailed in this section.
Capture Current Provider Settings to File
- Issue this command to capture current provider settings and write to file
Update Provider Settings
Open the file containing the current provider settings
NOTE - we will make two updates to the
provider.yaml
file in section. One update will enable the IP Operator. The second update will ensure the provider is advertising theip-lease
attribute.
Add the IP Operator Key-Value Pair
Attribute Update
Update your provider to advertise the following attribute. This attribute can be used (by users deploying on Akash) to select providers supporting the IP Lease.
Example Provider YAML Post Updates
Update Provider Command Template
Expected/Example Output
Verification
Run the following command to verify the the IP Operator setting
Expected/Example Output
IP Operator
Create the necessary IP Operator for IP Leases provider enablement.
Command Template
- Replace
<provider-address>
with the address of your provider
Example Command
Example Output
Additional notes on the IP Operator
If running non-Helm-based Akash Provider, then make sure to set the following
- Alternatively this could be passed in via CLI argument
- Additional ensure that the Akash provider IP operator is running (
provider-services ip-operator
)
Troubleshooting IP Leases Issues
Issues Following IP Leases Install
If either of the symptoms listed in this section are apparent following initial IP Leases installation, cure the issue by bouncing the ip-operator
pod as follows:
Symptoms
- The Akash Provider isn’t replying to 8443/status endpoint (I.e.
curl -ks https://provider.xyz.com:8443/status
) - The
akash-ip-operator
hasbarrier is locked messages
in its logs. Which can be gathered via: