k9s icon indicating copy to clipboard operation
k9s copied to clipboard

Add a persistent popup for drain failures

Open fernferret opened this issue 3 years ago • 3 comments




Is your feature request related to a problem? Please describe. Implement a persistent drain popup on error. During a drain in k9s, if the drain fails, the toast at the bottom isn't quite enough to notify people of what's happened. It goes away quickly and is sometimes hard to see the error message. I'm usually left exiting k9s and just running a kubectl drain ....

Describe the solution you'd like I'm envisioning a simple solution to start like:

image

This would also open up the possibility for a progress dialog or with a context of "it's taking a while to drain..." that could solve https://github.com/derailed/k9s/issues/237#issuecomment-592061481

Describe alternatives you've considered The alternative is to leave it how it is which is fine, but it's bit several team members to the point where I've just told them to use kubectl drain ... instead.

Additional context I'm working on a PR to add the dialog as stated above with a configuration option (default disabled for backward compatability) as I'm sure some folks out there may not like an extra pop-up.

fernferret avatar Jun 13 '21 09:06 fernferret

@FernFerret I see can see the impetus for this as the flash is indeed short lived when an error occurred. First impressions:

  1. We must be consistent with this behavior for all error conditions occurring in k9s
  2. The dialog must visually pop a bit more imho

derailed avatar Jun 13 '21 15:06 derailed

  1. Sounds great, I'll see what I can do.
  2. Absolutely, I just threw this together to see how it felt, I'll get the styling shored up a bit as well as the layout

Thanks for the feedback, I'll put together a rev 2 of this one and then can make sure it looks good with other error dialogs.

fernferret avatar Jun 14 '21 21:06 fernferret

@derailed I'm still actually interested in this as it bites me, I'll try to get some work done on it at some point for your review.

fernferret avatar Aug 13 '22 08:08 fernferret

Expanding on this a little..

Performing drain in k9s seems to block, probably waiting on the API server. If I try to drain multiple nodes in quick succession then k9s appears to freeze (although it is still responsive to resizing of the terminal). If I wait several minutes then it recovers, but if instead I try pressing ESC or ^C then nothing immediately happens (it is as if the entire terminal has crashed).

So initiating a drain should pop up a window that both:

  • indicates that the process has commenced and k9s is trying to do something (and reaffirming what options were submitted).
  • contains the output messages (evictions, or inability to remove pods), and lingers until the window is dismissed by the user.

(This also interacts with #1788, in that it is confusing to debug drain problems if the messages are not properly made visible.)

benjimin avatar Feb 10 '23 21:02 benjimin