Skip to content

Commit f454267

Browse files
Add helm-charts for explorer-db & explorer
Signed-off-by: vineeth2328 <[email protected]>
1 parent cd975ee commit f454267

12 files changed

+540
-0
lines changed

helm-charts/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
## Prerequisites
2+
3+
- Kubernetes 1.9+
4+
- A running Hyperledger Fabric network on kubernetes.
5+
6+
## Installing the Chart
7+
8+
To install the chart with the release name `explorer`:
9+
10+
```bash
11+
$ helm install explorer/ --name explorer
12+
```
13+
14+
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.
15+
16+
## Test the Chart
17+
18+
To test the chart with the release name `explorer`:
19+
20+
```bash
21+
$ helm test explorer
22+
```
23+
24+
The command tests the Blockchain Explorer & Explorer-DB on the Kubernetes cluster.
25+
26+
## Uninstalling the Chart
27+
28+
To uninstall/delete the `explorer` deployment:
29+
30+
```bash
31+
$ helm delete explorer
32+
```
33+
34+
The command removes all the Kubernetes components associated with the chart and deletes the release.
35+
36+
## Configuration
37+
38+
The following table lists the configurable parameters of the Blockchain Explorer & Explorer-DB chart and default values.
39+
40+
| Parameter | Description | Default |
41+
| --------------------------------- | ------------------------------------------------- | ------------------------- |
42+
| `explorer.image.repository` | `explorer` image repository | `hyperledger/explorer` |
43+
| `explorer.image.tag` | `explorer` image tag | `latest` |
44+
| `explorer.username` | `explorer` username | ` ` |
45+
| `explorer.password` | `explorer` password | ` ` |
46+
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
47+
| `db.image.repository` | `explorer-db` image repository | `hyperledger/explorer-db` |
48+
| `db.image.tag` | `explorer-db` image tag | `latest` |
49+
| `db.DATABASE_DATABASE` | `explorer-db` DATABASE_DATABASE name | ` ` |
50+
| `db.DATABASE_USERNAME` | `explorer-db` DATABASE_USERNAME name | ` ` |
51+
| `db.DATABASE_PASSWORD` | `explorer-db` DATABASE_PASSWORD name | ` ` |
52+
| `explorer.service.port` | TCP port for requests to explorer | `8080` |
53+
| `explorer.service.type` | K8S service type exposing ports, e.g. `ClusterIP` | `ClusterIP` |
54+
| `explorer.ingress.enabled` | If true, Ingress will be created | `false` |
55+
| `explorer.ingress.annotations` | Ingress annotations | `{}` |
56+
| `explorer.ingress.path` | Ingress path | `/` |
57+
| `explorer.ingress.hosts` | Ingress hostnames | ` ` |
58+
| `db.service.port` | TCP port for requests to explorer-db | `5432` |
59+
| `db.service.type` | K8S service type exposing ports, e.g. `ClusterIP` | `ClusterIP` |
60+
| `resources` | CPU/Memory resource requests/limits | `{}` |
61+
| `replicaCount` | Replicacount of pods | `1` |
62+
| `network.channel` | HLF network channel name | ` ` |
63+
| `network.mspid` | HLF network peer org mspid | ` ` |
64+
| `network.peername` | HLF network peername | ` ` |
65+
| `network.peerurl` | HLF network peerurl | ` ` |
66+
| `network.adminPrivateKey` | HLF network peer adminPrivateKey | ` ` |
67+
| `network.signedCert` | HLF network peer signedCert | ` ` |
68+
| `network.tlsCACerts` | HLF network peer tlsCACerts | ` ` |

helm-charts/explorer/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

helm-charts/explorer/Chart.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v2
2+
name: blockchain-explorer
3+
description: A Helm chart for blockchain explorer
4+
5+
type: application
6+
7+
version: 0.1.0
8+
9+
appVersion: "1.16.0"
10+
11+
keywords:
12+
- blockchain
13+
- hyperledger
14+
- explorer
15+
- explorer-db
16+
17+
sources:
18+
- https://github.com/hyperledger-labs/blockchain-explorer
19+
20+
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: explorer-config
5+
namespace: {{ $.Values.namespace }}
6+
labels:
7+
name: {{ $.Values.db.name }}
8+
app.kubernetes.io/name: {{ $.Values.db.name }}
9+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
10+
app.kubernetes.io/managed-by: {{ .Release.Service }}
11+
app.kubernetes.io/instance: {{ .Release.Name }}
12+
annotations:
13+
{{- toYaml .Values.annotations | nindent 6 }}
14+
data:
15+
16+
test-network.json: |-
17+
{
18+
"name": "basic-network",
19+
"version": "1.0.0",
20+
"client": {
21+
"tlsEnable": true,
22+
"adminCredential": {
23+
"id": "{{ .Values.explorer.username }}",
24+
"password": "{{ .Values.explorer.password }}"
25+
},
26+
"enableAuthentication": true,
27+
"organization": "{{ .Values.network.mspid}}",
28+
"connection": {
29+
"timeout": {
30+
"peer": {
31+
"endorser": "300"
32+
},
33+
"orderer": "300"
34+
}
35+
}
36+
},
37+
"channels": {
38+
"{{ .Values.network.channel}}": {
39+
"peers": {
40+
"{{ .Values.network.peername}}": {}
41+
},
42+
"connection": {
43+
"timeout": {
44+
"peer": {
45+
"endorser": "6000",
46+
"eventHub": "6000",
47+
"eventReg": "6000"
48+
}
49+
}
50+
}
51+
}
52+
},
53+
"organizations": {
54+
"{{ .Values.network.mspid}}": {
55+
"mspid": "{{ .Values.network.mspid}}",
56+
"adminPrivateKey": {
57+
"pem": "{{ .Values.network.adminPrivateKey}}"
58+
59+
},
60+
"peers": [
61+
"{{ .Values.network.peername}}"
62+
],
63+
"signedCert": {
64+
"pem": "{{ .Values.network.signedCert}}"
65+
}
66+
}
67+
},
68+
"peers": {
69+
"{{ .Values.network.peername}}": {
70+
"tlsCACerts": {
71+
"pem": "{{ .Values.network.tlsCACerts}}"
72+
},
73+
"url": "{{ .Values.network.peerurl}}"
74+
}
75+
}
76+
}
77+
78+
config.json: |-
79+
{
80+
"network-configs": {
81+
"basic-network": {
82+
"name": "basic-network",
83+
"profile": "./test-network.json"
84+
}
85+
},
86+
"license": "Apache-2.0"
87+
}
88+
89+
90+
---
91+
92+
apiVersion: v1
93+
kind: ConfigMap
94+
metadata:
95+
name: explorer-env
96+
namespace: {{ $.Values.namespace }}
97+
labels:
98+
name: {{ $.Values.db.name }}
99+
app.kubernetes.io/name: {{ $.Values.db.name }}
100+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
101+
app.kubernetes.io/managed-by: {{ .Release.Service }}
102+
app.kubernetes.io/instance: {{ .Release.Name }}
103+
annotations:
104+
{{- toYaml .Values.annotations | nindent 6 }}
105+
data:
106+
DATABASE_HOST: {{ .Values.db.name }}
107+
DATABASE_DATABASE: {{ $.Values.db.DATABASE_DATABASE }}
108+
DATABASE_USERNAME: {{ $.Values.db.DATABASE_USERNAME }}
109+
DATABASE_PASSWD: {{ $.Values.db.DATABASE_PASSWORD }}
110+
LOG_LEVEL_APP: {{ $.Values.explorer.logging.LOG_LEVEL_APP }}
111+
LOG_LEVEL_DB: {{ $.Values.explorer.logging.LOG_LEVEL_DB }}
112+
LOG_CONSOLE_STDOUT: "{{ $.Values.explorer.logging.LOG_CONSOLE_STDOUT }}"
113+
DISCOVERY_AS_LOCALHOST: "{{ $.Values.explorer.logging.DISCOVERY_AS_LOCALHOST }}"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: {{ .Values.db.name }}
5+
namespace: {{ $.Values.namespace }}
6+
labels:
7+
name: {{ $.Values.db.name }}
8+
app.kubernetes.io/name: {{ $.Values.db.name }}
9+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
10+
app.kubernetes.io/managed-by: {{ .Release.Service }}
11+
app.kubernetes.io/instance: {{ .Release.Name }}
12+
annotations:
13+
{{- toYaml .Values.annotations | nindent 6 }}
14+
spec:
15+
serviceName: {{ .Values.db.name }}
16+
replicas: {{ .Values.replicaCount }}
17+
selector:
18+
matchLabels:
19+
app: {{ $.Values.db.name }}
20+
app.kubernetes.io/name: {{ $.Values.db.name }}
21+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
22+
app.kubernetes.io/instance: {{ .Release.Name }}
23+
template:
24+
metadata:
25+
labels:
26+
app: {{ $.Values.db.name }}
27+
app.kubernetes.io/name: {{ $.Values.db.name }}
28+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
29+
app.kubernetes.io/instance: {{ .Release.Name }}
30+
spec:
31+
containers:
32+
- name: {{ .Chart.Name }}
33+
image: "{{ .Values.db.image.repository }}:{{ .Values.db.image.tag }}"
34+
imagePullPolicy: {{ .Values.pullPolicy }}
35+
envFrom:
36+
- configMapRef:
37+
name: explorer-db-env
38+
resources:
39+
{{- toYaml .Values.resources | nindent 12 }}
40+
41+
ports:
42+
- containerPort: {{ .Values.db.service.port }}
43+
44+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ .Values.db.name }}
5+
namespace: {{ $.Values.namespace }}
6+
labels:
7+
name: {{ $.Values.db.name }}
8+
app.kubernetes.io/name: {{ $.Values.db.name }}
9+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
10+
app.kubernetes.io/managed-by: {{ .Release.Service }}
11+
app.kubernetes.io/instance: {{ .Release.Name }}
12+
annotations:
13+
{{- toYaml .Values.annotations | nindent 6 }}
14+
spec:
15+
type: {{ .Values.db.service.type }}
16+
selector:
17+
app: {{ .Values.db.name }}
18+
ports:
19+
- port: {{ .Values.db.service.port }}
20+
targetPort: {{ .Values.db.service.port }}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ .Values.explorer.name }}
5+
namespace: {{ $.Values.namespace }}
6+
labels:
7+
name: {{ $.Values.explorer.name }}
8+
app.kubernetes.io/name: {{ $.Values.explorer.name }}
9+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
10+
app.kubernetes.io/managed-by: {{ .Release.Service }}
11+
app.kubernetes.io/instance: {{ .Release.Name }}
12+
annotations:
13+
{{- toYaml .Values.annotations | nindent 6 }}
14+
15+
spec:
16+
replicas: {{ .Values.replicaCount }}
17+
selector:
18+
matchLabels:
19+
app: {{ $.Values.explorer.name }}
20+
app.kubernetes.io/name: {{ $.Values.explorer.name }}
21+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
22+
app.kubernetes.io/instance: {{ .Release.Name }}
23+
template:
24+
metadata:
25+
labels:
26+
app: {{ $.Values.explorer.name }}
27+
app.kubernetes.io/name: {{ $.Values.explorer.name }}
28+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
29+
app.kubernetes.io/instance: {{ .Release.Name }}
30+
spec:
31+
volumes:
32+
- name: explorer-config
33+
configMap:
34+
name: explorer-config
35+
items:
36+
- key: config.json
37+
path: config.json
38+
- key: test-network.json
39+
path: test-network.json
40+
41+
containers:
42+
- name: {{ .Values.explorer.name }}
43+
image: "{{ .Values.explorer.image.repository }}:{{ .Values.explorer.image.tag }}"
44+
imagePullPolicy: {{ .Values.pullPolicy }}
45+
envFrom:
46+
- configMapRef:
47+
name: explorer-env
48+
resources:
49+
{{- toYaml .Values.resources | nindent 12 }}
50+
51+
ports:
52+
- containerPort: {{ .Values.explorer.service.port }}
53+
54+
volumeMounts:
55+
- mountPath: /opt/explorer/app/platform/fabric/config.json
56+
name: explorer-config
57+
subPath: config.json
58+
- mountPath: /opt/explorer/app/platform/fabric/test-network.json
59+
name: explorer-config
60+
subPath: test-network.json

0 commit comments

Comments
 (0)