hlf-couchdb

by Helm

Helm chartv2.1.0App 3.1.1

CouchDB instance for Hyperledger Fabric (these charts are forked from the one by AID:Tech and are currently not directly associated with them or Hyperledger project)

About this chart

Hyperledger Fabric CouchDB

Hyperledger Fabric CouchDB is the node holding the blockchain ledger of each peers for the Hyperledger Fabric permissioned blockchain framework.

TL;DR;

$ helm install stable/hlf-couchdb

Introduction

Hyperledger Fabric Peers can make use of CouchDB instances to permit rich query operations on ledger data. This chart utilises a modified version of CouchDB suitable for Hyperledger Fabric applications.

Prerequisites

  • Kubernetes 1.9+
  • PV provisioner support in the underlying infrastructure.

Installing the Chart

To install the chart with the release name cdb1:

$ helm install stable/hlf-couchdb --name cdb1

The command deploys the Hyperledger Fabric implementation of CouchDB on the Kubernetes cluster in the default configuration. The Configuration section lists the parameters that can be configured during installation.

Custom parameters

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example:

$ helm install stable/hlf-couchdb --name cdb1 --set couchdbUsername=couchdb,couchdbPassword=secretpassword

The above command creates a CouchDB user named couchdb with password secretpassword.

Alternatively, a YAML file can be provided while installing the chart. This file specifies values to override those provided in the default values.yaml. For example,

$ helm install stable/hlf-couchdb --name cdb1 -f my-values.yaml

Updating the chart

When updating the chart, make sure you provide the couchdbPassword, otherwise helm update will generate a new random (and invalid) password.

$ export COUCHDB_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} cdb1 -o jsonpath="{.data.COUCHDB_PASSWORD}" | base64 --decode; echo)
$ helm upgrade cdb1 stable/hlf-couchdb --set couchdbPassword=$COUCHDB_PASSWORD

Uninstalling the Chart

To uninstall/delete the cdb1 deployment:

$ helm delete cdb1

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Hyperledger Fabric CouchDB chart and default values.

ParameterDescriptionDefault
image.repositoryhlf-couchdb image repositoryhyperledger/fabric-couchdb
image.taghlf-couchdb image tagx86_64-0.4.7
image.pullPolicyImage pull policyIfNotPresent
service.annotationsAnnotations for couchdb service{}
service.portTCP port5984
service.typeK8S service type exposing ports, e.g. ClusterIPClusterIP
persistence.accessModeUse volume as ReadOnly or ReadWriteReadWriteOnce
persistence.annotationsPersistent Volume annotations{}
persistence.sizeSize of data volume (adjust for production!)1Gi
persistence.storageClassStorage class of backing PVCdefault
couchdbUsernameUsername for CouchDBcouchdb
couchdbPasswordPassword for CouchDBRandom 24 alphanumeric characters
resourcesCPU/Memory resource requests/limits{}
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
affinityAffinity settings for pod assignment{}
ingress.enabledIf true, Ingress will be createdfalse
ingress.ingressClassNameIngress class that will be used for the ingressnil
ingress.pathTypeIngress path typeImplementationSpecific

Persistence

The volume stores the Fabric CouchDB data and configurations at the /opt/couchdb/data path of the container.

The chart mounts a Persistent Volume at this location. The volume is created using dynamic volume provisioning through a PersistentVolumeClaim managed by the chart.

Feedback and feature requests

This is a work in progress and we are happy to accept feature requests. We are even happier to accept pull requests implementing improvements :-)

Deploy hlf-couchdb with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has hlf-couchdb on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charthlf-couchdb is pinned at v2.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply