Hyperledger Fabric Operator
Overview
Fabric operator is the kubernetes operator to allow a user to stand up
fabric CA, Orderer and Peer node using kubectl
Prerequisites
- kubectl v1.11.3+
- Access to a Kubernetes v1.11.3+ cluster
- A PersistentVolume storage location with AccessMode of ReadWriteOnce for each ca, peer, and orderer.
Getting Started
$ kubectl apply \
-f https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/crds/fabric_v1alpha1_crd.yaml?raw=true
The command should finish successfully if you see messages like the below:
customresourcedefinition.apiextensions.k8s.io/cas.fabric.hyperledger.org created
customresourcedefinition.apiextensions.k8s.io/orderers.fabric.hyperledger.org created
customresourcedefinition.apiextensions.k8s.io/peers.fabric.hyperledger.org created
Once the operator crds get created, start up the controller using the following command
kubectl apply \
-f https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/fabric-operator.yaml?raw=true
The above command starts up the fabric operator controller in your default namespace of your k8s cluster. If you try to use
a different namespace, you should download the fabric-operator.yaml file and change the namespace from default to whatever
the namespace that you want to use.
- Download the example fabric ca spec file
wget https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_ca_cr.yaml?raw=true -O myca.yaml
- Make changes to the example ca spec file according to your needs. Here are the list of things that you can change in the example ca spec file.
*. Node name
*. CA admin user name and password
*. CA certificates
*. CA node release, resource allocation, configuration parameters
- Run the following command to stand up the CA node::
kubectl apply -f myca.yaml
after few minutes, your CA node should be up running, you can see it status by using the following command:
kubectl describe ca
To delete the CA node, you can simply do the following command, assume you name your CA ca1st
kubectl delete ca ca1st
- Download the example fabric peer spec file
wget https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_peer_cr.yaml?raw=true -O mypeer.yaml
- Make changes to the example peer spec file according to your needs. Here are the list of things that you can change in the example peer spec file.
*. Node name
*. MSP and TLS certs
*. Peer node release, resource allocation, configuration parameters
- Run the following command to stand up the Peer node
kubectl apply -f mypeer.yaml
after few minutes, your Peer node should be up running, you can see it status by using the following command:
kubectl describe peer
To delete the peer node, you can simply do the following command, assume you named your peer peer1st:
kubectl delete peer peer1st
- Download the example fabric orderer spec file
wget https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_orderer_cr.yaml?raw=true -O myorderer.yaml
- Make changes to the example orderer spec file according to your needs. Here are the list of things that you can change in the example orderer spec file.
*. Node name
*. MSP and TLS certs
*. Orderer node release, resource allocation, configuration parameters
- Run the following command to stand up the Peer node::
kubectl apply -f myorderer.yaml
after few minutes, your orderer node should be up running, you can see it status by using the following command:
kubectl describe orderer
To delete the orderer node, you can simply do the following command, assume you name your orderer orderer1st
kubectl delete orderer orderer1st
Fabric Operator from the API / Dashboard
To run the operator using the cello API or dashboard follow the instructions here :- Fabric Operator Agent README
![Creative Commons License](https://i.creativecommons.org/l/by/4.0/88x31.png)
This work is licensed under a Creative Commons Attribution 4.0 International License.