An Akash Provider leases compute to users launching new deployments. Follow the steps in this guide to build your own provider using a streamlined Kubernetes install process.
This guide uses a Rancher K3s to build a single control plane and worker node “all in one” Kubernetes cluster with little effort. The Kubernetes cluster is then utilized for the Akash Provider install and configuration steps.
Overview and links to the steps involved in Akash Provider Build using K3s:
- Install K3s and Initial Cluster Config
- Install the Akash CLI for Provider Use
- Akash Provider Wallet
- Export Provider Wallet
- Install Helm
- Provider Build via Helm Chart
- Hostname Operator Build
- Ingress Controller Install
- Next Steps - Provider Health Check and Optional Services
STEP 1 - Install K3s and Initial Cluster Config
Overview
In this section we will deploy a Kubernetes control plane and worker node on a single server using Rancher K3s. The use of K3s allows a very simple Kubernetes cluster install appropriate for single server production and lab environments.
Install K3s
Configure Kubeconfig
Confirm Kubectl Access to the Kubernetes Cluster
Expected/Example Output
Create Necessary Labels for the Akash Provider
Removing K3s
To uninstall K3s follow this link
STEP 2 - Install Akash CLI
Install the Akash CLI for Provider Use
Verify Akash CLI Install
Expected/Example Output
STEP 3 - Akash Provider Wallet
Placing a bid on an order requires a 0.5 AKT deposit placed into collateral per bid won. If the provider desired 2 concurrent leases, the provider’s wallet would need minimum funding of 10AKT.
As every deployment request bid requires 0.5 AKT to be deposited in the escrow account, it’s always good to have more so your provider can keep bidding. If your provider is ready to offer 10 deployments, then it’s best to have .5 x 10 = 5 AKT and a little more to make sure the provider can pay the fees for broadcasting the transactions on Akash Network.
The steps to create an Akash wallet are covered in the following documentation sections:
Import the Wallet onto the Akash Provider
- Capture the Akash Account in the output of
provider-services keys add
for use in the subsequent step
Configure Network And Account Settings
Check Provider Wallet Balance
Expected/Example Output
STEP 4 - Export Provider Wallet
In this section we will export the pre-existing, funded wallet to store the private key in a local file. To conduct the commands in this section the Akash CLI must be installed which is detailed in this guide (STEP 1 only).
The wallet used will be used for the following purposes:
- Pay for provider transaction gas fees
- Pay for bid collateral which is discussed further in this section
Make sure to create a new Akash account for the provider and do not reuse an account used for deployment purposes. Bids will not be generated from your provider if the deployment orders are created with the same key as the provider.
List Available Keys
- Print the key names available in the local OS keychain for use in the subsequent step
Example/Expected Output
Export Private Key to Local File
- The key-name can be any name of your choice
- Note the passphrase used to protect the private key as it will be used in future steps
NOTE - The passhprase MUST be at least 8 characters long. Otherwise provider will encounter
failed to decrypt private key: ciphertext decryption failed error
whenkeys import
is executed.
STEP 1 - Export Provider Key
Expected/Example Output
STEP 2 - Create key.pem and Copy Output Into File
- Copy the contents of the prior step into the
key.pem
file
NOTE - file should contain only what’s between
-----BEGIN TENDERMINT PRIVATE KEY-----
and-----END TENDERMINT PRIVATE KEY-----
(including theBEGIN
andEND
lines):
Example/Expected File Contents
STEP 5 - Install Helm
Helm Installation
Verify Helm Install
Expected/Example Output
Add Akash Helm Repository
STEP 6 - Provider Build via Helm Chart
Overview
In this section the Akash Provider will be installed and customized via the use of Helm Charts.
NOTE - when the Helm Chart is installed the Provider instance/details will be created on the blockchain and your provider will be registered in the Akash open cloud marketplace. The associated transaction for Provider creation is detailed here.
Environment Variables
- Declare the following environment variables for Helm use
- Replace the variables with your own settings
- Set akash provider address that starts with
akash1
This allows the akash-provider to decrypt the key
2. Set the password you have entered upon akash keys export > key.pem
3. Set your domain. Register DNS A and wildcard address as specified in previous step, i.e. provider.test.com
DNS A record and *.ingress.test.com
DNS wildcard record.
Domain should be a publicly accessible DNS name dedicated for your provider use such as test.com.
The domain specified in this variable will be used by Helm during the Provider chart install process to produce the “provider.yourdomain.com” sub-domain name and the “ingress.yourdomain.com” sub-domain name. The domain specified will also be used by Helm during the Ingress Controller install steps coming up in this guide. Once your provider is up and running the *.ingress.yourdomain.com URI will be used for web app deployments such as abc123.ingress.yourdomain.com.
4. Set the Akash RPC node for your provider to use
- If you are going to deploy Akash RPC Node using Helm-Charts then set the node to http://akash-node-1:26657 It is recommended that you install your own Akash RPC node. Follow this guide to do so.
Provider Withdraw Period
- Akash providers may dictate how often they withdraw funds consumed by active deployments/tenants escrow accounts
- Few things to consider regarding the provider withdraw period:
- The default withdraw setting in the Helm Charts is one (1) hour
- An advantage of the one hour default setting is assurance that a deployment may not breach the escrow account dramatically. If the withdraw period were set to 12 hours instead - the deployment could exhaust the amount in escrow in one hour (for example) but the provider would not calculate this until many hours later and the deployment would essentially operate for free in the interim.
- A disadvantage of frequent withdraws is the possibility of losing profitability based on fees incurred by the providers withdraw transactions. If the provider hosts primarily low resource workloads, it is very possible that fees could exceed deployment cost/profit.
OPTIONAL - Update the Provider Withdraw Period
- If it is desired to change the withdrawal period from the default one hour setting, update the
withdrawalperiod
setting in the provider.yaml file created subsequently in this section. - In the example the Provider Build section of this doc the withdrawal period has been set to 12 hours. Please adjust as preferred.
Provider Build Prep
- Ensure you are applying the latest version of subsequent Helm Charts install/upgrade steps
Create a provider.yaml File
- Issue the following command to build your Akash Provider
- Update the following keys for your unique use case
region
organization
- Optional Parameters - the following parameters may be added at the same level as
from
andkey
if you which to advertise your support email address and company website URL.email
website
Example provider.yaml File Creation
Verification of provider.yaml File
- Issue the following commands to verify the
provider.yaml
file created in previous steps
Example provider.yaml Verification Output
- Ensure there are no empty values
Provider Bid Defaults
- When a provider is created the default bid engine settings are used. If desired these settings could be updated and added to the
provider.yaml
file. But we would recommend initially using the default values. - Note - the
bidpricestoragescale
value will get overridden by-f provider-storage.yaml
covered in Provider Persistent Storage documentation. - Note - if you want to use a shellScript bid price strategy, pass the bid price script via
bidpricescript
variable detailed in the bid pricing script doc. This will automatically suppress allbidprice<cpu|memory|endpoint|storage>scale
settings.
Install the Provider Helm Chart
Expected Output of Provider Helm Install
Provider Confirmation
Expected output (example and name following akash-provider will differ)
Troubleshooting
If your Akash Provider pod status displays init:0/1
for a prolonged period of time, use the following command to view Init container logs. Often the Provider may have a RPC issue and this should be revealed in these logs. RPC issues may be caused by an incorrect declaration in the NODE variable declaration issued previously in this section. Or possibly your custom RPC node is not in sync.
Helm Chart Uninstall Process
- Should a need arise to uninstall the Helm Chart and attempt the process anew, the following step can be used
- Only conduct this step if there is a problem with Akash Provider Helm Chart install
- This Helm uninstall technique can be used for this or any subsequent chart installs
- Following this step - if needed - start the Provider Helm Chart install anew via the prior step in this page
STEP 7 - Hostname Operator Build
- Run the following command to build the Kubernetes hostname operator
- Note - if a need arises to use a different software version other than the one defined in the Chart.yaml Helm file - include the following switch. In most circumstances this should not be necessary.
--set image.tag=<image-name>
- Example:
--set image.tag=0.1.0
Expected/Example Output
Hostname Operator Confirmation
Expected output (example and name following akash-provider will differ)
Step 8 - Ingress Controller Install
Create Upstream Ingress-Nginx Config
- Create an
ingress-nginx-custom.yaml
file with the following contents:
Install Upstream Ingress-Nginx
Apply Necessary Labels
- Label the
ingress-nginx
namespace and theakash-ingress-class
ingressclass
STEP 9 - Next Steps - Provider Health Check and Optional Services
Akash Provider Checkup
Following the initial build of your Akash Provider, use the Akash Provider Checkup guide to ensure basic functionality.
Persistent Storage Enablement (OPTIONAL)
Use the Helm Based Provider Persistent Storage Enablement guide to host persistent volumes that will survive Kubernetes pod restarts for hosted deployments and workloads.
IP Leases Enablement (OPTIONAL)
Use the IP Leases Provider Enablement guide to allow static IP address/port assignment for hosted deployments and workloads.
Akash Provider Setup Complete
With these steps your Akash Provider setup and post install verifications should be complete!