From fc4e88aa3df9f1763b470dc4c4411f78a24d533c Mon Sep 17 00:00:00 2001 From: Daniel Hill Date: Thu, 20 Nov 2025 16:58:52 +0000 Subject: [PATCH] ci: publish Helm charts to GHCR On release, GitHub Actions will also package up the Helm chart and publish to the GitHub container registry. README instructions updated for Helm deployment from OCI registry. Signed-off-by: Daniel Hill --- .github/workflows/master.yml | 19 +++++++++++++++++++ README.md | 8 +++----- {chart => charts/kafdrop}/.helmignore | 0 {chart => charts/kafdrop}/Chart.yaml | 0 {chart => charts/kafdrop}/templates/NOTES.txt | 0 .../kafdrop}/templates/_helpers.tpl | 0 .../kafdrop}/templates/deployment.yaml | 0 .../kafdrop}/templates/ingress.yaml | 0 .../kafdrop}/templates/service.yaml | 0 {chart => charts/kafdrop}/values.yaml | 0 10 files changed, 22 insertions(+), 5 deletions(-) rename {chart => charts/kafdrop}/.helmignore (100%) rename {chart => charts/kafdrop}/Chart.yaml (100%) rename {chart => charts/kafdrop}/templates/NOTES.txt (100%) rename {chart => charts/kafdrop}/templates/_helpers.tpl (100%) rename {chart => charts/kafdrop}/templates/deployment.yaml (100%) rename {chart => charts/kafdrop}/templates/ingress.yaml (100%) rename {chart => charts/kafdrop}/templates/service.yaml (100%) rename {chart => charts/kafdrop}/values.yaml (100%) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 9d2a78ff..c0cb091c 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -9,6 +9,8 @@ on: jobs: build: + permissions: + packages: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 @@ -61,3 +63,20 @@ jobs: name: push latest if it's a release if: ${{ ! endsWith( env.app_ver, '-SNAPSHOT' ) }} run: docker buildx imagetools create docker.io/obsidiandynamics/kafdrop:$app_ver --tag docker.io/obsidiandynamics/kafdrop:latest + + # Helm chart release + - + name: Login to GHCR + if: ${{ ! endsWith( env.app_ver, '-SNAPSHOT' ) }} + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${ GITHUB_REPOSITORY_OWNER } + password: ${{ secrets.GITHUB_TOKEN }} + - + name: publish chart to GitHub packages + if: ${{ ! endsWith( env.app_ver, '-SNAPSHOT' ) }} + run: | + helm dependency build charts/kafdrop + helm package charts/kafdrop --version "$app_ver" + helm push "kafdrop-$app_ver.tgz" oci://ghcr.io/"${GITHUB_REPOSITORY_OWNER}"/charts diff --git a/README.md b/README.md index d98e912f..a565ce35 100644 --- a/README.md +++ b/README.md @@ -121,20 +121,18 @@ Then access the web UI at [http://localhost:9000](http://localhost:9000). > **Hey there!** We hope you really like Kafdrop! Please take a moment to [⭐](https://github.com/obsidiandynamics/kafdrop)the repo or [Tweet](https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2Fobsidiandynamics%2Fkafdrop&text=Get%20Kafdrop%20%E2%80%94%20a%20web-based%20UI%20for%20viewing%20%23ApacheKafka%20topics%20and%20browsing%20consumers%20) about it. ## Running in Kubernetes (using a Helm Chart) -Clone the repository (if necessary): -```sh -git clone https://github.com/obsidiandynamics/kafdrop && cd kafdrop -``` Apply the chart: ```sh -helm upgrade -i kafdrop chart --set image.tag=3.x.x \ +helm upgrade -i kafdrop ghcr.io/dan-hill2802/charts/kafdrop --version x.x.x --set image.tag=3.x.x \ --set kafka.brokerConnect= \ --set server.servlet.contextPath="/" \ --set cmdArgs="--message.format=AVRO --schemaregistry.connect=http://localhost:8080" \ #optional --set jvm.opts="-Xms32M -Xmx64M" ``` +Replace `--version x.x.x` with the desired chart version. [Available versions](https://github.com/obsidiandynamics/kafdrop/pkgs/container/charts%2Fkafdrop/versions) + For all Helm configuration options, have a peek into [chart/values.yaml](chart/values.yaml). Replace `3.x.x` with the image tag of [obsidiandynamics/kafdrop](https://hub.docker.com/r/obsidiandynamics/kafdrop). Services will be bound on port 9000 by default (node port 30900). diff --git a/chart/.helmignore b/charts/kafdrop/.helmignore similarity index 100% rename from chart/.helmignore rename to charts/kafdrop/.helmignore diff --git a/chart/Chart.yaml b/charts/kafdrop/Chart.yaml similarity index 100% rename from chart/Chart.yaml rename to charts/kafdrop/Chart.yaml diff --git a/chart/templates/NOTES.txt b/charts/kafdrop/templates/NOTES.txt similarity index 100% rename from chart/templates/NOTES.txt rename to charts/kafdrop/templates/NOTES.txt diff --git a/chart/templates/_helpers.tpl b/charts/kafdrop/templates/_helpers.tpl similarity index 100% rename from chart/templates/_helpers.tpl rename to charts/kafdrop/templates/_helpers.tpl diff --git a/chart/templates/deployment.yaml b/charts/kafdrop/templates/deployment.yaml similarity index 100% rename from chart/templates/deployment.yaml rename to charts/kafdrop/templates/deployment.yaml diff --git a/chart/templates/ingress.yaml b/charts/kafdrop/templates/ingress.yaml similarity index 100% rename from chart/templates/ingress.yaml rename to charts/kafdrop/templates/ingress.yaml diff --git a/chart/templates/service.yaml b/charts/kafdrop/templates/service.yaml similarity index 100% rename from chart/templates/service.yaml rename to charts/kafdrop/templates/service.yaml diff --git a/chart/values.yaml b/charts/kafdrop/values.yaml similarity index 100% rename from chart/values.yaml rename to charts/kafdrop/values.yaml