My question is how to deploy a hyperledger fabric blockchain to kubernetes?

9/8/2019

I want to setup my hyperledger blockchain application into kubernetes cluster.

-- Aditya Joshi
hyperledger-fabric
kubernetes

1 Answer

9/8/2019

I don't want to encourage questions like this but here are some steps that you could possibly help you:

  1. Ensure your application runs correctly locally on Docker.
  2. Construct your Kubernetes configuration files. What you will need:
    • A deployment or a statefulset for each of your peers.
    • A statefulset for the couchdb for each of your peers.
    • A deployment or a statefulset for each of your orderers.
    • One service per peer, orderer and couchdb (to allow them to communicate).
    • A job that creates and joins the channels.
    • A job that installs and instantiates the chaincode.
    • Generated crypto-material and network-artifacts.
    • Kubernetes Secrets or persistent volumes that hold your crypto-material and network-artifacts.
    • An image of your dockerized application (I assume you have some sort of server using an SDK to communicate with the peers) uploaded on a container registry.
    • A deployment that uses that image and a service for your application.
  3. Create a Kubernetes cluster either locally or on a cloud provider and install the kubectl CLI on your computer.
  4. Apply (e.g. kubectl apply -f peerDeployment.yaml) the configuration files on your cluster with this order:
    • Secrets
    • Peers, couchdb's, orderers (deployments, statefulsets and services)
    • Create channel jobs
    • Join channel jobs
    • Install and instantiate chaincode job
    • Your application's deployment and service

If everything was configured correctly, you should have a running HLF platform in your Kubernetes cluster. It goes without saying that you have to research each step to understand what you need to do. And to experiment, a lot.

-- volcanic
Source: StackOverflow