Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update development docs #1248

Merged
merged 2 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
42 changes: 15 additions & 27 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,43 +70,31 @@ to update the the generated `runner.pg.go` data.

## How to run the controller locally

Install flux on your test cluster:

```bash
flux install
```

Port forward to source-controller artifacts server:

```bash
kubectl -n flux-system port-forward svc/source-controller 8080:80
```

Export the local address as `SOURCE_CONTROLLER_LOCALHOST`:
Prerequisites:

```bash
export SOURCE_CONTROLLER_LOCALHOST=localhost:8080
```
* go
* kind
* kubectl
* tilt
* docker
* flux

Export Kubernetes service and port of the test cluster:
Start the KinD cluster with a local registry and install flux:

```bash
export KUBERNETES_SERVICE_HOST=
export KUBERNETES_SERVICE_PORT=
./tools/reboot.sh
```

Disable Terraform Kubernetes backend so that it doesn't store the state:
Build the containers and run them in the KinD cluster:

```bash
export DISABLE_TF_K8S_BACKEND=1
# GITHUB_TOKEN is used by the branch planner and requires read access to the targeted repository.
# If you do not intend to use the branch planner, then you can set it to a random non-empty string.
export GITHUB_TOKEN=<token>
tilt up
```

Run the controller locally:

```bash
make install
make run
```
Tilt will automatically detect code changes which will retrigger a build and redeploy.

## How to install the controller

Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,12 @@ docker:
.PHONY: serve-docs
serve-docs: ## Run a local server to serve the docs
@docker run --rm -it -p 8000:8000 -v $(shell pwd):/docs squidfunk/mkdocs-material

.PHONY: up
up:
./tools/reboot.sh
tilt up
akselleirv marked this conversation as resolved.
Show resolved Hide resolved

down:
kind delete cluster --name tfdev
docker rm -f kind-registry
Loading