derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
26.53k stars 1.66k forks source link

Can we get the full list of column names added to the documentation? #1495

Open vallamost opened 2 years ago

vallamost commented 2 years ago

Is your feature request related to a problem? Please describe.

The doc linked below shows that you can customize columns with K9s and after a bit of work to configure the XDG folder and env variable it does seem to work. However there are only a few columns in the example config. Can you please provide the full list of columns that can be customized either in the sample config or further down?

https://k9scli.io/topics/columns/

Describe the solution you'd like

Can you please provide the full list of column names that can be customized either in the sample config or further down on this page https://k9scli.io/topics/columns/?

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

tfrokt commented 2 years ago

Definitely second this. Great feature being able to customise columns. Without knowing which columns are available though, I can't use the full potential. Seems like a simple (obvious) add for a big win.

tfrokt commented 2 years ago
"AGE"
"CPU"
"CPU/R:L"
"IP"
"LABELS"
"MEM"
"MEM/R:L"
"NAME"
"NAMESPACE"
"NODE"
"NOMINATED NODE"
"PF"
"QOS"
"READINESS GATES"
"READY"
"RESTARTS"
"STATUS"
"VALID"
"%CPU/L"
"%CPU/R"
"%MEM/L"
"%MEM/R"

https://github.com/derailed/k9s/blob/a661221f0838b6ad6d3dd45745e7118311748d3f/internal/render/pod.go#L62

hosh commented 2 years ago

Some gotchas while editing views.yml:

  1. Parse errors of views.yml will silently fail, and sometimes the live update won't update
  2. For the column names starting with %, it needs to be quoted like so, "%CPU/R" for yaml to pick that up as a string
derailed commented 2 years ago

@vallamost This is a bit of an impossible request as each k8s resource will have different set of columns, no to mention crds... Best is to view the resource first and go wide with ctrl-w to see all available columns. Then decide which columns you would like to use and customize your views.yml accordingly. The config file is watched so you can add/delete/update at will. Also if you forgot a column name you can simply revert by insuring the resource name no longer matches in the views.yml. As @hosh correctly points out, you will need to tail the k9s logs to ensure the yaml parses out as custom views errors are currently not surfaced in the ui ;( As for @hosh #2 this is a yaml thing values must be valid strings ie no quotes needed if the column name starts with a letter or needs to be quoted if not. Hope this helps...

fragolinux commented 1 year ago

I've similar issues trying to extract field values for columns containing % sign in plugin.yml... example, in pod view, how to extract the value of "%MEM/R"? tried:

with 0 success...

a basic plugin

  get-resources:
    shortCut: Shift-N
    confirm: false
    description: get resources
    scopes:
      - pods
    command: sh
    background: false
    args:
      - -c
      - echo $NAME $NAMESPACE $COL-CPU $COL-MEM "$COL-%CPU/R" | less
#      - echo $NAME $NAMESPACE $COL-CPU $COL-MEM $COL-%CPU/R $COL-%CPU/L $COL-%MEM/R $COL-%MEM/L | less
derailed commented 1 year ago

@fragolinux Thanks for the heads up! I think the shell chokes on those cols. Could you please open a new issue as this is a bug in the var naming convention. Tx!

fragolinux commented 1 year ago

@derailed done, thanks!

felix-hilden commented 1 year ago

Actually @derailed, seeing all the available columns in wide mode would be an acceptable hint on the page! Also future-proof. Could we at least have that for the k9s newbies? 😄