From 9e29403570c92ab3ecd2ad1e72f65d27fc06d094 Mon Sep 17 00:00:00 2001 From: Apoorva Jagtap Date: Wed, 12 Feb 2025 13:04:41 +0530 Subject: [PATCH] Adds missing parameters to the commands in */developing.md --- docs/helm-locker/developing.md | 2 +- docs/helm-project-operator/developing.md | 2 +- docs/prometheus-federator/developing.md | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/helm-locker/developing.md b/docs/helm-locker/developing.md index a174ec3c..30bb74d4 100644 --- a/docs/helm-locker/developing.md +++ b/docs/helm-locker/developing.md @@ -81,7 +81,7 @@ If you don't want to run all the steps in CI every time you make a change, you c REPO= TAG= -GOOS=linux CGO_ENABLED=0 go build -ldflags "-extldflags -static -s" -o bin/helm-locker && REPO=${REPO} TAG=${TAG} make package +GOOS=linux CGO_ENABLED=0 go build -ldflags "-extldflags -static -s" -o bin/helm-locker cmd/helm-locker/main.go && REPO=${REPO} TAG=${TAG} make package ``` Once the image is successfully packaged, simply run `docker push ${REPO}/helm-locker:${TAG}` to push your image to your Docker repository. diff --git a/docs/helm-project-operator/developing.md b/docs/helm-project-operator/developing.md index 7b9f3566..acfd7298 100644 --- a/docs/helm-project-operator/developing.md +++ b/docs/helm-project-operator/developing.md @@ -115,7 +115,7 @@ If you don't want to run all the steps in CI every time you make a change, you c REPO= TAG= -./scripts/build-chart && GOOS=linux CGO_ENABLED=0 go build -ldflags "-extldflags -static -s" -o bin/helm-project-operator && REPO=${REPO} TAG=${TAG} make package +./scripts/build-chart && GOOS=linux CGO_ENABLED=0 go build -ldflags "-extldflags -static -s" -o bin/helm-project-operator cmd/helm-project-operator/main.go && REPO=${REPO} TAG=${TAG} make package ``` Once the image is successfully packaged, simply run `docker push ${REPO}/helm-project-operator:${TAG}` to push your image to your Docker repository. diff --git a/docs/prometheus-federator/developing.md b/docs/prometheus-federator/developing.md index 397cd21d..d64bf5b4 100644 --- a/docs/prometheus-federator/developing.md +++ b/docs/prometheus-federator/developing.md @@ -93,7 +93,7 @@ If you don't want to run all the steps in CI every time you make a change, you c REPO= TAG= -./scripts/build-chart && GOOS=linux CGO_ENABLED=0 go build -ldflags "-extldflags -static -s" -o build/bin/prometheus-federator && REPO=${REPO} TAG=${TAG} make package +./scripts/build-chart && GOOS=linux CGO_ENABLED=0 go build -ldflags "-extldflags -static -s" -o build/bin/prometheus-federator cmd/prometheus-federator/main.go && REPO=${REPO} TAG=${TAG} make package ``` Once the image is successfully packaged, simply run `docker push ${REPO}/prometheus-federator:${TAG}` to push your image to your Docker repository. @@ -101,6 +101,7 @@ Once the image is successfully packaged, simply run `docker push ${REPO}/prometh ## Testing a custom Docker image build 1. Ensure that your `KUBECONFIG` environment variable is pointing to your cluster (e.g. `export KUBECONFIG=; kubectl get nodes` should show the nodes of your cluster) and pull in this repository locally -2. Go to the root of your local copy of this repository and deploy the Prometheus Federator chart as a Helm 3 chart onto your cluster after overriding the image and tag values with your Docker repository and tag: run `helm upgrade --install --set image.repository="${REPO}/prometheus-federator" --set image.tag="${TAG}" --set image.pullPolicy=Always prometheus-federator -n cattle-monitoring-system charts/prometheus-federator` +2. Go to the root of your local copy of this repository and deploy the Prometheus Federator chart as a Helm 3 chart onto your cluster after overriding the image and tag values with your Docker repository and tag: run `helm upgrade --install --set global.cattle.clusterId="local" --set image.repository="${REPO}/prometheus-federator" --set image.tag="${TAG}" --set image.pullPolicy=Always prometheus-federator -n cattle-monitoring-system charts/prometheus-federator` > Note: Why do we set the Image Pull Policy to `Always`? If you update the Docker image on your fork, setting the Image Pull Policy to `Always` ensures that running `kubectl rollout restart -n cattle-monitoring-system deployment/prometheus-federator` is all you need to do to update your running deployment to the new image, since this would ensure redeploying a deployment triggers a image pull that uses your most up-to-date Docker image. Also, since the underlying Helm chart deployed by the operator (e.g. `example-chart`) is directly embedded into the Helm Project Operator image, you also do not need to update the Deployment object itself to see all the HelmCharts in your cluster automatically be updated to the latest embedded version of the chart. +> Note: Set the value of `global.cattle.clusterId` to the cluster in which you expect Prometheus Federator to be deployed (with the above `helm upgrade` command, we expect the chart to be deployed in `local` cluster). 3. Profit! \ No newline at end of file