How to Deploy Fabric Network on Kubernetes?

11/20/2019

I want to deploy the hyperledger fabric network on Kubernetes, can anyone guide me or provide the sample docs for the same

-- Suresh
hyperledger-fabric
kubernetes

1 Answer

11/21/2019

You can find amazing documentation along with examples in Hyperledger Fabric meets Kubernetes. I have tested with 1.4.1 HL Fabric binaries - works fine.


Requirements

  • A running Kubernetes cluster, Minikube should also work, but not tested

  • HL Fabric binaries (There is an issue with cryptogen 1.4.3, so use 1.4.2 or 1.4.1)

  • Helm, developed with 2.11, newer 2.xx versions should also work

  • jq 1.5+ and

  • yq 2.6+

  • Argo, both CLI and Controller 2.4.0+

  • Minio, only required for backup/restore and new-peer-org flows

  • Run all the commands in fabric-kube folder

  • AWS EKS users please also apply this fix


1) Run cluster and install helm

2) clone repo git clone https://github.com/APGGroeiFabriek/PIVT.git

3) Install HL Fabric binaries

$curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s -- 1.4.1 1.4.1 0.4.18

$export PATH=$PATH:/path-to-fabric-kube-dir/fabric-samples/bin (path to `cryptogen` bin)

$./init.sh ./samples/simple/ ./samples/chaincode/

-- creating certificates --
aptalkarga.tr
nevergreen.nl
atlantis.com
-- creating genesis block --
...
creating hlf-kube/chaincode/very-simple.tar
creating hlf-kube/chaincode/even-simpler.tar

4) install chart dependencies

$helm repo add kafka http://storage.googleapis.com/kubernetes-charts-incubator    
$helm dependency update ./hlf-kube/

5) inside fabric-kube folder launch the network:

helm install ./hlf-kube --name hlf-kube -f samples/simple/network.yaml -f samples/simple/crypto-config.yaml
...
Happy BlockChaining :)

And don't forget the first rule of BlockChain club:

"Do not use BlockChain unless absolutely necessary!"
-- VKR
Source: StackOverflow