-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a 'kubectl clusterinfo dump' option #20672
Conversation
Is this mostly just an alias for |
@smarterclayton more importantly (imho) it dumps the logs for each pod. You definitely could do this in bash, but it seems less useful. --brendan |
Ok - yeah, I don't have an issue with a mustgather style command. |
cc @kubernetes/kubectl @dchen1107 |
}, | ||
} | ||
cmd.Flags().String("output-directory", "", "Where to output the files. If empty or '-' uses stdout, otherwise creates a directory hierarchy in that directory") | ||
cmd.Flags().StringSlice("namespaces", []string{api.NamespaceSystem}, "A comma separated list of namespaces to dump.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dumping the system namespace by default makes sense, but differs from all other kubectl commands, where the current context provides the default namespace.
How about making the default kube-system plus the namespace from the current context?
I guess this assumes the master kubelet is registered, so we can collect control-plane logs. Is there a way to get Kubelet logs? |
The node proxy can be used to grab them, if they're enabled. |
@brendandburns Are you planning to finish this for 1.2? cc @dchen1107 |
BTW, |
Yes, I'm on finishing this for 1.2 (perhaps not the kubelet logs in this PR, tho) |
PR updated, please take another look. Thanks! |
@bgrant0607 friendly ping on this one... |
Please run hack/update-generated-docs.sh |
Ok. We can add more resources later, as necessary. How about a test? Otherwise, this is likely to bitrot. We're not starting to cherrypick yet. Added v1.2 milestone and cherrypick-candidate label. |
No activity. Removing from 1.2. |
@janetkuo friendly ping on this one. Thanks! |
@@ -43,6 +43,7 @@ func NewCmdClusterInfo(f *cmdutil.Factory, out io.Writer) *cobra.Command { | |||
}, | |||
} | |||
cmdutil.AddInclude3rdPartyFlags(cmd) | |||
cmd.AddCommand(NewCmdClusterInfoDump(f, out)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest removing clusterinfo
(L37 & L51) since it's deprecated more than 1 year ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest adding a hint of dump
when printing results of kubectl cluster-info
. Most parent commands will print help message with supported sub-commands, but kubectl cluster-info
doesn't do that. WDYT?
Something like,
$ kubectl cluster-info
Kubernetes master is running at http://xxx
...
To further debug and diagnose cluster problems, use `kubectl cluster-info dump`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather remove clusterinfo in a different PR
I added that note.
This should be mentioned in the help (in short/long description and/or examples). |
Comments addressed, please take another look. --brendan |
cmd := &cobra.Command{ | ||
Use: "dump", | ||
Short: "Dump lots of relevant info for debugging and diagnosis.", | ||
Long: dumpLong + "\n" + dumpExample, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add the example with Command.Example
:
Example: dumpExample,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
A few nits; otherwise LGTM. You'll need to run hack/update-generated-docs.sh also |
Comments addressed, docs generated. ptal. thanks! |
@brendandburns Tests failed |
Test fixed. ptal. |
LGTM. Squash and feel free to apply the tag. |
GCE e2e build/test passed for commit 178b5f7. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 178b5f7. |
Automatic merge from submit-queue |
Ref: #3500
@bgrant0607 @smarterclayton @jszczepkowski
Usage:
This change is