hlf-ca

by Helm

Helm chartv2.1.0App 1.5.1

Hyperledger Fabric Certificate Authority chart (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 CA

Hyperledger Fabric CA is a Certificate Authority node for the Hyperledger Fabric permissioned blockchain framework. Learn more about it by visiting the user's guide.

TL;DR;

$ helm install stable/hlf-ca

Introduction

The Hyperledger Fabric CA can be installed as either a Root CA, or an intermediate CA (by pointing to a parent CA, which can itself be a Root CA or an intermediate).

This CA can then be used to register and enroll identities for clients, admins and nodes of the Hyperledger Fabric network.

Prerequisites

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

Installing the Chart

To install the chart with the release name org1-ca:

$ helm install stable/hlf-ca --name org1-ca

The command deploys the Hyperledger Fabric CA 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-ca --name org1-ca --set adminUsername=ca-admin,adminPassword=secretpassword

The above command creates a CA Admin user named ca-admin 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-ca --name org1-ca -f my-values.yaml

Updating the chart

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

$ export CA_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} org1-ca -o jsonpath="{.data.CA_PASSWORD}" | base64 --decode; echo)
$ helm upgrade org1-ca stable/hlf-ca --set adminPassword=$CA_PASSWORD

Uninstalling the Chart

To uninstall/delete the org1-ca deployment:

$ helm delete org1-ca

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 CA chart and default values.

ParameterDescriptionDefault
image.repositoryhlf-ca image repositoryhyperledger/fabric-ca
image.taghlf-ca image tag1.4.3
image.pullPolicyImage pull policyIfNotPresent
image.initContainer.repositorydockerize image repositoryjwilder/dockerize
image.initContainer.tagdockerize image taglatest
image.initContainer.pullPolicyImage pull policyIfNotPresent
service.annotationsAnnotations for ca service{}
service.portTCP port7054
service.typeK8S service type exposing ports, e.g. ClusterIPClusterIP
ingress.enabledIf true, Ingress will be createdfalse
ingress.annotationsIngress annotations{}
ingress.pathIngress path/
ingress.hostsIngress hostnames[]
ingress.tlsIngress TLS configuration[]
ingress.ingressClassNameIngress class that will be used for the ingressnil
ingress.pathTypeIngress path typeImplementationSpecific
persistence.existingClaimName of an existing PVC to use for Fabric CAnil
persistence.accessModeUse volume as ReadOnly or ReadWriteReadWriteOnce
persistence.annotationsPersistent Volume annotations{}
persistence.sizeSize of data volume1Gi
persistence.storageClassStorage class of backing PVCdefault
adminUsernameAdmin Username for CAadmin
adminPasswordAdmin PasswordRandom 24 alphanumeric characters
caNameName of CAorg1-ca
db.sslSSL Authenticationdisable
externalDatabase.typeDatabase type (either postgres or mysql )nil
externalDatabase.hostHost of the external databaselocalhost
externalDatabase.usernameExisting username in the external db``
externalDatabase.passwordPassword for the above username``
externalDatabase.databaseName of the existing database``
externalDatabase.portDatabase port number``
config.hlfToolsVersionVersion of Hyperledger Fabric tools used1.4.3
config.mountTLSIf TLS secrets are generated, do we mount them?false
config.debugEnable debug loggingtrue
config.csr.ca.pathlengthPathlength of CA certificate hierarchy1
config.csr.names.cCountry to which CA belongsUS
config.csr.names.stState to which CA belongsNorth Carolina
config.csr.names.lLocality to which CA belongs``
config.csr.names.oOrganization to which CA belongsHyperledger
config.csr.names.ouOrganizational Unit to which CA belongsFabric
config.intermediateStructure defining that CA is intermediatenil
config.intermediate.parent.chartWhich hlf-ca chart acts as parent to this CAnil
config.intermediate.parent.urlURL of parent CAnil
config.intermediate.parent.portPort of parent CAnil
config.affiliationsAffiliations for CA{org1: [] }
resourcesCPU/Memory resource requests/limits{}
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
affinityAffinity settings for pod assignment{}

Database

The Fabric CA server needs a database to store the users registered.

By default the chart is configured to use an in-memory sqlite3 database.

External Database

In case you already setup a database (postgres or mysql), you can enable and configure the externalDatabase section in values.yaml or pass the following parameters:`

 helm install stable/hlf-ca --name org1-ca \
   --set externalDatabase.type=mysql \
   --set externalDatabase.host=myhost \
   --set externalDatabase.username=myuser \
   --set externalDatabase.password=mypassword \
   --set externalDatabase.database=mydatabase

Please consult the documentation for mode details.

Persistence

The volume stores the Fabric_CA data and configurations at the /var/hyperledger 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-ca with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has hlf-ca 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-ca 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