Let's see how Rancher helps in easy management of Blockchain Protocols
-
Introduction to Rancher
Rancher is an open-source software which offeres Kubernetes-as-a-Service. It is used to provision and manage Kubernetes clusters. You can import existing clusters, either custom or managed clusters like EKS and GKE, or define and deploy your own with RKE or K3s. -
Introduction to Blockchain
Blockchain technology is most simply defined as a decentralized, distributed ledger that records the provenance of a digital asset. By inherent design, the data on a blockchain is unable to be modified, which makes it a legitimate disruptor for industries like payments, cybersecurity and healthcare.
2.1. Blockchain Protocol Development
Before we start, remember that blockchain is an immutable chain of records called ‘blocks’ that contains:
- transactions
- data
- files
Blocks are chained together with hashes. Developing a blockchain from scratch and its implementation can take months or years to complete because it requires thorough research. It takes a lot of consideration and time to discover and implement an idea successfully.
- We will try to provision multiple blockchain protocols on Kubernetes clusters and then integrate the Rancher to the cluster to provision and manage the complex blockchain infrastructure.
- Store the docker images in the private or public Docker registries.
- Create a cluster in Azure AKS
Steps to create AKS Cluster: https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough-portal
- Create a Virtual Machine, or You can also run Rancher in your local machine:
- Install Docker on your system: https://docs.docker.com/engine/install/
- Install Rancher, visit: https://rancher.com/quick-start
Or use:
sudo docker run --privileged -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
- Check for Rancher Container is up and Running
- Run the Web UI of the Rancher: `http://localhost`
- UI will open:
-
Run the command:
kubectl get secret --namespace cattle-system bootstrap-secret -o -go-template='{{.data.bootstrapPassword | base64decode}}{{"\n"}}'
- Create new passwords for Rancher
- Now on this tab we can create our new cluster or can import an existing one
- Import your cluster
- Once created, Run the kubectl command below on an existing Kubernetes cluster running a supported Kubernetes version to import it into Rancher:
-
Ensure that you have k8s tools installed, visit here for more details: https://kubernetes.io/docs/tasks/tools/
-
Once you created Azure AKS cluster, click on
connect
and copy the commands into your system -
Create a namespace
kubectl create namespace <namespace>
-
If the docker images are stored in private registries, then create docker certificates, regcred secrets, for pulling images from private registries.
-
Apply yaml files:
- configmap
- secrets
- pvc
- deployment
- service
- Sample deployment files for the protocols:
- Ethereum Frontend: https://github.com/abhi-bhatra/GSoC-Rancher-Demo/tree/master/eth-frontend
- Ethereum Backend: https://github.com/abhi-bhatra/GSoC-Rancher-Demo/tree/master/eth-backend
- Databases: https://github.com/abhi-bhatra/GSoC-Rancher-Demo/tree/master/database
Note: Plan to deploy some more protocols together and manage all the protocols using Rancher Dashboard