kubectl-ice icon indicating copy to clipboard operation
kubectl-ice copied to clipboard

Colorizing output

Open ryphon opened this issue 2 years ago • 2 comments

Currently ice seems to output purely an off yellow output. Any chance it could be modified to output similar to kubecolor, or at least be configurable? Image of differences here: image

ryphon avatar Sep 16 '22 19:09 ryphon

I'm a little confused as ice doesn't set or change output colours but looking at the screen grab It seems like your shell is adjusting the output colours of the kubectl command.

As a test you could try running kubectl-ice instead of kubectl ice (notice the - ) hopefully that will prevent the shell from colouring the output.

NimbleArchitect avatar Sep 17 '22 16:09 NimbleArchitect

You know, I realize now I have kubectl aliased to kubecolor. That would do it. I still feel ice having colors could be very cool, but the yellow is definitely from me, so that's my bad.

ryphon avatar Sep 17 '22 17:09 ryphon

For anyone else that happens across this post please feel free to share ideas/suggestions/opinions

I've finally stopped long enough to have a bit of a think over the colours and the best I can come up with is to change colours for errors and warnings so we end up with something along the lines of the images below.

output from status subcommand showing good and bad colours example colours 1

output from status subcommand also showing warning colour example colours 2

memory subcommand showing percentage colours > 90% used is classed as bad (red), > 75% is a warning (yellow) and < 75% is ok (green) anyhing that cant be calculated is left white example colours 3

The only other idea I have is to colour the columns which looks nice but doesn't add any functionality

I would really like to get feedback on this so if you have any ideas or suggestions please do let me know

NimbleArchitect avatar Jan 19 '23 11:01 NimbleArchitect

I like your coloring a lot. Kubecolor adds some colors to the columns which is literally for looking nice, but also some level of accessibility. It's nice to have different colors to simplify reading through kubectl command columns, if even just to quickly differentiate between which column is which.

I really do think Kubecolor did a great job of it (even though it adds a bit of overhead, the readability is very nice) Means with any font or terminal I can easily read which columns are which.

ryphon avatar Jan 23 '23 18:01 ryphon

I couldn't make up my mind on this so I did both options, then added some more :wink:

--colour none remove all colouring --colour columns something that looks like kubecolour output --colour errors helps identify request and limit levels) --colour mix uses columns as the base colour then overlays the error colors as needed --colour custom allows you to chose your own colours (this also supports modifies so you can underline and flash columns on linux, more details will be in the help but the basic usage is kubectl-ice status --colour "custom;0.35;4.34;0.33;0.32;4.31"

you can also use the environment variable ICE_COLOR in your profile if you always want to see ice in colour.

I'll push out a new release and update the docs with better examples and info in due course

NimbleArchitect avatar Feb 07 '23 13:02 NimbleArchitect