From 4a0c8bc867957f51cede31e0edb325678d4ecb74 Mon Sep 17 00:00:00 2001 From: Ralf Pannemans Date: Fri, 12 Jun 2026 08:28:13 +0200 Subject: [PATCH] Ease use of local charts --- Makefile | 14 +++++++++++--- docs/local-development-guide.md | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 283b180..99c24a4 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,17 @@ temp/certs/ca.key temp/certs/ca.crt temp/certs/ssh_key temp/certs/ssh_key.pub te install: kind get kubeconfig --name cfk8s > temp/kubeconfig - docker run --rm --net=host --env-file temp/secrets.env \ - --env INSTALL_OPTIONAL_COMPONENTS \ - -v "$$PWD/temp/certs:/certs" -v "$$PWD/temp/kubeconfig:/helm/.kube/config:ro" -v "$$PWD:/wd" --workdir /wd ghcr.io/helmfile/helmfile:v$(HELMFILE_VERSION) helmfile sync + + @if ! command -v helmfil &> /dev/null; then \ + echo "helmfile not found, using docker to run helmfile"; \ + docker run --rm --net=host --env-file temp/secrets.env \ + --env INSTALL_OPTIONAL_COMPONENTS \ + -v "$$PWD/temp/certs:/certs" -v "$$PWD/temp/kubeconfig:/helm/.kube/config:ro" -v "$$PWD:/wd" --workdir /wd ghcr.io/helmfile/helmfile:v$(HELMFILE_VERSION) helmfile sync; \ + else \ + echo "helmfile found, using local helmfile"; \ + source temp/secrets.sh; \ + helmfile sync --kubeconfig temp/kubeconfig; \ + fi login: @ . temp/secrets.sh; \ diff --git a/docs/local-development-guide.md b/docs/local-development-guide.md index 1a87a67..5b4bc4b 100644 --- a/docs/local-development-guide.md +++ b/docs/local-development-guide.md @@ -2,11 +2,39 @@ This guide explains how to test local code changes in your kind cluster. -## 1. Build Local Image +## Helm Chart + +**Note:** If you want to use a local chart, you need a local installation of `helmfile`. Otherwise a container will be used and the chart will not be visible. + +### 1. Get Local Charts + +The charts are published from [cf-k8s-releases](https://github.com/cloudfoundry/cf-k8s-releases). Just clone this repository. + +### 2. Use local Chart + +Edit the [versions.yaml](../versions.yaml) and change the release you want to consume from the published chart to the local path. + +**Example:** + +``` + +To consume a local diego chart: + +```yaml +charts: + diego: + url: ../cf-k8s-releases/diego/helm # path to the chart + version: 1.238.0 # is not used in local case, just keep it +``` + + +## Docker Image + +### 1. Build Local Image The images are built in [cf-k8s-releases](https://github.com/cloudfoundry/cf-k8s-releases). For building the image with modified source code, please refer to th [local-development-guide](https://github.com/cloudfoundry/cf-k8s-releases/blob/main/docs/local-development-guide.md). -## 2. Load Image into kind +### 2. Load Image into kind Make the locally built image available to your kind cluster: