Skip to content
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

[kubernetes] add kube-system-log-files option, collect some kubelet files #3869

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

champtar
Copy link
Contributor

@champtar champtar commented Dec 11, 2024

2 small enhancements to the kubernetes plugin

I'm open to proposal for another name than kube-system-log-files:

The following plugin options are available:
 kubernetes.all            on              collect all namespace output separately
 kubernetes.describe       on              collect describe output of all resources
 kubernetes.podlogs        on              capture stdout/stderr logs from pods
 kubernetes.podlogs-filter                 only collect logs from pods matching this pattern
 kubernetes.kube-system-log-files off             copy some kube-system pod logs without using the API

Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname [email protected]?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?
  • Are all passwords or private data gathered by this PR obfuscated?

Having the config can be really helpful,
same for the cpu/memory manager state.

Signed-off-by: Etienne Champetier <[email protected]>
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3869
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@pmoravec
Copy link
Contributor

No secrets in newly collected data? (the env file: cant it contain some password?)?

Re the option name: I would prefer something shorter due to the alignment, what about kube-system-logs (still too long) or simply kubelogs?

I dont know kubernetes, so I evaluate the PR just from sos perspective.

@champtar
Copy link
Contributor Author

No secrets in newly collected data? (the env file: cant it contain some password?)?

On a kubeadm install, both files have chmod 644, and the parents folders have 755, so hopefully no secrets (I also looked at the docs but could have missed something)

Re the option name: I would prefer something shorter due to the alignment, what about kube-system-logs (still too long) or simply kubelogs?

will change to kubelogs, I can't find something short and self descriptive, but the long description is displayed right next to it

I dont know kubernetes, so I evaluate the PR just from sos perspective.

Copy link
Member

@TurboTurtle TurboTurtle left a comment

Choose a reason for hiding this comment

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

Code looks fine, pending the PEP8 failure for line 100 (just needs to be shortened).

Before I ack however - is there a reason we shouldn't just be collecting these regularly? I.E. not gated behind an option and just a default collection by the plugin?

@champtar
Copy link
Contributor Author

Code looks fine, pending the PEP8 failure for line 100 (just needs to be shortened).

Before I ack however - is there a reason we shouldn't just be collecting these regularly? I.E. not gated behind an option and just a default collection by the plugin?

Default kube log rotation is 10MB per file and keep 5 files, we collect 4 containers,
so that's 200MB uncompressed. Also it's redundant with podlogs option when API is working.

If your cluster is completely broken you can't gather
logs using kubectl / the API, so add an option to easily
copy logs from the most critical pods.

Signed-off-by: Etienne Champetier <[email protected]>
@TurboTurtle TurboTurtle added the Reviewed/Needs 2nd Ack Require a 2nd ack from a maintainer label Dec 12, 2024
@arif-ali arif-ali added Reviewed/Ready for Merge Has been reviewed, ready for merge and removed Reviewed/Needs 2nd Ack Require a 2nd ack from a maintainer labels Dec 12, 2024
@TurboTurtle TurboTurtle merged commit 279ea13 into sosreport:main Dec 13, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed/Ready for Merge Has been reviewed, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants