Skip to content

Commit

Permalink
Merge pull request #283 from nyrahul/dev
Browse files Browse the repository at this point in the history
Dev env setup doc
  • Loading branch information
nyrahul committed Aug 11, 2021
2 parents 9effeda + 4f37810 commit 4d2704a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
40 changes: 40 additions & 0 deletions getting-started/development_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,43 @@ tests/
multi-ubuntu - Example microservices for testing
unit-tests - Automated unit test framework for knoxAutoPolicy
```

## Setting up dev env

Assuming you have the knoxAutoPolicy repo checked out.
Setup Cilium env in minikube or in k8s-VMs. Ensure following:

#### Ensure Hubble relay service is enabled and port-forwarding is enabled on the host
```
$ kubectl -n kube-system port-forward service/hubble-relay --address 0.0.0.0 --address :: 4245:80
```

#### Setup mysql
```
$ cd tests/mysql
$ docker-compose -f docker-compose.yml up
```

#### Compile knoxAutoPolicy
```
$ cd src
$ make
```
This should generate the binary `knoxAutoPolicy` in the src folder.

#### Update configuration
Edit `src/conf/local.yaml` to ensure that:
* `cilium-hubble: url` address is set to the localhost and port is set to 4245
* `network-log-from: "hubble"` is set
* `cluster-info-from: "k8sclient"` is set
Note that this must already be set to these values by default.

#### Execute knoxAutoPolicy
```
$ ./scripts/start_service.sh
```

#### Trigger policy discovery
```
$ ./scripts/start_net_worker.sh
```
7 changes: 4 additions & 3 deletions src/conf/local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ feed-consumer:

logging:
level: "INFO"


# kubectl -n kube-system port-forward service/hubble-relay --address 0.0.0.0 --address :: 4245:80
cilium-hubble:
url: 10.107.199.164
port: 80
url: localhost
port: 4245

0 comments on commit 4d2704a

Please sign in to comment.