Running Storj on Kubernetes to earn money for unused disk space

Justin Güse
3 min readOct 18, 2022

--

You might have heard of Storj, a distributed S3 compatible cloud storage like AWS S3.

If not, imagine everyone being able to offer their (private) disk space in exchange for money. Sounds insecure? Actually not, as their technology builds a zero trust environment where every file is encrypted at the client and split into 80 pieces, distributed in multiple copies among Storj nodes, leading to a 99.95% availability, 11 nines durability and a download speed of up to 24 Gb/s.

Storj website

Same as me, you might be running a Kubernetes cluster where a lot of disk space on the nodes is still empty, either because you are using volumes provided by your cloud provider, or because there is still a lot of overhead.

This might be a good time to mention that I am not affiliated with storj — I’m a Data Engineer offering Cloud solutions (https://datafortress.cloud/).

Now what if you could bring that empty disk space to a good use? Briefly said earnings are not amazing, but if that hardware is running anyways it’s a nice bonus! The way Storj is built it will reward you the longer your node is up and running. Expect not much return in the first year, but after 2–3 years you might be able to earn ~4$/TB/month if you have a good internet connection (October 22). This might go up as soon as the “Crypto winter” is over, so who knows.

Setting up an identity file

Now, in order for the Pod to know who you are, you first need to create four identity files. This can take some time, so you might have to do this on a strong machine and then copy the files afterward.

Check the how to here, or use my brief abbreviation:

curl -L https://github.com/storj/storj/releases/latest/download/identity_linux_amd64.zip -o identity_linux_amd64.zip
unzip -o identity_linux_amd64.zip
chmod +x identity
./identity create storagenode./identity authorize storagenode <email:characterstring>

After this, you will find four files (ca.cert, ca.key, …) in the folder ~/.local/share/storj/identity/storagenode (check your output, this might be different).

Kubernetes setup

Let us first create a namespace with

kubectl create namespace storj

Then, we will create a secret mounting the files above. You might need to change the directory to match your system

kubectl -n storj create secret generic storj --from-file=~/.local/share/storj/identity/storagenode/

Check your secret with

kubectl describe secret storj -n storj

The output should look like this:

Name:         storj
Namespace: storj
Labels: <none>
Annotations: <none>
Type: Opaque
Data
====
identity.key: 241 bytes
ca.cert: 558 bytes
ca.key: 241 bytes
identity.cert: 1096 bytes

After that, copy this deployment yaml and edit the matching values:

You have to change some values:
1. Address: Change this to your IP. Leave the port as is
2. Bandwith: Calculate how much TB your Download speed can offer per month
3. Email: Enter your email
4. Storage: Enter how much disk space you want to be used max
5. Wallet: Enter your Wallet id. This is where your reward will be transacted to. If you don’t have one, or want to say thanks feel free to use mine :)
6. Change YOURLOCALDIRECTORY to the local filepath of that node which you want to be used for Storj.

And that’s all! Just

kubectl apply -f ./storj-kubernetes.yaml as usual, and watch it spin up! Check the logs for more info, or follow the “setup an interface” tutorial on how to access the Web GUI for information on your earnings etc.

If you enjoyed this tutorial and experiment, feel free to head over to my website (https://datafortress.cloud/) to find more topics about cloud, big-data and AI!

--

--

Justin Güse

Justin Güse is the CEO of DataFortress.cloud. He loves Big-Data, Cloud and Virtual- and Augmented Reality, as well as books on self-reflecting in general.