Skip to content

Commit b937a0c

Browse files
committed
docs: add debugging tips to DEVELOPMENT.md
Adds a 'Debugging the controller locally' section covering knobs that are not already in 'How to run the controller locally': - RUNTIME_NAMESPACE to scope the watch - --concurrent=1 to serialize reconciles for a clean trace - flux suspend for unrelated objects sharing the cluster Assisted-by: Claude/claude-opus-4-7
1 parent b4f379e commit b937a0c

1 file changed

Lines changed: 41 additions & 1 deletion

File tree

DEVELOPMENT.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,44 @@ Deploy `notification-controller` into the cluster that is configured in the loca
7777

7878
```sh
7979
make deploy
80-
```
80+
```
81+
82+
## Debugging the controller locally
83+
84+
When reproducing an issue or stepping through reconciliation logic, the
85+
following knobs make local runs cheaper and the resulting logs easier to
86+
read.
87+
88+
### Limit the watched namespace
89+
90+
The controller watches every namespace by default. To narrow it to a single
91+
namespace, set the `RUNTIME_NAMESPACE` environment variable before invoking
92+
`make run`:
93+
94+
```sh
95+
RUNTIME_NAMESPACE=flux-system make run
96+
```
97+
98+
### Reduce reconcile concurrency
99+
100+
Each `Alert`, `Provider`, and `Receiver` reconcile is processed concurrently
101+
(default `--concurrent=4`). When debugging it is almost always easier to
102+
follow a serial trace; pass `--concurrent=1` so reconciles run one at a
103+
time:
104+
105+
```sh
106+
go run ./main.go --concurrent=1
107+
```
108+
109+
### Suspend unrelated objects
110+
111+
If the controller is sharing a cluster with other Flux objects, suspend
112+
anything not relevant to the test you're running so their reconciles don't
113+
interleave with yours:
114+
115+
```sh
116+
flux suspend alert <name>
117+
flux suspend receiver <name>
118+
```
119+
120+
Resume them with `flux resume` when you're done.

0 commit comments

Comments
 (0)