docs: add debugging tips to DEVELOPMENT.md#1646
docs: add debugging tips to DEVELOPMENT.md#1646alliasgher wants to merge 1 commit intofluxcd:mainfrom
Conversation
stefanprodan
left a comment
There was a problem hiding this comment.
The debugging info is already covered in "How to run the controller locally". The added text contains inaccurate info, you can not run SC locally as KC can not reach it, there is no mention of the ENV VAR, etc.
@alliasgher did you actually tested this? Did you used AI to generate this text, if so you need to disclose it, see fluxcd/flux2#5848
143768e to
f9b8044
Compare
|
Thanks for the catch @stefanprodan, you are right on all three points. AI assistance disclosed ( Fixed in f9b8044: I removed the 'Cross-controller interactions' paragraph entirely. The cross-controller setup is already covered correctly in 'How to run the controller locally' via What is left is just |
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 --concurrent-ssa=1 to serialize reconciles and server-side apply for a clean trace - flux suspend kustomization for unrelated objects sharing the cluster Cross-controller setup with source-controller (port-forward + SOURCE_CONTROLLER_LOCALHOST) is already documented under 'How to run the controller locally' so it is not duplicated here. Assisted-by: Claude/claude-opus-4-7 Signed-off-by: alliasgher <alliasgher123@gmail.com>
f9b8044 to
1c47faa
Compare
| The controller watches every namespace by default. To narrow it to a single | ||
| namespace, set the `RUNTIME_NAMESPACE` environment variable before invoking | ||
| `make run`: |
There was a problem hiding this comment.
Setting RUNTIME_NAMESPACE does not restrict the watchers, it just tells the controller in which namespace it runs. Watching only the flux-system namespace would break debugging so there is no point in having this Limit the watched namespace section.
| ### Reduce reconcile concurrency | ||
|
|
||
| Each `Kustomization` reconcile is processed concurrently (default | ||
| `--concurrent=4`, plus an independent `--concurrent-ssa=4` for server-side | ||
| apply). When debugging it is almost always easier to follow a serial | ||
| trace; pass `--concurrent=1 --concurrent-ssa=1` so reconciles and SSA | ||
| operations run one at a time: |
There was a problem hiding this comment.
How would you debug goroutine leaks, dead locks and other issues that only surface when concurrency is used? Also if you suspend all objects but the one you are debugging, then setting --concurrent=1 has no effect.
| interleave with yours: | ||
|
|
||
| ```sh | ||
| flux suspend kustomization <name> |
Summary
Adds a 'Debugging the controller locally' section to
DEVELOPMENT.mdcovering knobs not already in 'How to run the controller locally':RUNTIME_NAMESPACEto scope the watch--concurrent=1 --concurrent-ssa=1to serialize reconciles and SSA for a clean traceflux suspend kustomizationfor unrelated objects sharing the clusterCross-controller setup with source-controller (port-forward +
SOURCE_CONTROLLER_LOCALHOST) is already documented under 'How to run the controller locally' and is not duplicated here.Assisted-by: Claude/claude-opus-4-7