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

Commit 45ee6d1

Browse files
committed
#24 Rework developer guide for operator
- Add a macosOS section with Homebrew. - Linebreak long commands. - Change the export: We can just use localhost. - Add hint about direnv. - Clarify instructions about uninstalling the operator. Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
1 parent 7b074cd commit 45ee6d1

File tree

2 files changed

+38
-13
lines changed

2 files changed

+38
-13
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
coverage/
44
.vagrant
55
**.log
6-
**/*.monopic
6+
**/*.monopic
7+
.envrc

docs/developer-guide/README.md

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,75 @@ For local development we recommend to use [Minikube](https://kubernetes.io/docs/
1414

1515
#### Operating Your Local Kubernetes Cluster
1616

17-
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/)
17+
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/)
18+
19+
#### macOS
20+
21+
For macOs simply use [Homebrew](https://brew.sh/) to install all the tools:
22+
23+
```bash
24+
brew cask install docker
25+
brew install go helm
26+
```
27+
28+
After that start the `Docker.app` and go to it's settings and start Kubernetes.
1829

1930
#### Minio
2031

2132
For your local development you will need a S3 compatible storage.
22-
We would recommend to use [Minio](https://min.io/download#/) inside a podman or docker container.
33+
We would recommend to use [Minio](https://min.io/download#/) inside a Podman or docker container.
2334

2435
##### If You Want to Use Podman
2536

2637
```bash
27-
podman run --name minio -p 9000:9000 minio/minio server /data
38+
podman run \
39+
--name minio \
40+
-p 9000:9000 \
41+
minio/minio \
42+
server /data
2843
```
2944

3045
##### If You Want to Use Docker
3146

3247
```bash
33-
docker run --name minio -p 9000:9000 minio/minio server /data
48+
docker container run \
49+
--name minio \
50+
-p 9000:9000 \
51+
-d \
52+
--rm \
53+
minio/minio \
54+
server /data
3455
```
3556

36-
In the Minio management GUI you will need to add a new bucket for the operator. The default credentials for your minio instance are `minioadmin:minioadmin`. You might change those.
37-
38-
After setting up your bucket you will need to specify some environment variables to enable the operator to use the bucket.
39-
You could add these to your `.bashrc` or `.zshrc` as well.
57+
In the Minio management GUI you will need to add a new bucket for the operator. The default credentials for your minio instance are `minioadmin:minioadmin`. You might change those. Go to the management UI at <http://localhost:9000/> and add a new bucket. After creating your bucket you will need to specify some environment variables to enable the operator to use the bucket. For that export these variables:
4058

4159
```bash
4260
export S3_ACCESS_KEY="your-minio-access-key"
4361
export S3_SECRET_KEY="your-minio-secret-key"
4462
export S3_BUCKET="name-of-your-bucket"
4563
export S3_USE_SSL="false" # This ensures that the operator will connect even without HTTPS
46-
export S3_ENDPOINT="<your.local.ip1address>:9000/"
64+
export S3_ENDPOINT="127.0.0.1:9000"
4765
```
4866

67+
You can save time by using [direnv](https://direnv.net/) to export these variables in your project.
68+
4969
### Build and Run the Operator
5070

51-
To build an run the operator you can simply execute *make* in the *operator* directory of this repository.
71+
To build an run the operator you can simply execute `make` in the `operator` directory of this repository:
5272

5373
```bash
74+
cd operator
5475
make
5576
```
5677

57-
To run the operator locally you can simply execute *make run*
78+
This will produce the operator as `bin/manager`. If you wonder why the operator is named _manager_ (the resulting binary). The reason for that is in Kubernetes a combination of more than one _controller_ is called _controller-manager_ or short _manager_. In contrast _operator_ is created by the community to name a _controller-manager_ which controls _custom resources_ and hence we use _custom resources_. (see <https://book.kubebuilder.io/> for further information)
79+
80+
To run the operator locally you can simply execute `make run` in the `operator` directory of this repository:
5881

59-
*NOTICE:* You will need to uninstall the operator from your local cluster first or it will result in undefined behavior!
82+
*NOTICE:* You will need to uninstall the operator with `helm -n securecodebox-system uninstall securecodebox-operator` from your local cluster, if you've installed it via helm. Unless both operators try to work on the same cluster which may cause unexpected behavior.
6083

6184
```bash
85+
cd operator
6286
make run
6387
```
6488

0 commit comments

Comments
 (0)