You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/drafts/developer.md
+43-58Lines changed: 43 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,24 @@
1
+
1
2
## 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.
3
5
4
6
> [!NOTE]
5
7
> 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.
6
20
7
-
### Installation
21
+
### To Install Any Given Release
8
22
9
23
> [!CAUTION]
10
24
> 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
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
-
forbindirin`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
40
34
1. Install Instances of Custom Resources:
41
35
42
36
```sh
@@ -69,33 +63,20 @@ To undeploy the controller from the cluster:
69
63
make undeploy
70
64
```
71
65
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
-
87
66
### Modifying the API definitions
88
67
If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
89
68
90
69
```sh
91
70
make manifests
92
71
```
93
72
73
+
---
74
+
94
75
**NOTE:** Run `make help` for more information on all potential `make` targets.
95
76
96
-
### Rapid iterative development with Tilt
77
+
### Rapid Iterative Development with Tilt
97
78
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`:
99
80
100
81
[Tilt](https://tilt.dev) is a tool that enables rapid iterative development of containerized workloads.
101
82
@@ -105,8 +86,6 @@ Here is an example workflow without Tilt for modifying some source code and test
105
86
2. Build the container image.
106
87
3. Either push the image to a registry or load it into your kind cluster.
107
88
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.
110
89
111
90
This process can take minutes, depending on how long each step takes.
112
91
@@ -125,9 +104,7 @@ Follow Tilt's [instructions](https://docs.tilt.dev/install.html) for installatio
125
104
### Installing catalogd
126
105
127
106
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.
131
108
132
109
### Install tilt-support Repo
133
110
@@ -171,25 +148,33 @@ v0.33.1, built 2023-06-28
171
148
(ctrl-c) to exit
172
149
```
173
150
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.
175
158
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:
177
161
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
+
```
184
165
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:
186
168
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
+
forbindirin`find $(brew --prefix)/opt -type d -follow -name gnubin -print`
171
+
do
172
+
export PATH=$bindir:$PATH
173
+
done
174
+
```
190
175
191
176
---
192
177
193
178
## Contributing
194
179
195
-
Refer to [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.
180
+
Refer to [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.
0 commit comments