Skip to content

daemon: Add "datapath" opt to --debug-verbose flag#12568

Merged
aanm merged 2 commits intomasterfrom
pr/brb/debug-datapath-flag
Jul 21, 2020
Merged

daemon: Add "datapath" opt to --debug-verbose flag#12568
aanm merged 2 commits intomasterfrom
pr/brb/debug-datapath-flag

Conversation

@brb
Copy link
Copy Markdown
Member

@brb brb commented Jul 17, 2020

This PR adds a support for the "datapath" option to --debug-verbose

Adding the "datapath" to --debug-verbose enables debug messages produced by the datapath.

Previously, it could have been enabled for new endpoints by invoking cilium config Debug{,LB}=Enabled on each node, and for existing - by cilium config $EID Debug{,LB}=Enabled.

Added needs-backport/1.8, as it will ease debugging of 1.8 user datapath issues.

daemon: Add "datapath" opt to --debug-verbose flag to enable datapath debug messages

@brb brb added pending-review area/daemon Impacts operation of the Cilium daemon. release-note/minor This PR changes functionality that users may find relevant to operating Cilium. labels Jul 17, 2020
@brb brb requested a review from a team July 17, 2020 07:28
@brb brb requested review from a team as code owners July 17, 2020 07:28
@brb brb requested a review from a team July 17, 2020 07:28
@brb
Copy link
Copy Markdown
Member Author

brb commented Jul 17, 2020

test-me-please

Copy link
Copy Markdown
Member

@pchaigno pchaigno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

global.debugDatapath made more sense to me, but I'm not sure it matters that much either way 🤷

@joestringer
Copy link
Copy Markdown
Member

joestringer commented Jul 17, 2020

Minor nit, I wondered if you considered extending --debug-verbose instead for something like --debug-verbose=bpf. One less flag and would mean more of the verbose debug functionality can be found from the same commandline argument. If you think this would be better, feel free to adjust the PR for this approach but also feel free to disagree, I'm not adamant that it must be done this way :-)

Comment on lines +113 to +115
{{- if .Values.global.debug.datapath }}
debug-datapath: "{{ .Values.global.debug.datapath }}"
{{- end }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be part of config rather than global?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with those groupings. What's a logical difference between config and global?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config is part of the settings specific to the helm chart that deploys the Cilium configmap; global applies settings to the entire set of helm charts we generate. Recent discussions with @cilium/helm particularly around the time of v1.8 release established that our use of Helm is a bit unusual to the detriment of operators, and one of the areas we can improve is in using more chart-local variables rather than global variables.

@borkmann
Copy link
Copy Markdown
Member

Minor nit, I wondered if you considered extending --debug-verbose instead for something like --debug-verbose=bpf. One less flag and would mean more of the verbose debug functionality can be found from the same commandline argument. If you think this would be better, feel free to adjust the PR for this approach but also feel free to disagree, I'm not adamant that it must be done this way :-)

Or even reuse the existing flag instead of a new one. --debug is as-is for agent debug, but it could take a string: --debug={agent,bpf,all} to select in a more fine-grained manner. Noone aside from developers would be using --debug anyway, so I think it would be better to reuse than to add yet more agent flags.

Copy link
Copy Markdown
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good to me. I'd also like to +1 @borkmann's idea of reusing the same agent flags.

@joestringer
Copy link
Copy Markdown
Member

Just to be clear, debug-verbose isn't new, it already exists and takes a stringslice argument for extra verbosity arguments like @borkmann 's suggestion, the most common usage so far would be for --debug-verbose=flow to get some additional L7 configuration information.

@borkmann
Copy link
Copy Markdown
Member

Just to be clear, debug-verbose isn't new, it already exists and takes a stringslice argument for extra verbosity arguments like @borkmann 's suggestion, the most common usage so far would be for --debug-verbose=flow to get some additional L7 configuration information.

Good to know, wasn't aware of that. That sounds reasonable to me.

@brb
Copy link
Copy Markdown
Member Author

brb commented Jul 20, 2020

I cannot reuse --debug as it accepts bool, and changing its expected values would break existing installations. --debug-verbose SGTM.

@brb brb force-pushed the pr/brb/debug-datapath-flag branch from d4f433c to ebf60c5 Compare July 20, 2020 10:12
Adding the "datapath" to --debug-verbose enables debug messages produced
by the datapath.

Previously, it could have been enabled for new endpoints by invoking
"cilium config Debug{,LB}=Enabled" on each node, and for existing -
by "cilium config $EID Debug{,LB}=Enabled".

Signed-off-by: Martynas Pumputis <m@lambda.lt>
@brb brb changed the title daemon: Add --debug-datapath flag daemon: Add "datapath" opt to --debug-verbose flag Jul 20, 2020
@brb brb requested review from christarazi and joestringer July 20, 2020 10:14
@brb
Copy link
Copy Markdown
Member Author

brb commented Jul 20, 2020

test-me-please

@brb
Copy link
Copy Markdown
Member Author

brb commented Jul 20, 2020

PTAL.

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 20, 2020

Coverage Status

Coverage increased (+0.03%) to 37.028% when pulling 9230ce5 on pr/brb/debug-datapath-flag into 2aae988 on master.

@maintainer-s-little-helper maintainer-s-little-helper Bot removed the request for review from a team July 20, 2020 12:14
Copy link
Copy Markdown
Member

@aanm aanm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a note in the upgrade guide as this is a breaking change. Previous environments running with debug: true will no longer see any debug message when running with cilium monitor -v

Comment thread daemon/cmd/daemon_main.go

option.Config.Opts.SetBool(option.Debug, false)
option.Config.Opts.SetBool(option.DebugLB, false)
option.Config.Opts.SetBool(option.Debug, debugDatapath)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, perhaps it would be a good idea to add a note in the flag description of the debug flag that it no longer enables debug messages in the datapath and it should users should use debug-verbose=datapath instead.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Probably needs backport right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joestringer this PR is already marked for backport, was that your concern?

Copy link
Copy Markdown
Member

@aanm aanm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please add --debug-verbose=datapath in the contrib/vagrant/start.sh where we have --debug

@brb
Copy link
Copy Markdown
Member Author

brb commented Jul 20, 2020

@aanm My PR doesn't change the --debug behavior. It was changed quite some time ago by 583e67c. Do you think that we should still update the upgrade guide? Also IMHO, cilium monitor -v is used only by developers.

Copy link
Copy Markdown
Member

@aanm aanm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't aware that ee5e396 introduced this breaking change. Given that it did, yes we should describe it in the upgrade guide. If we start helping users where we ask them to run cilium with debug: true so that we can see debug messages in Cilium monitor we won't see debug messages and would waste more time until we could realize this was introduced by us.

Copy link
Copy Markdown
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming Andre's comments are addressed

Comment thread daemon/cmd/daemon_main.go

option.Config.Opts.SetBool(option.Debug, false)
option.Config.Opts.SetBool(option.DebugLB, false)
option.Config.Opts.SetBool(option.Debug, debugDatapath)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Probably needs backport right?

@brb brb requested a review from aanm July 21, 2020 11:36
Add a note to the upgrade guide how to enable datapath debug messages
which were disabled by [1] (released in v1.8.0).

[1]: 583e67c

Signed-off-by: Martynas Pumputis <m@lambda.lt>
@brb
Copy link
Copy Markdown
Member Author

brb commented Jul 21, 2020

@aanm PTAL - I've updated the upgrade guide. No integration tests (except for docs) need to be rerun, as the new commit touches only the docs (previously all the tests passed).

@aanm aanm merged commit 1173f18 into master Jul 21, 2020
@aanm aanm deleted the pr/brb/debug-datapath-flag branch July 21, 2020 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/daemon Impacts operation of the Cilium daemon. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants