-
Notifications
You must be signed in to change notification settings - Fork 545
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
can't collect KUB stats, plugin can't be used #3484
Comments
Some questions to move the diagnostics of the issue, until our maintainers can comment:
|
Thx for your very quick answer.. can't find what I'm doing wrong
what you've asked
sos has been installed manually (deb 12 still have 4.0.2).. so not in system path
kub does not appear in plugins, neither active , nor inactive .. strange
|
It could be that's running somehow sos 4.0.2, but it's strange that it failed 'bin/sos report --list-plugins'. |
sure.. 4.0.2 has been uninstalled (my first commands) to be sure .. I'm testing the magic module.. Here is what you've asked
|
I think I've found the problem and a possible solution - Add DebianPlugin like this: diff --git a/sos/report/plugins/kubernetes.py b/sos/report/plugins/kubernetes.py -from sos.report.plugins import Plugin, RedHatPlugin, UbuntuPlugin, PluginOpt @@ -205,7 +205,7 @@ class RedHatKubernetes(Kubernetes, RedHatPlugin): -class UbuntuKubernetes(Kubernetes, UbuntuPlugin):
I'm sending a PR now |
Add DebianPlugin to the list of imports and the class UbuntuKubernetes. Related: sosreport#3484 Signed-off-by: Jose Castillo <[email protected]>
Add DebianPlugin to the list of imports and the class UbuntuKubernetes. Related: #3484 Signed-off-by: Jose Castillo <[email protected]>
Hi José. Thx for the fix. tested on same server (git pull from sos directoty).. it produces some logs but I still have questions :
moreover some of the expected commands are described in the kubernetes.py plugin . how shall I get those infos ?
Thx ! |
Hi Hervé,
I'm not sure I understand. Can you paste the output you get with that command? This is what I get in my Debian cluster: $ bin/sos report -l The following plugins are currently enabled: [...] Which is the expected output, afaik.
What do you have in the file sos_logs/sos.log? That should tell you what the plugin tried to capture and if it failed or not. In my cluster, I get this: 2024-01-24 10:11:07,606 INFO: [plugin:kubernetes] added cmd output 'kubectl --kubeconfig=/etc/kubernetes/admin.conf get namespaces' Do you have something similar in your sos.log? |
Hi José Seems that all options are not active...
|
Hi Hervé, That's expected - the options are off by default:
If you want to enable them, you have to do it explicitly on the command line. I.e., with something like this:
Basically:
Try that and see if that works for your system. |
almost nothing root@k8s-worker2:/var/tmp# ls -al sosreport-k8s-worker2-2024-01-26-cxnmopp/sos_commands/kubernetes |
no news ? |
Hi Hervé, Apologies, I missed your last note. Let me try some tests in my Debian cluster and I'll update tomorrow. |
I was NOT on the master ... and did not noticed any warning message. Works fine on the master . Sorry. I will now try to deep dive into that logs. Thx |
in fact style have some questions. Some files are json, some other not. For instance, the
Those 2 commands could be replaced by how may I tweak your plugin to switch a command from "normal output" to "-o json" one ? My aim is to parse your output files .. Parsing a json with JQ is much more simpler as a simple "describe node" file .. Or may be we could have both ? Thx Rv |
I agree, parsing with I would prefer to have both text and json, I think we have a few plugins that do this already |
I think we do it nicely in the ceph_mon plugin, with a directory for the jsons. And in storcli we parse an option to get the dumps as json optionally, but we are probably better doing json and not json by default. I'll work on a PR tomorrow to make this happen. |
José ? I'm not very good in python (was bred with PERL).. but i managed to modify your plugin to get what i want
produces what expected
|
Hi Hervé, Nice one! But that gives you only the json one. Wouldn't you want both json and 'normal' (i.e. not json) output? |
json outputs are easier to parse than the default output, so lets capture these. Resolves: sosreport#3484 Co-authored-by: Hervé CHIBOIS Signed-off-by: Jose Castillo <[email protected]>
Hervé, I've created #3509 so we can discuss with the maintainers the next steps directly with code. One of the checks may fail because I've added you as co-author, but I don't have your email, so if you provide it I'll add you there as well. |
Fine for the #3509. Yes I think for almost all logs, the "human readable" version aka TEXT and the "machine readable" one aka JSON are interesting. I used to work with EMCgrabs for 10 years and there were no JSON/YAML/XML files .. our new world has thme now, we should be able to use them maybe I would see yet-another-option in your great tool "kubernetes.output= JSON |TEXT|BOTH" I have so many other improvments to propose to you... :-) my mail is [email protected] |
json outputs are easier to parse than the default output, so lets capture these. Resolves: sosreport#3484 Co-authored-by: Hervé CHIBOIS <[email protected]> Signed-off-by: Jose Castillo <[email protected]>
Can't figure how to make kub plugin correctly used. Does not appear in documentation, but present in plugin directory
Help please
The text was updated successfully, but these errors were encountered: