Deploying Iroha to Azure Kubernetes

Gino Busok Jr
3 min readSep 25, 2019

--

We need a blockchain technology for one of our projects. We chose Hyperledger Iroha because of its simplicity and it can handle all of our required use cases. Next thing is deploying this to Azure Kubernetes Service, which is what this blog is about.

If you are using Amazon EKS, you can just follow iroha’s own guide found here. If you stumbled in this blog searching for instructions to deploy Iroha to Azure K8S then read on.

Assumptions:

  1. You already have running Azure K8S cluster.
  2. I will be using kubectl so you should already configured your kubectl client
  3. Basic understanding of Iroha and its APIs
  4. Basic understanding of blockchain

Start by cloning this github project https://github.com/hyperledger/iroha-deploy. This contains the files you will need to deploy Iroha. Once cloned, go to ansible/roles/iroha-k8s/files/. You will need the following files

  1. ./k8s-iroha.yaml — contains a StatefulSet which is needed to deploy Iroha. There is also a Service here so other pods can connect to Iroha. This configuration will deploy 4 replicas so 4 peers. If you want to decrease, change the value of spec.replicas
  2. ./k8s-peers-keys.yaml — contains the public and private keys for our peers. This supports up to 4 peers so up to 4 pods. If you want more, just add additional public/private key pairs.
  3. ./conf/config.docker — default configuration of an Iroha instance.
  4. ./conf/genesis.block — a genesis block is required for Iroha. This will be the initial state of your Iroha instance. This file is just a JSON file so you can just use any editor that can handle JSON files. There are 4 addPeer calls in this file. If you changed the number of peers, you should also update these calls as well

We can now start the deployment. First, let’s create a config map

kubectl create configmap iroha-config --from-file=path/to/your/conf/

Verify by running

kubectl get configmap iroha-config

Your newly created config map should be there

Next, let’s create the Secrets for our peers’ keys

kubectl create -f path/to/your/k8s-peer-keys.yaml

Verify by running

kubectl get secrets

All of your peer keys should be there.

Lastly, its time to actually deploy Iroha

kubectl create -f path/to/your/k8s-iroha.yaml

You just need to wait about 5 to 10 minutes (depending on the number of your peers) for the deployment to finish.

You can verify by running

kubectl get pods

All of your peers should be there and should have a status of Running.

That’s it! You now have a running Iroha instance on Azure K8S cluster. Note that you cannot publicly access your Iroha instance. You will need to deploy your app in the same network. If you want to use your Iroha instance publicly, you can create a new service with a public IP address like this

Then you can publicly access your instance using your-iroha-public-address:50051

If you want to uninstall, just follow these steps

  1. Delete “iroha” service
  2. Delete “iroha” statefulset
  3. Delete all pvc associated with your iroha instance
  4. If you want full cleanup, delete the secrets and config map as well

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Gino Busok Jr
Gino Busok Jr

No responses yet

Write a response