Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@if ! command -v helmfil &> /dev/null; then \
@if ! command -v helmfile &> /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; \
Comment on lines +15 to +18

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite like this solution, the docker container was introduced to reduce complexity but this solution requires more and complicated configuration (mount helm directory manually, set path to chart in versions.yaml to mounted path instead of filesystem path)

else \
echo "helmfile found, using local helmfile"; \
source temp/secrets.sh; \
helmfile sync --kubeconfig temp/kubeconfig; \
fi

login:
@ . temp/secrets.sh; \
Expand Down
32 changes: 30 additions & 2 deletions docs/local-development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Loading