From 6cb5ee4845f0270b6d7fc9f1d457a54de7b0280a Mon Sep 17 00:00:00 2001 From: Kent Rancourt Date: Tue, 31 Aug 2021 14:07:52 -0400 Subject: [PATCH] updating for helm 3.7 Signed-off-by: Kent Rancourt --- .brigade/brigade.ts | 2 +- Makefile | 10 +++------- README.md | 19 ++++++++++--------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.brigade/brigade.ts b/.brigade/brigade.ts index 45dbd4d..66254bf 100644 --- a/.brigade/brigade.ts +++ b/.brigade/brigade.ts @@ -4,7 +4,7 @@ const releaseTagRegex = /^refs\/tags\/(v[0-9]+(?:\.[0-9]+)*(?:\-.+)?)$/ const goImg = "brigadecore/go-tools:v0.1.0" const kanikoImg = "brigadecore/kaniko:v0.2.0" -const helmImg = "brigadecore/helm-tools:v0.1.0" +const helmImg = "brigadecore/helm-tools:v0.2.0" const localPath = "/workspaces/brigade-noisy-neighbor" // MakeTargetJob is just a job wrapper around a make target. diff --git a/Makefile b/Makefile index bf2c304..94aaed1 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ ifneq ($(SKIP_DOCKER),true) -w /workspaces/brigade-noisy-neighbor \ $(KANIKO_IMAGE) - HELM_IMAGE := brigadecore/helm-tools:v0.1.0 + HELM_IMAGE := brigadecore/helm-tools:v0.2.0 HELM_DOCKER_CMD := docker run \ -it \ @@ -73,8 +73,6 @@ ifdef HELM_ORG HELM_ORG := $(HELM_ORG)/ endif -HELM_CHART_NAME := $(HELM_REGISTRY)$(HELM_ORG)brigade-noisy-neighbor - ifdef VERSION MUTABLE_DOCKER_TAG := latest else @@ -153,10 +151,8 @@ publish-chart: helm registry login $(HELM_REGISTRY) -u $(HELM_USERNAME) -p $${HELM_PASSWORD} && \ cd charts/brigade-noisy-neighbor && \ helm dep up && \ - sed -i "s/^version:.*/version: $(VERSION)/" Chart.yaml && \ - sed -i "s/^appVersion:.*/appVersion: $(VERSION)/" Chart.yaml && \ - helm chart save . $(HELM_CHART_NAME):$(VERSION) && \ - helm chart push $(HELM_CHART_NAME):$(VERSION) \ + helm package . --version $(VERSION) --app-version $(VERSION) && \ + helm push brigade-noisy-neighbor-$(VERSION).tgz oci://$(HELM_REGISTRY)$(HELM_ORG) \ ' ################################################################################ diff --git a/README.md b/README.md index 5f8e571..0a7ad27 100644 --- a/README.md +++ b/README.md @@ -49,26 +49,25 @@ $ brig role grant EVENT_CREATOR For now, we're using the [GitHub Container Registry](https://ghcr.io) (which is an [OCI registry](https://helm.sh/docs/topics/registries/)) to host our Helm -chart. Helm 3 has _experimental_ support for OCI registries. In the event that -the Helm 3 dependency proves troublesome for users, or in the event that this +chart. Helm 3.7 has _experimental_ support for OCI registries. In the event that +the Helm 3.7 dependency proves troublesome for users, or in the event that this experimental feature goes away, or isn't working like we'd hope, we will revisit this choice before going GA. -To install Brigade Noisy Neighbor, begin by pulling the chart from GCR and -exporting it to some location on your local system. Here, we export it to -`~/charts`: +First, be sure you are using +[Helm 3.7.0-rc.1](https://github.com/helm/helm/releases/tag/v3.7.0-rc.1) and +enable experimental OCI support: ```console $ export HELM_EXPERIMENTAL_OCI=1 -$ helm chart pull ghcr.io/brigadecore/brigade-noisy-neighbor:v0.1.0 -$ helm chart export ghcr.io/brigadecore/brigade-noisy-neighbor:v0.1.0 -d ~/charts ``` Use the following command to extract the full set of configuration options from the chart. Here we're storing a copy at `~/brigade-noisy-neighbor-values.yaml`: ```console -$ helm inspect values ~/charts/brigade-noisy-neighbor > ~/brigade-noisy-neighbor-values.yaml +$ helm inspect values oci://ghcr.io/brigadecore/brigade-noisy-neighbor \ + --version v0.2.0 > ~/brigade-noisy-neighbor-values.yaml ``` Edit the configuration (`~/brigade-noisy-neighbor-values.yaml` in this example). @@ -86,7 +85,9 @@ At minimum, you will need to make the following changes: Install Brigade Noisy Neighbor, referencing your edited configuration: ```console -$ helm install brigade-noisy-neighbor ~/charts/brigade-noisy-neighbor \ +$ helm install brigade-noisy-neighbor \ + oci://ghcr.io/brigadecore/brigade-noisy-neighbor \ + --version v0.2.0 \ --create-namespace \ --namespace brigade-noisy-neighbor \ --values ~/brigade-noisy-neighbor-values.yaml \