Akash Provider Migration Guide - 0.14.X to 0.16.3
v0.14.x to v0.16.3
Akash version 0.16.3 will introduce changes in CRDs that need to be applied in order to continue operations.
All steps below MUST be executed in the same order as declared and applied to your environment. If any step fails STOP and reach out to the Akash team.

Precursor to Upgrade - Orphan Manifest Purge

Create Script File

1
cd ~
2
3
vi manifest-purge.sh
Copied!

Populate Script File

1
#!/usr/bin/env bash
2
3
kubectl get mani -n lease -o 'custom-columns=name:{.metadata.name}' --no-headers | \
4
while read ns; do
5
6
# if ns exists, it's a fresh manifest.
7
if kubectl get ns "$ns" >/dev/null 2>&1; then
8
echo "FOUND: $ns"
9
continue
10
fi
11
12
# make sure it's a NotFound error before deleting.
13
nserr=$(kubectl get ns "$ns" 2>&1)
14
if [[ "$nserr" == *NotFound* ]]; then
15
echo "GONE: $ns"
16
kubectl delete mani "$ns" -n lease
17
continue
18
fi
19
done
Copied!

Make Script Executable

1
chmod +x ~/manifest-purge.sh
Copied!

Execute Script

1
./manifest-purge.sh
Copied!

Provider Service Running on Bare Metal/VM

STEP 1 - Upgrade RPC node to 0.16.3

If you are using 3rd-party RPC node ensure upgrade has been applied.
If you are using your own RPC node - as recommended for Providers - ensure the node has been upgraded.

STEP 2 - Stop provider service

The Akash Provider service is most likely controlled by systemd and if so can be stopped as shown below
1
systemctl stop akash-provider
Copied!

STEP 3 - Upgrade Akash Version

Download and extract the v0.16.3 from under the Assets drop-down menu here https://github.com/ovrclk/akash/releases/tag/v0.16.3 for your OS & Architecture.
Replace the old akash binary with the new one.

STEP 4 - Ensure Akash Client Upgrade

Verify Version and Expected Output

1
[email protected]:/home/ubuntu# akash version
2
3
v0.16.3
Copied!

STEP 5 - Download v0.16.3 Provider CRDs

1
wget https://raw.githubusercontent.com/ovrclk/akash/mainnet/main/pkg/apis/akash.network/crd.yaml
Copied!

STEP 6 - Install v0.16.3 CRDs

1
akash provider migrate v0.14tov0.16 --crd ./crd.yaml
Copied!

Expected Output from Upgrade

1
[email protected]:~# akash provider migrate v0.14tov0.16 --crd ./crd.yaml
2
3
using kube config file /root/.kube/config
4
checking manifests to backup
5
checking providers hosts to backup
6
total to backup
7
manifests: 1
8
provider hosts: 1
9
backup manifests
10
backup manifests DONE
11
backup provider hosts
12
backup provider hosts DONE
13
applying CRDs
14
customresourcedefinition.apiextensions.k8s.io "manifests.akash.network" deleted
15
customresourcedefinition.apiextensions.k8s.io "providerhosts.akash.network" deleted
16
customresourcedefinition.apiextensions.k8s.io/manifests.akash.network created
17
customresourcedefinition.apiextensions.k8s.io/providerhosts.akash.network created
18
applying CRDs DONE
19
applying manifests
20
manifest "mbamrdgl7ser2f253ubem42r074vsi6aj6c6a4bldfgq4" has been migrated successfully
21
applying manifests DONE
22
applying hosts
23
provider host "c5o7gdvuodea90sgpm7v3rt0d0.ingress.akashtesting.xyz" has been migrated successfully
24
applying hosts DONE
Copied!

STEP 7 - Start provider service

Using SystemD

1
systemctl start akash-provider
Copied!

STEP 8 - Create the Hostname Operator Service

1
cat /etc/systemd/system/akash-hostname-operator.service
2
[Unit]
3
Description=Akash Hostname Operator
4
After=network.target
5
6
[Service]
7
User=akash
8
Group=akash
9
ExecStart=akash provider hostname-operator
10
KillSignal=SIGINT
11
Restart=on-failure
12
RestartSec=15
13
StartLimitInterval=200
14
StartLimitBurst=10
15
#LimitNOFILE=65535
16
17
[Install]
18
WantedBy=multi-user.target
Copied!

STEP 9 - Start the Hostname Operator Service

1
systemctl start akash-hostname-operator
2
systemctl enable akash-hostname-operator
Copied!

STEP 10 - Check Status of Provider

  • Make a test deployment and ensure the DSEQ hits provider logs and that you can create deployment/lease and send manifest
1
journalctl -u akash-provider --since '5 min ago' -f
Copied!

Provider Service Running in Kubernetes via Helm Charts

If you are using Helm Charts for installing the Akash Provider and wishing to upgrade to 0.16.3, then run the same commands you have previously used with adding --set image.tag="0.16.3" on the command line like in the example below.

STEP 1 - Upgrade RPC node to 0.16.3

If you are using a 3rd-party RPC node ensure upgrade has been applied.
If you are using your own RPC node - as recommended for Providers - ensure the node has been upgraded.

STEP2 - Upgrade Provider

Scale Provider Down to Zero During Update

1
kubectl scale deploy -n akash-services akash-provider --replicas=0
Copied!
Update Current CRDs
1
kubectl apply --server-side -f https://raw.githubusercontent.com/ovrclk/helm-charts/main/charts/akash-provider/templates/crds.yaml
Copied!

Add/Update the Helm Repo

1
helm repo add akash https://ovrclk.github.io/helm-charts
2
helm repo update
Copied!

Perform the Upgrade

1
helm upgrade akash-node akash/akash-node -n akash-services ... --set image.tag="0.16.3"
2
3
helm upgrade akash-provider akash/provider -n akash-services ... --set image.tag="0.16.3"
4
5
helm upgrade hostname-operator akash/hostname-operator -n akash-services ... --set image.tag="0.16.3"
Copied!

Scale Provider Back Up Post Update

1
kubectl scale deploy -n akash-services akash-provider --replicas=1
Copied!

Additional Notes

Migrate command creates a directory to backup kubernetes objects. By default it is the current directory. It can be changed with --k8s-crd-migrate-path flag Directory content is preserved after success. Delete it IF and ONLY IF migration has been successful.