-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alfredo Gutierrez <[email protected]>
- Loading branch information
1 parent
01a0e00
commit 9a2e8f9
Showing
22 changed files
with
348 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 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,19 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
apiVersion: v2 | ||
appVersion: 0.3.0-SNAPSHOT | ||
description: A Helm chart for Hedera Blockstream Simulator. | ||
home: https://github.com/hashgraph/hedera-block-node | ||
keywords: | ||
- blocknode | ||
- dlt | ||
- hedera | ||
- hashgraph | ||
- blockstream | ||
- simulator | ||
maintainers: | ||
- name: Hedera Block Node Team | ||
email: [email protected] | ||
name: blockstream-simulator-chart | ||
sources: | ||
- https://github.com/hashgraph/hedera-block-node | ||
version: 0.3.0-SNAPSHOT |
This file contains 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,62 @@ | ||
# BlockStream Simulator Helm Chart | ||
|
||
Installs the BlockStream Simulator on a Kubernetes cluster. | ||
|
||
## Prerequisites | ||
|
||
- Helm 3+ | ||
- Kubernetes 1.29+ | ||
|
||
Set Release name and version to install. | ||
|
||
```bash | ||
export RELEASE="blockStreamSimulator" | ||
export VERSION="0.3.0-SNAPSHOT" | ||
``` | ||
|
||
## Template | ||
|
||
To generate the K8 manifest files without installing the chart, you need to clone this repo and navigate to `/charts` folder. | ||
|
||
```bash | ||
helm template --name-template my-bs blockstream-simulator/ --dry-run --output-dir out | ||
``` | ||
|
||
## Install using a published chart | ||
|
||
To pull the packaged chart from the public repo: | ||
|
||
```bash | ||
helm pull oci://ghcr.io/hashgraph/hedera-block-node/charts/blockstream-simulator-chart--version "${VERSION}" | ||
``` | ||
|
||
## Install using a local chart cloned from the repo | ||
|
||
```bash | ||
git clone [email protected]:hashgraph/hedera-block-node.git | ||
cd hedera-block-node | ||
helm install "${RELEASE}" charts/blockstream-simulator -f <path-to-custom-values-file> | ||
``` | ||
|
||
## Configure | ||
|
||
The chart comes with a set of default `Values.yaml` file that sets it in ProducerMode and looks for GRPC BN Server with the following service name `hedera-block-node-grpc-service` within the same cluster, ready to start streaming blocks. | ||
However, is also possible to use the simulator in ConsumerMode, to do so, you need to set the following values in the `values.yaml` file: | ||
|
||
```yaml | ||
simulator: | ||
config: | ||
BLOCK_STREAM_SIMULATOR_MODE: "CONSUMER" | ||
# Further custom configuration... | ||
<ENV_VARIABLE>: "<Value>" | ||
``` | ||
and if your BlockNode RELEASE name is different from the assumed: `blkNod`, you need to set the following value in the `values.yaml` file: | ||
|
||
```yaml | ||
simulator: | ||
config: | ||
GRPC_SERVER_ADDRESS: "<BlockNode_HostName(K8 ServiceName)>" | ||
``` | ||
|
||
Refer to the Simulator configuration for further configuration options, any configuration that can be changed via ENV variables should be set in the `values.yaml` file under the `config' section in a directory for config and a separate one for secrets (if needed). |
This file contains 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,5 @@ | ||
BlockStream Simulator Chart has been deployed successfully. | ||
The simulator does not expose any services or API, but it automatically starts to work with the provided documentation. | ||
|
||
The configuration can be overridden by providing a custom values.yaml with the following dictionary: | ||
simulator.config |
This file contains 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,65 @@ | ||
{{- /* | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/}} | ||
|
||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "blockstream-simulator-chart.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "blockstream-simulator-chart.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "blockstream-simulator-chart.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "blockstream-simulator-chart.labels" -}} | ||
helm.sh/chart: {{ include "blockstream-simulator-chart.chart" . }} | ||
{{ include "blockstream-simulator-chart.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "blockstream-simulator-chart.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "blockstream-simulator-chart.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
This function returns the image tag from the values.yaml file if provided. | ||
If the tag is not provided, it defaults to the AppVersion specified in the Chart.yaml file. | ||
Usage: {{ include "image.AppVersion" . }} | ||
*/}} | ||
{{- define "blockstream-simulator-chart.image.tag" -}} | ||
{{- default .Chart.AppVersion .Values.image.tag -}} | ||
{{- end -}} | ||
|
This file contains 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,12 @@ | ||
{{- /* | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/}} | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "blockstream-simulator-chart.fullname" . }}-config | ||
data: | ||
{{- range $key, $value := .Values.simulator.config }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} |
This file contains 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,63 @@ | ||
{{- /* | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/}} | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "blockstream-simulator-chart.fullname" . }} | ||
labels: | ||
{{- include "blockstream-simulator-chart.labels" . | nindent 4 }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{- include "blockstream-simulator-chart.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "blockstream-simulator-chart.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: metrics | ||
containerPort: 9999 | ||
protocol: TCP | ||
envFrom: | ||
- configMapRef: | ||
name: {{ include "blockstream-simulator-chart.fullname" . }}-config | ||
- secretRef: | ||
name: {{ include "blockstream-simulator-chart.fullname" . }}-secret | ||
{{- with .Values.resources }} | ||
resources: | ||
requests: | ||
memory: {{ .requests.memory }} | ||
cpu: {{ .requests.cpu }} | ||
{{- end }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
This file contains 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,13 @@ | ||
{{- /* | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/}} | ||
|
||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "blockstream-simulator-chart.fullname" . }}-secret | ||
type: Opaque | ||
data: | ||
{{- range $key, $value := .Values.simulator.secret }} | ||
{{ $key }}: {{ $value | b64enc }} | ||
{{- end }} |
This file contains 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,25 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
image: | ||
repository: ghcr.io/hashgraph/hedera-block-node/simulator-image | ||
pullPolicy: IfNotPresent | ||
# Overrides the image tag whose default is the chart appVersion. | ||
tag: "" | ||
|
||
imagePullSecrets: [] | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
podAnnotations: {} | ||
podSecurityContext: {} | ||
securityContext: {} | ||
resources: {} | ||
nodeSelector: {} | ||
tolerations: [] | ||
affinity: {} | ||
|
||
simulator: | ||
config: | ||
# either CONSUMER or PUBLISHER | ||
BLOCK_STREAM_SIMULATOR_MODE: "PUBLISHER" | ||
GRPC_SERVER_ADDRESS: "blkNod-block-node-helm-chart" | ||
secret: | ||
PRIVATE_KEY: "fake_private_key" |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{{- /* | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/}} | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
|
This file contains 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
4 changes: 4 additions & 0 deletions
4
charts/hedera-block-node/templates/grafana-dashboard-configmap.yaml
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{{- /* | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/}} | ||
|
||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
|
This file contains 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{{- /* | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/}} | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
|
Oops, something went wrong.