Skip to content

Commit

Permalink
feat: Kubernetes grafana setup (#342)
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Gutierrez <[email protected]>
  • Loading branch information
AlfredoG87 authored Nov 25, 2024
1 parent ad18213 commit c2fb9d0
Show file tree
Hide file tree
Showing 17 changed files with 28,745 additions and 98 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/helm-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0

- name: Update chart dependency
if: steps.list-changed.outputs.changed == 'true'
run: |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm dependency update charts/hedera-block-node
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config ct.yaml
2 changes: 2 additions & 0 deletions charts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*/out
out
/hedera-block-node/Chart.lock
/hedera-block-node/charts/*
6 changes: 6 additions & 0 deletions charts/hedera-block-node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ name: hedera-block-node
sources:
- https://github.com/hashgraph/hedera-block-node
version: 0.3.0-SNAPSHOT
dependencies:
- name: kube-prometheus-stack
alias: kubepromstack
condition: kubepromstack.enabled
version: "51.2.0" # Use the latest stable version
repository: "https://prometheus-community.github.io/helm-charts"
23 changes: 21 additions & 2 deletions charts/hedera-block-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ Installs the Hedera Block Node on a Kubernetes cluster.
- Helm 3+
- Kubernetes 1.29+

Set environment variables that will be used for the remainder of the document:
For Development and Test environment is recommended to use minikube with the following command (if want to deploy the kube-prometheus-stack for metrics visualization):
```bash
minikube delete && minikube start --kubernetes-version=v1.23.0 --memory=8g --bootstrapper=kubeadm --extra-config=kubelet.authentication-token-webhook=true --extra-config=kubelet.authorization-mode=Webhook --extra-config=scheduler.bind-address=0.0.0.0 --extra-config=controller-manager.bind-address=0.0.0.0
```

Set environment variables that will be used for the remainder of the document:
```bash
export RELEASE="bn1"
```
Expand All @@ -21,11 +25,14 @@ helm template --name-template my-bn hedera-block-node/ --dry-run --output-dir ou
To install the chart:
```bash
helm repo add hedera-block-node https://hashgraph.github.io/hedera-block-node/charts
helm install "${RELEASE}" hedera-block-node/hedera-block-node -f <path-to-custom-values-file>
helm dependency update charts/hedera-block-node
helm install "${RELEASE}" charts/hedera-block-node -f <path-to-custom-values-file>
```
*Note:* If using the chart directly after cloning the github repo, there is no need to add the repo. and install can be directly.
Assuming you are at the root folder of the repo.
```bash
helm dependency build charts/hedera-block-node

helm install "${RELEASE}" charts/hedera-block-node -f <path-to-custom-values-file>
```

Expand Down Expand Up @@ -54,6 +61,18 @@ or passed at the command line:
helm install "${RELEASE}" hedera-block-node/hedera-block-node --set blockNode.secret.PRIVATE_KEY="<Secret>"
```

### Enable Prometheus + Grafana Stack
By default the stack includes a chart dependency that includes a prometheus + grafana + node-exporter stack, also adds 3 provisioned dashboards
- **Hedera Block Node Dashboard:** to monitor the Hedera Block Node metrics, this are the server application specific metrics.
- **Node Exporter Full:** to monitor the node-exporter metrics, system metrics at the K8 cluster/node level.
- **Kubernetes View Pods:** to monitor the kubernetes pods metrics, system metrics at the container level.

If you prefer to use your own prometheus+grafana stack, you can disable the stack by setting the following values:
```yaml
kubepromstack:
enabled: false
```
## Using
Follow the `NOTES` instructions after installing the chart to perform `port-forward` to the Hedera Block Node and be able to use it.

Expand Down
Loading

0 comments on commit c2fb9d0

Please sign in to comment.