-
Notifications
You must be signed in to change notification settings - Fork 956
Add helm-charts for explorer-db & explorer #353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vineethboppudi
wants to merge
6
commits into
hyperledger-labs:main
Choose a base branch
from
vineethboppudi:helm-charts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+673
−0
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4998ea4
Add helm-charts for explorer-db & explorer
vineethboppudi 711f89e
Upddated explorer helm-chart
vineethboppudi a3b88eb
updated explorer- configmap
vineethboppudi 83276f3
Merge branch 'hyperledger-labs:main' into helm-charts
vineethboppudi 20d92d9
added pvc for explorer-db
adityajoshi12 2d6e176
modified configmap into secret in helmchart
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| ## Prerequisites | ||
|
|
||
| - Kubernetes 1.9+ | ||
| - A running Hyperledger Fabric network on kubernetes. | ||
|
|
||
| ## Installing the Chart | ||
|
|
||
| To install the chart with the release name `explorer`: | ||
|
|
||
| ```bash | ||
| $ helm install explorer/ --name explorer | ||
| ``` | ||
|
|
||
| The command deploys the Blockchain Explorer & Explorer-DB on the Kubernetes cluster in the default configuration. The [Configuration](#configuration) section lists the parameters that can be configured during installation. | ||
|
|
||
| ## Test the Chart | ||
|
|
||
| To test the chart with the release name `explorer`: | ||
|
|
||
| ```bash | ||
| $ helm test explorer | ||
| ``` | ||
|
|
||
| The command tests the Blockchain Explorer & Explorer-DB on the Kubernetes cluster. | ||
|
|
||
| ## Uninstalling the Chart | ||
|
|
||
| To uninstall/delete the `explorer` deployment: | ||
|
|
||
| ```bash | ||
| $ helm delete explorer | ||
| ``` | ||
|
|
||
| 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 Blockchain Explorer & Explorer-DB chart and default values. | ||
|
|
||
| | Parameter | Description | Default | | ||
| | --------------------------------- | ------------------------------------------------- | ------------------------- | | ||
| | `explorer.image.repository` | `explorer` image repository | `hyperledger/explorer` | | ||
| | `explorer.image.tag` | `explorer` image tag | `latest` | | ||
| | `explorer.username` | `explorer` username | ` ` | | ||
| | `explorer.password` | `explorer` password | ` ` | | ||
| | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | ||
| | `db.image.repository` | `explorer-db` image repository | `hyperledger/explorer-db` | | ||
| | `db.image.tag` | `explorer-db` image tag | `latest` | | ||
| | `db.DATABASE_DATABASE` | `explorer-db` DATABASE_DATABASE name | ` ` | | ||
| | `db.DATABASE_USERNAME` | `explorer-db` DATABASE_USERNAME name | ` ` | | ||
| | `db.DATABASE_PASSWORD` | `explorer-db` DATABASE_PASSWORD name | ` ` | | ||
| | `explorer.service.port` | TCP port for requests to explorer | `8080` | | ||
| | `explorer.service.type` | K8S service type exposing ports, e.g. `ClusterIP` | `ClusterIP` | | ||
| | `explorer.ingress.enabled` | If true, Ingress will be created | `false` | | ||
| | `explorer.ingress.annotations` | Ingress annotations | `{}` | | ||
| | `explorer.ingress.path` | Ingress path | `/` | | ||
| | `explorer.ingress.hosts` | Ingress hostnames | ` ` | | ||
| | `db.service.port` | TCP port for requests to explorer-db | `5432` | | ||
| | `db.service.type` | K8S service type exposing ports, e.g. `ClusterIP` | `ClusterIP` | | ||
| | `resources` | CPU/Memory resource requests/limits | `{}` | | ||
| | `replicaCount` | Replicacount of pods | `1` | | ||
| | `network.channel` | HLF network channel name | ` ` | | ||
| | `network.mspid` | HLF network peer org mspid | ` ` | | ||
| | `network.peername` | HLF network peername | ` ` | | ||
| | `network.peerurl` | HLF network peerurl | ` ` | | ||
| | `network.adminPrivateKey` | HLF network peer adminPrivateKey | ` ` | | ||
| | `network.signedCert` | HLF network peer signedCert | ` ` | | ||
| | `network.tlsCACerts` | HLF network peer tlsCACerts | ` ` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| apiVersion: v2 | ||
| name: blockchain-explorer | ||
| description: A Helm chart for blockchain explorer | ||
|
|
||
| type: application | ||
|
|
||
| version: 0.1.0 | ||
|
|
||
| appVersion: "1.16.0" | ||
|
|
||
| keywords: | ||
| - blockchain | ||
| - hyperledger | ||
| - explorer | ||
| - explorer-db | ||
|
|
||
| sources: | ||
| - https://github.com/hyperledger-labs/blockchain-explorer | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: explorer-config | ||
| namespace: {{ $.Values.namespace }} | ||
| labels: | ||
| name: {{ .Release.Name }}-app | ||
| app.kubernetes.io/name: {{ .Release.Name }}-app | ||
| helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| annotations: | ||
| {{- toYaml .Values.annotations | nindent 6 }} | ||
| data: | ||
|
|
||
| fabric-network.json: |- | ||
| { | ||
| "name": "fabric-network", | ||
| "version": "1.0.0", | ||
| "client": { | ||
| "tlsEnable": true, | ||
| "adminCredential": { | ||
| "id": "{{ .Values.explorer.username | default "exploreradmin"}}", | ||
| "password": "{{ .Values.explorer.password | default "exploreradminpw"}}" | ||
| }, | ||
| "enableAuthentication": true, | ||
| "organization": "{{ .Values.network.mspid}}", | ||
| "connection": { | ||
| "timeout": { | ||
| "peer": { | ||
| "endorser": "300" | ||
| }, | ||
| "orderer": "300" | ||
| } | ||
| } | ||
| }, | ||
| "channels": { | ||
| "{{ .Values.network.channel}}": { | ||
| "peers": { | ||
| "{{ .Values.network.peername}}": {} | ||
| }, | ||
| "connection": { | ||
| "timeout": { | ||
| "peer": { | ||
| "endorser": "6000", | ||
| "eventHub": "6000", | ||
| "eventReg": "6000" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "organizations": { | ||
| "{{ .Values.network.mspid}}": { | ||
| "mspid": "{{ .Values.network.mspid}}", | ||
| "adminPrivateKey": { | ||
| "path": "/etc/adminprivatekey/adminPrivateKey.pem" | ||
|
|
||
| }, | ||
| "peers": [ | ||
| "{{ .Values.network.peername}}" | ||
| ], | ||
| "signedCert": { | ||
| "path": "/etc/signedcert/signedCert.pem" | ||
| } | ||
| } | ||
| }, | ||
| "peers": { | ||
| "{{ .Values.network.peername}}": { | ||
| "tlsCACerts": { | ||
| "path": "/etc/tlscacerts/tlsCACerts.pem" | ||
| }, | ||
| "url": "{{ .Values.network.peerurl}}" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| config.json: |- | ||
| { | ||
| "network-configs": { | ||
| "fabric-network": { | ||
| "name": "fabric-network", | ||
| "profile": "./fabric-network.json" | ||
| } | ||
| }, | ||
| "license": "Apache-2.0" | ||
| } | ||
56 changes: 56 additions & 0 deletions
56
helm-charts/explorer/templates/explorer-db-deployment.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: {{ .Release.Name }}-db | ||
| namespace: {{ $.Values.namespace }} | ||
| labels: | ||
| name: {{ .Release.Name }}-db | ||
| app.kubernetes.io/name: {{ .Release.Name }}-db | ||
| helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| annotations: | ||
| {{- toYaml .Values.annotations | nindent 6 }} | ||
| spec: | ||
| serviceName: {{ .Release.Name }}-db | ||
| replicas: {{ .Values.replicaCount }} | ||
| selector: | ||
| matchLabels: | ||
| app: {{ .Release.Name }}-db | ||
| app.kubernetes.io/name: {{ .Release.Name }}-db | ||
| helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: {{ .Release.Name }}-db | ||
| app.kubernetes.io/name: {{ .Release.Name }}-db | ||
| helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| spec: | ||
| containers: | ||
| - name: {{ .Chart.Name }} | ||
| image: "{{ .Values.db.image.repository }}:{{ .Values.db.image.tag }}" | ||
| imagePullPolicy: {{ .Values.pullPolicy }} | ||
| envFrom: | ||
| - secretRef: | ||
| name: explorer-db-env | ||
| resources: | ||
| {{- toYaml .Values.resources | nindent 12 }} | ||
|
|
||
| ports: | ||
| - containerPort: {{ .Values.db.service.port | default 5432 }} | ||
| volumeMounts: | ||
| - name: {{ .Release.Name }}-db | ||
| mountPath: /var/lib/postgresql/data | ||
|
|
||
| volumeClaimTemplates: | ||
| - metadata: | ||
| name: {{ .Release.Name }}-db | ||
| spec: | ||
| storageClassName: {{ .Values.db.storage.class | default "standard" | quote }} | ||
| accessModes: [ "ReadWriteOnce" ] | ||
| resources: | ||
| requests: | ||
| storage: {{ .Values.db.storage.capacity | default "5Gi" }} | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ .Release.Name }}-db | ||
| namespace: {{ $.Values.namespace }} | ||
| labels: | ||
| name: {{ .Release.Name }}-db | ||
| app.kubernetes.io/name: {{ .Release.Name }}-db | ||
| helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| annotations: | ||
| {{- toYaml .Values.annotations | nindent 6 }} | ||
| spec: | ||
| type: {{ .Values.db.service.type }} | ||
| selector: | ||
| app: {{ .Release.Name }}-db | ||
| ports: | ||
| - port: {{ .Values.db.service.port | default 5432 }} | ||
| targetPort: {{ .Values.db.service.port | default 5432 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ .Release.Name }}-app | ||
| namespace: {{ $.Values.namespace }} | ||
| labels: | ||
| name: {{ .Release.Name }}-app | ||
| app.kubernetes.io/name: {{ .Release.Name }}-app | ||
| helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| annotations: | ||
| {{- toYaml .Values.annotations | nindent 6 }} | ||
|
|
||
| spec: | ||
| replicas: {{ .Values.replicaCount }} | ||
| selector: | ||
| matchLabels: | ||
| app: {{ .Release.Name }}-app | ||
| app.kubernetes.io/name: {{ .Release.Name }}-app | ||
| helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: {{ .Release.Name }}-app | ||
| app.kubernetes.io/name: {{ .Release.Name }}-app | ||
| helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| spec: | ||
| volumes: | ||
| - name: explorer-config | ||
| configMap: | ||
| name: explorer-config | ||
| items: | ||
| - key: config.json | ||
| path: config.json | ||
| - key: fabric-network.json | ||
| path: fabric-network.json | ||
| - name: config-adminprivatekey | ||
| secret: | ||
| secretName: adminprivatekey | ||
| - name: config-signedcert | ||
| secret: | ||
| secretName: signedcert | ||
| - name: config-tlscacerts | ||
| secret: | ||
| secretName: tlscacerts | ||
|
|
||
| containers: | ||
| - name: {{ .Release.Name }}-app | ||
| image: "{{ .Values.explorer.image.repository }}:{{ .Values.explorer.image.tag }}" | ||
| imagePullPolicy: {{ .Values.pullPolicy }} | ||
| envFrom: | ||
| - secretRef: | ||
| name: explorer-env | ||
| resources: | ||
| {{- toYaml .Values.resources | nindent 12 }} | ||
|
|
||
| ports: | ||
| - containerPort: {{ .Values.explorer.service.port | default (8080) }} | ||
|
|
||
| volumeMounts: | ||
| - mountPath: /opt/explorer/app/platform/fabric/config.json | ||
| name: explorer-config | ||
| subPath: config.json | ||
| - mountPath: /opt/explorer/app/platform/fabric/fabric-network.json | ||
| name: explorer-config | ||
| subPath: fabric-network.json | ||
| - name: config-adminprivatekey | ||
| mountPath: /etc/adminprivatekey | ||
| - name: config-signedcert | ||
| mountPath: /etc/signedcert | ||
| - name: config-tlscacerts | ||
| mountPath: /etc/tlscacerts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
|
|
||
| {{- if .Values.explorer.ingress.enabled -}} | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: {{ .Release.Name }}-app-ingress | ||
| namespace: {{ $.Values.namespace }} | ||
| labels: | ||
| name: {{ .Release.Name }}-app | ||
| app.kubernetes.io/name: {{ .Release.Name }}-app | ||
| helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| annotations: {{- toYaml .Values.explorer.ingress.annotations | nindent 6 }} | ||
|
|
||
| spec: | ||
|
|
||
| rules: | ||
| - host: {{ .Values.explorer.ingress.hosts }} | ||
| http: | ||
| paths: | ||
| - backend: | ||
| service: | ||
| name: {{ .Release.Name }}-app | ||
| port: | ||
| number: {{ .Values.explorer.service.port | default 8080 }} | ||
| path: {{ .Values.explorer.ingress.path | default ("/")}} | ||
| pathType: Prefix | ||
| {{- end }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something to improve upon later: One instance of Explorer can be used for multiple organizations. There can be a different user login session seeing altogether a different network configuration. This section shall be more flexible to handle that.