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

retry tail on crashed pods #68

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

Conversation

bryanlarsen
Copy link

Hack / proof of concept fix for #67.

Wrap the follow of an individual pod in a "while true" loop to keep monitoring a pod after it crashes and restarts.

Probably breaks horribly if you try and use kubetail without follow.

Hack / proof of concept fix for johanhaleby#67.

Wrap the follow of an individual pod in a "while true" loop to keep monitoring a pod after it crashes and restarts.

Probably breaks horribly if you try and use kubetail without follow.
@johanhaleby
Copy link
Owner

Thanks @bryanlarsen for helping out! I'm a bit hesitant to accept this in its current state though. I'd really love to include something like this in kubetail but I'm not sure how to best achieve it.. I've actually made some attempts previously using named pipes (see here) but I was unable to get it working. My hope would be to get "named pipes" working and somehow run a kubetail process that watches for changes to pods matching the supplied criteria and if changes occur it should add the detected changes to the pipe.

I.e. if I start kubetail with kubetail my-service it should create a named pipe that is tailed by tail. In the background the command discovering pods matching my-service is run in the background. If changes are detected, for example if a new pod matching my-service is deployed, then the this will be detected and its stream will be routed to the already existing "named pipe".

Are you familiar with any of this? If so would be feasible?

@bryanlarsen
Copy link
Author

Your approach certainly sounds a lot more capable than mine. Mine is only able to follow existing pods through a crash / restart cycle, yours can find new ones.

Re: your original comment on your pipes issue, a quick Google found this https://unix.stackexchange.com/questions/146756/forward-sigterm-to-child-in-bash/444676#444676 . Dunno if that would help. Certainly if you can get your named pipes approach to work it's definitely better than my PR. OTOH, mine's pretty simple although it definitely cannot be applied as is -- I sent it more as a proof of concept.

@johanhaleby
Copy link
Owner

Thanks for the link. I actually tried again after you raised the issue but I couldn't get it working :/ But I'll check your link when I find time and try again :) I'm sure it must work somehow :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants