Skip to content

Commit f3e2ce0

Browse files
authored
📖 [Docs] Reorganize developer documentation (#1279)
* Reorganize developer documentation Reordered sections and added MacOS setup into a dedicated section. Improved structure for better readability and provided clear instructions for installing and using necessary tools. Signed-off-by: Brett Tofel <[email protected]> * Incorporate trgeiger comments Signed-off-by: Brett Tofel <[email protected]> * Remove How-to; clarify Kind use; grammar Signed-off-by: Brett Tofel <[email protected]> * Fix missing backticks Signed-off-by: Brett Tofel <[email protected]> --------- Signed-off-by: Brett Tofel <[email protected]>
1 parent 34821fa commit f3e2ce0

File tree

1 file changed

+43
-58
lines changed

1 file changed

+43
-58
lines changed

docs/drafts/developer.md

Lines changed: 43 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1+
12
## Getting Started
2-
You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
3+
4+
The following `make run` starts a [KIND](https://sigs.k8s.io/kind) cluster for you to get a local cluster for testing, see the manual install steps below for how to run against a remote cluster.
35

46
> [!NOTE]
57
> Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).
8+
>
9+
> If you are on MacOS, see [Special Setup for MacOS](#special-setup-for-macos).
10+
11+
### Quickstart Installation
12+
13+
First, you need to install the CRDs and the operator-controller into a new [KIND cluster](https://kind.sigs.k8s.io/). You can do this by running:
14+
15+
```sh
16+
make run
17+
```
18+
19+
This will build a local container image of the operator-controller, create a new KIND cluster and then deploy onto that cluster. This will also deploy the catalogd and cert-manager dependencies.
620

7-
### Installation
21+
### To Install Any Given Release
822

923
> [!CAUTION]
1024
> Operator-Controller depends on [cert-manager](https://cert-manager.io/). Running the following command
@@ -16,27 +30,7 @@ The latest version of Operator Controller can be installed with the following co
1630
curl -L -s https://github.com/operator-framework/operator-controller/releases/latest/download/install.sh | bash -s
1731
```
1832

19-
### Additional setup on Macintosh computers
20-
On Macintosh computers some additional setup is necessary to install and configure compatible tooling.
21-
22-
#### Install Homebrew and tools
23-
Follow the instructions to [installing Homebrew](https://docs.brew.sh/Installation) and then execute the following to install tools:
24-
25-
```sh
26-
brew install bash gnu-tar gsed
27-
```
28-
29-
#### Configure your shell
30-
Modify your login shell's `PATH` to prefer the new tools over those in the existing environment. This example should work either with `zsh` (in $HOME/.zshrc) or `bash` (in $HOME/.bashrc):
31-
32-
```sh
33-
for bindir in `find $(brew --prefix)/opt -type d -follow -name gnubin -print`
34-
do
35-
export PATH=$bindir:$PATH
36-
done
37-
```
38-
39-
### Running on the cluster
33+
### Manual Step-by-Step Installation
4034
1. Install Instances of Custom Resources:
4135

4236
```sh
@@ -69,33 +63,20 @@ To undeploy the controller from the cluster:
6963
make undeploy
7064
```
7165

72-
### How it works
73-
This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
74-
75-
It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
76-
which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
77-
78-
### Test It Out
79-
80-
Install the CRDs and the operator-controller into a new [KIND cluster](https://kind.sigs.k8s.io/):
81-
```sh
82-
make run
83-
```
84-
This will build a local container image of the operator-controller, create a new KIND cluster and then deploy onto that cluster.
85-
This will also deploy the catalogd and cert-manager dependencies.
86-
8766
### Modifying the API definitions
8867
If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
8968

9069
```sh
9170
make manifests
9271
```
9372

73+
---
74+
9475
**NOTE:** Run `make help` for more information on all potential `make` targets.
9576

96-
### Rapid iterative development with Tilt
77+
### Rapid Iterative Development with Tilt
9778

98-
If you are developing against the combined ecosystem of catalogd + operator-controller you will want to take advantage of `tilt`:
79+
If you are developing against the combined ecosystem of catalogd + operator-controller, you will want to take advantage of `tilt`:
9980

10081
[Tilt](https://tilt.dev) is a tool that enables rapid iterative development of containerized workloads.
10182

@@ -105,8 +86,6 @@ Here is an example workflow without Tilt for modifying some source code and test
10586
2. Build the container image.
10687
3. Either push the image to a registry or load it into your kind cluster.
10788
4. Deploy all the appropriate Kubernetes manifests for your application.
108-
1. Or, if this is an update, you'd instead scale the Deployment to 0 replicas, scale back to 1, and wait for the
109-
new pod to be running.
11089

11190
This process can take minutes, depending on how long each step takes.
11291

@@ -125,9 +104,7 @@ Follow Tilt's [instructions](https://docs.tilt.dev/install.html) for installatio
125104
### Installing catalogd
126105

127106
operator-controller requires
128-
[catalogd](https://github.com/operator-framework/catalogd). Please make sure it's installed, either normally or via
129-
their own Tiltfiles, before proceeding. If you want to use Tilt, make sure you specify a unique `--port` flag to each
130-
`tilt up` invocation.
107+
[catalogd](https://github.com/operator-framework/catalogd). Please make sure it's installed, either normally or via its own Tiltfile., before proceeding. If you want to use Tilt, make sure you specify a unique `--port` flag to each `tilt up` invocation.
131108

132109
### Install tilt-support Repo
133110

@@ -171,25 +148,33 @@ v0.33.1, built 2023-06-28
171148
(ctrl-c) to exit
172149
```
173150

174-
Typically, you'll want to press the space bar to have it open the UI in your web browser.
151+
At the end of the installation process, the command output will prompt you to press the space bar to open the web UI, which provides a useful overview of all the installed components.
152+
153+
---
154+
155+
## Special Setup for MacOS
156+
157+
Some additional setup is necessary on Macintosh computers to install and configure compatible tooling.
175158

176-
Shortly after starting, Tilt processes the `Tiltfile`, resulting in:
159+
### Install Homebrew and tools
160+
Follow the instructions to [install Homebrew](https://docs.brew.sh/Installation), and then execute the following command to install the required tools:
177161

178-
- Building the go binaries
179-
- Building the images
180-
- Loading the images into kind
181-
- Running kustomize and applying everything except the Deployments that reference the images above
182-
- Modifying the Deployments to use the just-built images
183-
- Creating the Deployments
162+
```sh
163+
brew install bash gnu-tar gsed
164+
```
184165

185-
### Making code changes
166+
### Configure your shell
167+
To configure your shell, either add this to your bash or zsh profile (e.g., in $HOME/.bashrc or $HOME/.zshrc), or run the following command in the terminal:
186168

187-
Any time you change any of the files listed in the `deps` section in the `<binary name>_binary` `local_resource`,
188-
Tilt automatically rebuilds the go binary. As soon as the binary is rebuilt, Tilt pushes it (and only it) into the
189-
appropriate running container, and then restarts the process.
169+
```sh
170+
for bindir in `find $(brew --prefix)/opt -type d -follow -name gnubin -print`
171+
do
172+
export PATH=$bindir:$PATH
173+
done
174+
```
190175

191176
---
192177

193178
## Contributing
194179

195-
Refer to [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.
180+
Refer to [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.

0 commit comments

Comments
 (0)