Skip to content

Commit

Permalink
Merge pull request #2321 from saurabhkumarkardam/fabric-2283
Browse files Browse the repository at this point in the history
[ci-skip] add README.md files for each Helm chart
  • Loading branch information
sownak authored Aug 2, 2023
2 parents f0445a4 + 089a8c4 commit 70793db
Show file tree
Hide file tree
Showing 65 changed files with 4,815 additions and 420 deletions.
4 changes: 2 additions & 2 deletions platforms/hyperledger-fabric/charts/anchorpeer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

apiVersion: v1
appVersion: "2.0"
description: A Helm chart for updating the anchorpeer details
description: "Hyperledger Fabric: Updates the anchorpeer details."
name: anchorpeer
version: '0.14.0'
version: '0.14.1'
198 changes: 198 additions & 0 deletions platforms/hyperledger-fabric/charts/anchorpeer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
[//]: # (##############################################################################################)
[//]: # (Copyright Accenture. All Rights Reserved.)
[//]: # (SPDX-License-Identifier: Apache-2.0)
[//]: # (##############################################################################################)

<a name = "anchor-peer-hyperledger-fabric-deployment"></a>
# Anchor Peer Hyperledger Fabric Deployment

- [Anchor Peer Hyperledger Fabric Deployment Helm Chart](#anchor-peer-hyperledger-fabric-deployment-helm-chart)
- [Prerequisites](#prerequisites)
- [Chart Structure](#chart-structure)
- [Configuration](#configuration)
- [Deployment](#deployment)
- [Verification](#verification)
- [Updating the Deployment](#updating-the-deployment)
- [Deletion](#deletion)
- [Contributing](#contributing)
- [License](#license)


<a name = "anchor-peer-hyperledger-fabric-deployment-helm-chart"></a>
## Anchor Peer Hyperledger Fabric Deployment Helm Chart
---
This [Helm chart](https://github.com/hyperledger/bevel/blob/develop/platforms/hyperledger-fabric/charts/anchorpeer) updates the anchor peers for the Hyperledger Fabric channel.


<a name = "prerequisites"></a>
## Prerequisites
---
Before deploying the Helm chart, make sure to have the following prerequisites:

- Kubernetes cluster up and running.
- A HashiCorp Vault instance is set up and configured to use Kubernetes service account token-based authentication.
- The Vault is unsealed and initialized.
- Helm installed.


<a name = "chart-structure"></a>
## Chart Structure
---
The structure of the Helm chart is as follows:

```
anchorpeer/
|- templates/
|- _helpers.yaml
|- anchorpeer.yaml
|- configmap.yaml
|- Chart.yaml
|- README.md
|- values.yaml
```

- `templates/`: Contains the Kubernetes manifest templates that define the resources to be deployed.
- `helpers.tpl`: Contains custom label definitions used in other templates.
- `anchorpeer.yaml`: Uses two initContainers to fetch the orderer TLS certificates and the MSP certificates from Vault. The main container then uses the fetched certificates to update the anchor peer for the channel.
- `configmap.yaml`: Stores configuration data for an anchor peer. The file contains two ConfigMaps, one for the configuration data and one for the artifacts. The configuration ConfigMap contains the key-value pairs that are used to configure the peer, and the artifacts ConfigMap contains the base64-encoded transaction that anchors the peer to the channel.
- `Chart.yaml`: Contains the metadata for the Helm chart, such as the name, version, and description.
- `README.md`: Provides information and instructions about the Helm chart.
- `values.yaml`: Contains the default configuration values for the Helm chart.


<a name = "configuration"></a>
## Configuration
---
The [values.yaml](https://github.com/hyperledger/bevel/blob/develop/platforms/hyperledger-fabric/charts/anchorpeer/values.yaml) file contains configurable values for the Helm chart. We can modify these values according to the deployment requirements. Here are some important configuration options:

## Parameters
---

### Metadata

| Name | Description | Default Value |
| ----------------------| ----------------------------------------------------------------------------------| --------------------------------------------------|
| namespace | Provide the namespace for organization's peer | org1-example-com |
| images.fabrictools | Provide the valid image name and version | hyperledger/fabric-tools:2.2.2 |
| images.alpineutils | Provide the valid image name and version to read certificates from vault server | index.docker.io/hyperledgerlabs/alpine-utils:1.0 |
| labels | Provide the custom labels | anchorpeer |

### Peer

| Name | Description | Default Value |
| --------------| --------------------------------------------------------------------------------------------------------| ------------------------------|
| name | Provide the name of the peer as per deployment yaml | peer0 |
| address | Provide the address of the peer which will update the channel about the anchor peer of the organization | peer0.org1-example-com:7051 |
| localmspid | Provide the localmspid for organization | org1MSP |
| loglevel | Provide the loglevel for organization's peer | debug |
| tlsstatus | Provide the value for tlsstatus to be true or false for organization's peer | true |

### Vault

| Name | Description | Default Value |
| ---------------------| ----------------------------------------------------------------------------| -----------------------------|
| role | Provide the vaultrole for an organization | vault-role |
| address | Provide the vault server address | "" |
| authpath | Provide the kubernetes auth backed configured in vault for an organization | fra-demo-hlkube-cluster-org1 |
| adminsecretprefix | PProvide the value for vault secretprefix | secret/ |
| orderersecretprefix | Provide the value for vault secretprefix | secret/ |
| serviceaccountname | Provide the serviceaccount name for vault | vault-auth |
| imagesecretname | Provide the imagesecretname for vault | "" |
| tls | Enable or disable TLS for vault communication | vaultca |

### Channel

| Name | Description | Default Value |
| ----------| -------------------------------------|---------------|
| name | Provide the name of the channel | mychannel |

### orderer

| Name | Description | Default Value |
| -----------| -----------------------------------|----------------------------|
| address | Provide the address for orderer | orderer.fratest-com:7050 |

### anchorstx

| Name | Description | Default Value |
| ---------------| ---------------------------------------------------------| ------------- |
| anchorstx | Provide the base64 encoded file contents for anchorstx | "" |


<a name = "deployment"></a>
## Deployment
---

To deploy the anchorpeer Helm chart, follow these steps:

1. Modify the [values.yaml](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/charts/anchorpeer/values.yaml) file to set the desired configuration values.
2. Run the following Helm command to install the chart:
```
$ helm repo add bevel https://hyperledger.github.io/bevel/
$ helm install <release-name> ./anchorpeer
```
Replace `<release-name>` with the desired name for the release.

This will deploy the anchorpeer job to the Kubernetes cluster based on the provided configurations.


<a name = "verification"></a>
## Verification
---

To verify the deployment, we can use the following command:
```
$ kubectl get jobs -n <namespace>
```
Replace `<namespace>` with the actual namespace where the Job was created. This command will display information about the Job, including the number of completions and the current status of the Job's pods.


<a name = "updating-the-deployment"></a>
## Updating the Deployment
---

If we need to update the deployment with new configurations or changes, modify the same [values.yaml](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/charts/anchorpeer/values.yaml) file with the desired changes and run the following Helm command:
```
$ helm upgrade <release-name> ./anchorpeer
```
Replace `<release-name>` with the name of the release. This command will apply the changes to the deployment, ensuring the anchorpeer node is up to date.

<a name = "deletion"></a>
## Deletion
---

To delete the deployment and associated resources, run the following Helm command:
```
$ helm uninstall <release-name>
```
Replace `<release-name>` with the name of the release. This command will remove all the resources created by the Helm chart.

<a name = "contributing"></a>
## Contributing
---
If you encounter any bugs, have suggestions, or would like to contribute to the [Anchor Peer Hyperledger Fabric Deployment Helm Chart](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/charts/anchorpeer), please feel free to open an issue or submit a pull request on the [project's GitHub repository](https://github.com/hyperledger/bevel).

<a name = "license"></a>
## License

This chart is licensed under the Apache v2.0 license.

Copyright &copy; 2023 Accenture

### Attribution

This chart is adapted from the [charts](https://hyperledger.github.io/bevel/) which is licensed under the Apache v2.0 License which is reproduced here:

```
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
38 changes: 19 additions & 19 deletions platforms/hyperledger-fabric/charts/anchorpeer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,74 +7,74 @@
metadata:
#Provide the namespace for organization's peer
#Eg. namespace: org1-example-com
namespace: default
namespace: org1-example-com
images:
#Provide the valid image name and version for fabric tools
#Eg. fabric-tools: hyperledger/fabrictools:1.4.0
fabrictools:
fabrictools: hyperledger/fabric-tools:2.2.2
#Provide the valid image name and version to read certificates from vault server
#Eg.alpineutils: hyperledgerlabs/alpine-utils:1.0
alpineutils:
alpineutils: index.docker.io/hyperledgerlabs/alpine-utils:1.0
#Provide the custom labels
#NOTE: Provide labels other than name, release name , release service, chart version , chart name , app.
#Eg. labels:
# role: anchorpeer
labels:
labels: anchorpeer

peer:
#Provide the name of the peer as per deployment yaml.
#Eg. name: peer0
name:
name: peer0
#Provide the address of the peer which will update the channel about the anchor peer of the organization
#Eg. address: peer0.org1-example-com:7051
address:
address: peer0.org1-example-com:7051
#Provide the localmspid for organization
#Eg. localmspid: Org1MSP
localmspid:
localmspid: org1MSP
#Provide the loglevel for organization's peer
#Eg. loglevel: info
loglevel:
loglevel: debug
#Provide the value for tlsstatus to be true or false for organization's peer
#Eg. tlsstatus: true
tlsstatus:
tlsstatus: true

vault:
#Provide the vaultrole for an organization
#Eg. vaultrole: org1-vault-role
role:
role: vault-role
#Provide the vault server address
#Eg. vaultaddress: http://Vault-884963190.eu-west-1.elb.amazonaws.com
address:
#Provide the kubernetes auth backed configured in vault for an organization
#Eg. authpath: fra-demo-hlkube-cluster-org1
authpath:
authpath: fra-demo-hlkube-cluster-org1
#Provide the value for vault secretprefix
#Eg. adminsecretprefix: secret/...
adminsecretprefix:
adminsecretprefix: secret/adminsecretprefix/
#Provide the value for vault secretprefix
#Eg. orderersecretprefix: secret/...
orderersecretprefix:
#Provide the serviceaccountname for vault
orderersecretprefix: secret/orderersecretprefix/
#Provide the serviceaccount name for vault
#Eg. serviceaccountname: vault-auth
serviceaccountname:
serviceaccountname: vault-auth
#Provide the imagesecretname for vault
#Eg. imagesecretname: regcred
imagesecretname:
imagesecretname: ""
#Kuberenetes secret for vault ca.cert
#Enable or disable TLS for vault communication if value present or not
#Eg. tls: vaultca
tls:
tls: vaultca


channel:
#Provide the name of the channel
#Eg. name: mychannel
name:
name: mychannel

orderer:
#Provide the address for orderer
#Eg. address: orderer.fratest-com:7050
address:
address: orderer.fratest-com:7050

#Provide the base64 encoded file contents for anchorstx
anchorstx:
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

apiVersion: v1
appVersion: "2.0"
description: A Helm chart for chaincode instantiation on a peer
description: "Hyperledger Fabric: Approves the chaincode."
name: approve_chaincode
version: '0.14.1'
Loading

0 comments on commit 70793db

Please sign in to comment.