Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 61d6f50

Browse files
committed
Adding guide to build and run operator locally
1 parent c65a8fc commit 61d6f50

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

docs/developer-guide/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,61 @@
22

33
## Developing the SCB Operator
44

5+
### Prerequisites
6+
7+
#### Golang
8+
9+
The operator is written in Golang.
10+
To build the operator you will need to install [Go](https://golang.org/).
11+
12+
#### Minikube or Kind
13+
14+
For local development we recommend to use [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) or [kind](https://github.com/kubernetes-sigs/kind).
15+
Both projects will enable you to run a local kubernetes cluster on your development machine.
16+
17+
#### Operating your local kubernetes cluster
18+
19+
To operate your (local) kubernetes cluster you will need to install [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) and [helm](https://helm.sh/)
20+
21+
#### Minio
22+
23+
For your local development you will need a S3 compatible storage.
24+
We would recommend to use [Minio](https://min.io/download#/) inside a podman or docker container.
25+
26+
```bash
27+
podman run --name minio -p 9000:9000 minio/minio server /data
28+
```
29+
30+
In the Minio management GUI you will need to add a new bucket for the operator.
31+
The default credentials for your minio instance are *minioadmin:minioadmin*.
32+
You might change those.
33+
34+
After setting up your bucket you will need to specify some environment variables to enable the operator to use the bucket.
35+
36+
```bash
37+
$ export S3_ACCESS_KEY="your-minio-access-key"
38+
$ export S3_SECRET_KEY="your-minio-secret-key"
39+
$ export S3_BUCKET="name-of-your-bucket"
40+
$ export S3_USE_SSL="false" # This ensures that the operator will connect even without HTTPS
41+
$ export S3_ENDPOINT="<your.local.ip1address>:9000/"
42+
```
43+
44+
### Build and run the operator
45+
46+
To build an run the operator you can simply execute *make* in the root directory of this repository.
47+
48+
```bash
49+
$ make
50+
```
51+
52+
To run the operator locally you can simply execute *make run*
53+
54+
*NOTICE:* You will need to uninstall the operator from your local cluster first or it will result in undefined behavior!
55+
56+
```bash
57+
$ make run
58+
```
59+
560
## How to a new security scanner
661

762
### ScanType Definition
@@ -15,9 +70,11 @@
1570
### Hook SDK
1671

1772
# Guidelines
73+
1874
## Coding Guidelines
1975

2076
### JSON
77+
2178
We're using snake_case (lower case) for json attributes. If an enum type is used as attribute its converted to lower case. If it's an value it's always used UPPERCASE. This is to hold the attribute api consistent, but make shure Enums are recognized as enums.
2279

2380
```json

0 commit comments

Comments
 (0)