Skip to content

Commit 2a66c59

Browse files
committed
Update dev docs
1 parent 0246b7d commit 2a66c59

File tree

1 file changed

+61
-11
lines changed

1 file changed

+61
-11
lines changed

DEVELOPMENT.md

+61-11
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,43 @@
44
> to find out about how to contribute to Flux and how to interact with the
55
> Flux Development team.
66
7+
## Installing required dependencies
8+
9+
There are a number of dependencies required to be able to run the controller and its test suite locally:
10+
11+
- [Install Go](https://golang.org/doc/install)
12+
- [Install Kustomize](https://kubernetes-sigs.github.io/kustomize/installation/)
13+
- [Install Docker](https://docs.docker.com/engine/install/)
14+
- (Optional) [Install Kubebuilder](https://book.kubebuilder.io/quick-start.html#installation)
15+
16+
In addition to the above, the following dependencies are also used by some of the `make` targets:
17+
18+
- `controller-gen` (v0.7.0)
19+
- `gen-crd-api-reference-docs` (v0.3.0)
20+
- `setup-envtest` (latest)
21+
22+
If any of the above dependencies are not present on your system, the first invocation of a `make` target that requires them will install them.
23+
724
## How to run the test suite
825

926
Prerequisites:
10-
* go >= 1.16
11-
* kubebuilder >= 2.3
12-
* kustomize >= 3.1
27+
* Go >= 1.17
1328

14-
You can run the unit tests by simply doing
29+
You can run the test suite by simply doing
1530

1631
```bash
1732
make test
1833
```
1934

2035
## How to run the controller locally
2136

22-
Install flux on your test cluster:
37+
Install the controller's CRDs on your test cluster:
2338

2439
```sh
25-
flux install
40+
make install
2641
```
2742

28-
Scale the in-cluster controller to zero:
29-
30-
```sh
31-
kubectl -n flux-system scale deployment/helm-controller --replicas=0
32-
```
43+
Note that `helm-controller` depends on [source-controller](https://github.com/fluxcd/source-controller) to acquire the Helm charts from Helm repositories. If `source-controller` is not running on your test cluster, you need to tell `helm-controller` where to find it.
3344

3445
Port forward to source-controller artifacts server:
3546

@@ -43,8 +54,47 @@ Export the local address as `SOURCE_CONTROLLER_LOCALHOST`:
4354
export SOURCE_CONTROLLER_LOCALHOST=localhost:8080
4455
```
4556

57+
Alternatively, if your test cluster is already running `source-controller` and `helm-controller`, you need to scale down the in-cluster `helm-controller`:
58+
59+
```
60+
kubectl -n flux-system scale deployment/helm-controller --replicas=0
61+
```
62+
4663
Run the controller locally:
4764

4865
```sh
4966
make run
5067
```
68+
69+
## How to install the controller
70+
71+
### Building the container image
72+
73+
Set the name of the container image to be created from the source code. This will be used when building, pushing and referring to the image on YAML files:
74+
75+
```sh
76+
export IMG=registry-path/helm-controller:latest
77+
```
78+
79+
Build the container image, tagging it as `$(IMG)`:
80+
81+
```sh
82+
make docker-build
83+
```
84+
85+
Push the image into the repository:
86+
87+
```sh
88+
make docker-push
89+
```
90+
91+
**Note**: `make docker-build` will build an image for the `amd64` architecture.
92+
93+
94+
### Deploying into a cluster
95+
96+
Deploy `helm-controller` into the cluster that is configured in the local kubeconfig file (i.e. `~/.kube/config`):
97+
98+
```sh
99+
make deploy
100+
```

0 commit comments

Comments
 (0)