IBM-Blockchain-Archive / ibm-container-service

IBM Blockchain Platform for Developers on IBM Container Service
Apache License 2.0
89 stars 73 forks source link

Deploying Helm Chart to [Google] Kubernetes Engine #93

Open DazWilkin opened 6 years ago

DazWilkin commented 6 years ago

Folks --

Thanks for all the work on this excellent Helm chart to deploy Fabric to Kubernetes.

I was given a link to your site and have been able to provision a Fabric cluster on Kubernetes Engine.

When it completes, the Chart suggests but I assume Composer provides the HTTP/8080 endpoint (!?) and there isn't one for me to hit:

NOTES:
1. Get the application URL by running these commands:
   export POD_NAME=$(kubectl get pods --namespace default -l "app=ibm-blockchain-network,release=austere-otter" -o jsonpath="{.items[0].metadata.name}")
   echo "Visit http://127.0.0.1:8080 to use your application"
   kubectl port-forward $POD_NAME 8080:80

2. Next, create a channel and have your peers join by running these commands:
   helm install stable/ibm-blockchain-channel

However, the Helm chart deploys only Fabric while this site's documentation references the companion Composer integration.

I would value some pointers on how to deploy Composer too such that it integrates with Fabric.

kubectl get services
NAME                               TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                         AGE
ibm-blockchain-network-ca          NodePort    10.23.244.71    <none>        7054:30000/TCP                  47m
ibm-blockchain-network-orderer     NodePort    10.23.251.118   <none>        31010:31010/TCP                 47m
ibm-blockchain-network-org1peer1   NodePort    10.23.246.207   <none>        5010:30110/TCP,5011:30111/TCP   47m
ibm-blockchain-network-org2peer1   NodePort    10.23.253.177   <none>        5010:30210/TCP,5011:30211/TCP   47m
kubernetes                         ClusterIP   10.23.240.1     <none>        443/TCP                         4h
nfs-server                         ClusterIP   10.23.249.127   <none>        2049/TCP,20048/TCP,111/TCP      3h

and:

image

DazWilkin commented 6 years ago

Here's my fork-not-fork of your repo to tweak the Helm Chart: https://github.com/DazWilkin/ibm-blockchain-network

Blogged about it too: https://medium.com/google-cloud/fabric-on-google-cloud-platform-97525323457c

mrshah-at-ibm commented 6 years ago

thanks @DazWilkin.. would you be interested in making a PR to the repository?

Also, we did have the chaincode install/instantiate etc. as part of the helm chart, but it gets difficult to wait until all the components are running before running the install/instantiate. So we had to remove it and only use the helm chart to bring up the network.

DazWilkin commented 6 years ago

Thanks for the prompt and helpful reply @mrshah-at-ibm and thanks for building this Chart!

Yes, I'd be happy to submit a PR.

IBM Container Service appears to include a ReadWriteMany storage class but Kubernetes Engine currently does not. I will check with Kubernetes Engineering on their recommendation. I've used an NFS Service on Kubernetes backed by Google's SSD Persistent Disk and this works well but I'll confirm whether that's the definitive recommendation.

The only other change I made is to the volume for compose-credentials. Kubernetes Engine defaults to Container-Optimized OS and this does not permit read-write mounts on "/". I changed this from /compose to /tmp/composer (which should work elsewhere).

I'll spent time today|tomorrow working through your broader deployment to see if I can get chaincode deployed too. It's unfortunate that we must use multiple tools to achieve this; a tool to:

mrshah-at-ibm commented 6 years ago

@DazWilkin thanks for willing to submit a PR.

You might not want to use /tmp as it will be removed on the container restart. A lot of users complained about it and hence we moved it to /compose. You might want to use $HOME folder instead.