From 8793ddf2208b190a4e5af326d71a93d8851a7039 Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Fri, 22 Nov 2024 17:34:30 -0600 Subject: [PATCH 01/10] updated chart name to hedera-block-node-chart, in order to differentiate it from the image name hedera-block-node. Changed the workflow that publishes the helm chart to use ghcr.io instead of a gh-pages branch. Signed-off-by: Alfredo Gutierrez --- .github/workflows/release-push-image.yaml | 19 +++++++++++++------ charts/hedera-block-node/Chart.yaml | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-push-image.yaml b/.github/workflows/release-push-image.yaml index ece8ef8ee..725f797c6 100644 --- a/.github/workflows/release-push-image.yaml +++ b/.github/workflows/release-push-image.yaml @@ -118,10 +118,17 @@ jobs: - name: Install Helm uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 - - name: Publish helm chart - uses: step-security/helm-gh-pages@6a390e89293c1ec8bc5120f6692f3b8a313a9a3d # v1.7.0 + - name: Login to GitHub Container Registry + uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 with: - target_dir: charts - token: ${{ secrets.GITHUB_TOKEN }} - branch: gh-pages - app_version: ${{ env.VERSION }} + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Package helm chart + run: | + helm package charts/hedera-block-node + + - name: Push helm chart + run: | + helm push hedera-block-node-chart-${{ env.VERSION }}.tgz oci://ghcr.io/hashgraph/hedera-block-node diff --git a/charts/hedera-block-node/Chart.yaml b/charts/hedera-block-node/Chart.yaml index ef587e672..9251b953c 100644 --- a/charts/hedera-block-node/Chart.yaml +++ b/charts/hedera-block-node/Chart.yaml @@ -10,7 +10,7 @@ keywords: maintainers: - name: Hedera Block Node Team email: blocknode@hashgraph.com -name: hedera-block-node +name: hedera-block-node-chart sources: - https://github.com/hashgraph/hedera-block-node version: 0.3.0-SNAPSHOT From f5981319f95aee217e76f94a4e3473543dd1cd11 Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Fri, 22 Nov 2024 17:52:58 -0600 Subject: [PATCH 02/10] Adding version to helm chart publish job Signed-off-by: Alfredo Gutierrez --- .github/workflows/release-push-image.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release-push-image.yaml b/.github/workflows/release-push-image.yaml index 725f797c6..4fc95bd17 100644 --- a/.github/workflows/release-push-image.yaml +++ b/.github/workflows/release-push-image.yaml @@ -125,6 +125,12 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract version + id: extract_version + run: | + VERSION=$(grep 'version=' gradle.properties | cut -d '=' -f2) + echo "VERSION=${VERSION}" >> $GITHUB_ENV + - name: Package helm chart run: | helm package charts/hedera-block-node From 91d58283a0260c27db5e65e73d20d9564c55228c Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Mon, 25 Nov 2024 09:58:47 -0600 Subject: [PATCH 03/10] updating chart installation instructions and publish package. Signed-off-by: Alfredo Gutierrez --- .github/workflows/release-push-image.yaml | 2 +- charts/hedera-block-node/README.md | 24 +++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-push-image.yaml b/.github/workflows/release-push-image.yaml index 4fc95bd17..012cd79d7 100644 --- a/.github/workflows/release-push-image.yaml +++ b/.github/workflows/release-push-image.yaml @@ -137,4 +137,4 @@ jobs: - name: Push helm chart run: | - helm push hedera-block-node-chart-${{ env.VERSION }}.tgz oci://ghcr.io/hashgraph/hedera-block-node + helm push hedera-block-node-chart-${{ env.VERSION }}.tgz oci://ghcr.io/hashgraph/hedera-block-node/charts diff --git a/charts/hedera-block-node/README.md b/charts/hedera-block-node/README.md index 5caa51141..81e3edcbe 100644 --- a/charts/hedera-block-node/README.md +++ b/charts/hedera-block-node/README.md @@ -11,23 +11,35 @@ minikube delete && minikube start --kubernetes-version=v1.23.0 --memory=8g --boo ``` Set environment variables that will be used for the remainder of the document: +Replacing the values with the appropriate values for your environment: bn1 is short for block-node-1, but you can name you release as you wish. And use the version that you want to install. ```bash export RELEASE="bn1" +export VERSION="0.3.0-SNAPSHOT" ``` ## Template -To generate the K8 manifest files without installing the chart: +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-bn hedera-block-node/ --dry-run --output-dir out ``` -## Install -To install the chart: +## Install using released chart + +To pull the packaged chart from public repo: ```bash -helm repo add hedera-block-node https://hashgraph.github.io/hedera-block-node/charts -helm dependency update charts/hedera-block-node -helm install "${RELEASE}" charts/hedera-block-node -f +helm pull oci://ghcr.io/hashgraph/hedera-block-node/charts/hedera-block-node-chart --version "${VERSION}" +``` + +To install the chart with default values: +```bash +helm install "${RELEASE}" hedera-block-node/charts/hedera-block-node-chart-$VERSION.tgz ``` + +To install the chart with custom values: +```bash +helm install "${RELEASE}" hedera-block-node/charts/hedera-block-node-chart-$VERSION.tgz -f +``` + *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 From 9c0d20ea85d679b44b2e74141d7f7f503dc8b43a Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Wed, 27 Nov 2024 13:14:26 -0600 Subject: [PATCH 04/10] changed the chart name and publish repo as suggested by Nathan Signed-off-by: Alfredo Gutierrez --- .github/workflows/release-push-image.yaml | 2 +- charts/hedera-block-node/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-push-image.yaml b/.github/workflows/release-push-image.yaml index 012cd79d7..4fc95bd17 100644 --- a/.github/workflows/release-push-image.yaml +++ b/.github/workflows/release-push-image.yaml @@ -137,4 +137,4 @@ jobs: - name: Push helm chart run: | - helm push hedera-block-node-chart-${{ env.VERSION }}.tgz oci://ghcr.io/hashgraph/hedera-block-node/charts + helm push hedera-block-node-chart-${{ env.VERSION }}.tgz oci://ghcr.io/hashgraph/hedera-block-node diff --git a/charts/hedera-block-node/Chart.yaml b/charts/hedera-block-node/Chart.yaml index 9251b953c..a599ba38e 100644 --- a/charts/hedera-block-node/Chart.yaml +++ b/charts/hedera-block-node/Chart.yaml @@ -10,7 +10,7 @@ keywords: maintainers: - name: Hedera Block Node Team email: blocknode@hashgraph.com -name: hedera-block-node-chart +name: block-node-helm-chart sources: - https://github.com/hashgraph/hedera-block-node version: 0.3.0-SNAPSHOT From 307d080a46c8c5feedb0690ca3305d41259d1571 Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Wed, 27 Nov 2024 13:24:59 -0600 Subject: [PATCH 05/10] added dependency update Signed-off-by: Alfredo Gutierrez --- .github/workflows/release-push-image.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-push-image.yaml b/.github/workflows/release-push-image.yaml index 4fc95bd17..4a8eae873 100644 --- a/.github/workflows/release-push-image.yaml +++ b/.github/workflows/release-push-image.yaml @@ -133,6 +133,7 @@ jobs: - name: Package helm chart run: | + helm dependency update charts/hedera-block-node helm package charts/hedera-block-node - name: Push helm chart From a7773f8671ecca841fabe25c8c17a29288c2b3d5 Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Wed, 27 Nov 2024 13:35:21 -0600 Subject: [PATCH 06/10] fixed package name after chart update Signed-off-by: Alfredo Gutierrez --- .github/workflows/release-push-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-push-image.yaml b/.github/workflows/release-push-image.yaml index 4a8eae873..f9386a1f9 100644 --- a/.github/workflows/release-push-image.yaml +++ b/.github/workflows/release-push-image.yaml @@ -138,4 +138,4 @@ jobs: - name: Push helm chart run: | - helm push hedera-block-node-chart-${{ env.VERSION }}.tgz oci://ghcr.io/hashgraph/hedera-block-node + helm push block-node-helm-chart-${{ env.VERSION }}.tgz oci://ghcr.io/hashgraph/hedera-block-node From 039d2141ed7a1b10141abec0150a99c9714b3e4c Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Wed, 27 Nov 2024 13:59:33 -0600 Subject: [PATCH 07/10] removing overwrite of permisions to keep WF level one Signed-off-by: Alfredo Gutierrez --- .github/workflows/release-push-image.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release-push-image.yaml b/.github/workflows/release-push-image.yaml index f9386a1f9..abef1cfc2 100644 --- a/.github/workflows/release-push-image.yaml +++ b/.github/workflows/release-push-image.yaml @@ -103,8 +103,6 @@ jobs: helm-chart-release: needs: publish runs-on: block-node-linux-medium - permissions: - contents: write steps: - name: Harden Runner From 8e44323a986240dce9ee53a7e526e01414405f81 Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Wed, 27 Nov 2024 14:10:09 -0600 Subject: [PATCH 08/10] updating chart instructions after renaming the chart name Signed-off-by: Alfredo Gutierrez --- charts/hedera-block-node/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/hedera-block-node/README.md b/charts/hedera-block-node/README.md index 81e3edcbe..374a09e7d 100644 --- a/charts/hedera-block-node/README.md +++ b/charts/hedera-block-node/README.md @@ -27,17 +27,17 @@ helm template --name-template my-bn hedera-block-node/ --dry-run --output-dir ou To pull the packaged chart from public repo: ```bash -helm pull oci://ghcr.io/hashgraph/hedera-block-node/charts/hedera-block-node-chart --version "${VERSION}" +helm pull oci://ghcr.io/hashgraph/hedera-block-node/block-node-helm-chart --version "${VERSION}" ``` To install the chart with default values: ```bash -helm install "${RELEASE}" hedera-block-node/charts/hedera-block-node-chart-$VERSION.tgz +helm install "${RELEASE}" hedera-block-node/charts/block-node-helm-chart-$VERSION.tgz ``` To install the chart with custom values: ```bash -helm install "${RELEASE}" hedera-block-node/charts/hedera-block-node-chart-$VERSION.tgz -f +helm install "${RELEASE}" hedera-block-node/charts/block-node-helm-chart-$VERSION.tgz -f ``` *Note:* If using the chart directly after cloning the github repo, there is no need to add the repo. and install can be directly. From 881bf60ee9ea62917c50f1fca9609cd1060bef85 Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Wed, 27 Nov 2024 15:13:51 -0600 Subject: [PATCH 09/10] Improved wording and typos on the README.md Signed-off-by: Alfredo Gutierrez --- charts/hedera-block-node/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/hedera-block-node/README.md b/charts/hedera-block-node/README.md index 374a09e7d..950cc0f39 100644 --- a/charts/hedera-block-node/README.md +++ b/charts/hedera-block-node/README.md @@ -23,9 +23,9 @@ To generate the K8 manifest files without installing the chart, you need to clon helm template --name-template my-bn hedera-block-node/ --dry-run --output-dir out ``` -## Install using released chart +## Install using a published chart -To pull the packaged chart from public repo: +To pull the packaged chart from the public repo: ```bash helm pull oci://ghcr.io/hashgraph/hedera-block-node/block-node-helm-chart --version "${VERSION}" ``` From 68f6100d04e82e94835a1550731dfb39db9ad232 Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Wed, 27 Nov 2024 15:58:27 -0600 Subject: [PATCH 10/10] updated example release name to blkNod Signed-off-by: Alfredo Gutierrez --- charts/hedera-block-node/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/hedera-block-node/README.md b/charts/hedera-block-node/README.md index 950cc0f39..2af13e16c 100644 --- a/charts/hedera-block-node/README.md +++ b/charts/hedera-block-node/README.md @@ -13,7 +13,7 @@ minikube delete && minikube start --kubernetes-version=v1.23.0 --memory=8g --boo Set environment variables that will be used for the remainder of the document: Replacing the values with the appropriate values for your environment: bn1 is short for block-node-1, but you can name you release as you wish. And use the version that you want to install. ```bash -export RELEASE="bn1" +export RELEASE="blkNod" export VERSION="0.3.0-SNAPSHOT" ```