Skip to content

docs: add debugging tips to DEVELOPMENT.md - #2034

Closed
alliasgher wants to merge 2 commits into
fluxcd:mainfrom
alliasgher:docs/666-debugging-tips
Closed

docs: add debugging tips to DEVELOPMENT.md#2034
alliasgher wants to merge 2 commits into
fluxcd:mainfrom
alliasgher:docs/666-debugging-tips

Conversation

@alliasgher

@alliasgher alliasgher commented Apr 19, 2026

Copy link
Copy Markdown

What this PR does

Expands DEVELOPMENT.md with a Debugging tips section under "How to run the controller locally", covering the items listed in #666:

  • RUNTIME_NAMESPACE — restrict watched namespaces to reduce noise
  • --concurrent=1 — serialise reconcile loops for easier tracing
  • HOSTNAME — set controller identity for local leader election
  • Suspending irrelevant objects — patch spec.suspend: true on unrelated resources
  • Scaling down the in-cluster controller — avoid competing reconciliations

Fixes #666.

Assisted-by: Claude/claude-opus-4-7

Expand the local development guide with concrete tips for debugging
controller issues, as requested in fluxcd#666:

- RUNTIME_NAMESPACE env var to limit watched namespaces
- --concurrent=1 flag to serialise reconcile loops
- HOSTNAME env var for leader election identity
- How to suspend irrelevant Flux objects to reduce log noise
- How to scale down the in-cluster deployment to avoid conflicts

Signed-off-by: Ali <alliasgher123@gmail.com>
Assisted-by: Claude/claude-opus-4-7
@alliasgher
alliasgher force-pushed the docs/666-debugging-tips branch from b7ec8f4 to 17f7fc6 Compare April 26, 2026 13:55
@SyedAsadRazaDevops

SyedAsadRazaDevops commented Jun 11, 2026

Copy link
Copy Markdown

Small issue with the make run ARGS=--concurrent=1 example: the current run target does not pass ARGS through to go run, so --concurrent=1 would not reach the controller.

Could this either use a direct go run ... --concurrent=1 example that preserves the existing --storage-adv-addr=:0 and --storage-path=$(PWD)/bin/data flags, or update the Makefile to support extra run args?

The Makefile run target does not pass ARGS through to go run, so the
make run ARGS=... example silently dropped the flag. Use go run directly
with the same storage flags the run target sets.

Signed-off-by: Ali <alliasgher123@gmail.com>
@alliasgher

Copy link
Copy Markdown
Author

Good catch, fixed in a1ba6ca using a direct go run invocation with the run target's storage flags.

@alliasgher

Copy link
Copy Markdown
Author

Closing this. Two of the three tips were wrong rather than merely imprecise, and once they are removed there is not enough left to justify a review cycle.

For the record, so this is searchable if anyone tries the same thing later:

  • Limit the watched namespace was wrong. RUNTIME_NAMESPACE is only read when --watch-all-namespaces is false, and that flag defaults to true, so the documented command had no effect. @stefanprodan also made the stronger point that narrowing the watch would hide cross-namespace behaviour you often need while debugging, so the section should not exist even in a corrected form.
  • Reduce reconcile concurrency was backwards as general advice: goroutine leaks, deadlocks and races only surface under concurrency, and it is redundant once unrelated objects are suspended.
  • Suspend unrelated objects was the only sound tip, and it amounts to mentioning that flux suspend <kind> --all exists, which is not worth a PR on its own.

Thanks @stefanprodan for the review that caught this, and apologies to the other repos for receiving the same wrong text. If a maintainer does want a debugging section in DEVELOPMENT.md, I am happy to write one from scratch against what the flags actually do.

@alliasgher alliasgher closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve documentation on debugging the controller locally

2 participants