Skip to content

Added plugin to download full container logs #2221

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maabiddevra
Copy link

Added a new plugin command to download full container logs to local, it is useful when logs are very large after downloading can check the logs easily on local.

Command shortcut:- Ctrl-D

Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

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

@maabiddevra Thank you for this PR. Just a couple comments

@@ -53,3 +53,13 @@ plugin:
- $NAMESPACE
- --context
- $CONTEXT
download-container-logs:
shortCut: Ctrl-D
description: "download full log"
Copy link
Owner

Choose a reason for hiding this comment

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

I think it would be good to indicate to the users where the logs will be downloaded.

background: true
args:
- -c
- "kubectl logs -n $NAMESPACE $POD -c $NAME --context $CONTEXT > $POD.log"
Copy link
Owner

Choose a reason for hiding this comment

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

Do we want the download to land in the cwd?

Copy link
Author

Choose a reason for hiding this comment

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

yes it will download to current working directory, or i can change it to $HOME ?

Copy link
Owner

Choose a reason for hiding this comment

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

log files have the potential to be sizeable and possibly ephemeral, wondering if parking them in tmp might be a better solution?

Copy link

Choose a reason for hiding this comment

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

Perhaps add a config setting so the user can define where logs should be downloaded to.
$HOME seems like a reasonable default. /tmp can be very small on security hardend systems.
If size is an issue, compress it on the fly.

@derailed derailed added question Further information is requested needs-tlc Pr needs additional updates labels Nov 12, 2023
@derailed
Copy link
Owner

derailed commented Jan 4, 2024

@maabiddevra It looks like there is conflict with the latest drop. Could you update your pr? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-tlc Pr needs additional updates question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants