k9s icon indicating copy to clipboard operation
k9s copied to clipboard

Custom columns with paths

Open nadenf opened this issue 4 years ago • 22 comments

Problem I would like to have a new column in the Pods view to show a particular node selector label: .spec.nodeSelector.type

Solution Allow for an optional path field to be provided by the user for each column:

k9s:
  views:
    v1/pods:
      columns:
        - name: NAME
        - name: AGE
        - name: TYPE
          path: .spec.nodeSelector.type
        - name: APP
          path: nodeLabels.app

It would actually mimic the behaviour of kubectl:

kubectl get pod -o=custom-columns=TYPE:.spec.nodeSelector.type

And would solve https://github.com/derailed/k9s/issues/605 as well.

nadenf avatar Jun 05 '20 06:06 nadenf

First of all I would like to say that k9s is the most useful tool in whole k8s ecosystem for me. Thank you @derailed for making it available.

It's very good suggestion by @nadenf Personally I was searching how could I add additional custom column to my nodes view, for example availability zone which comes from .metadata.labels.topology.kubernetes.io/zone=eu-west-1a in my case.

justinaslelys avatar Jul 03 '20 11:07 justinaslelys

Found this while also looking for a way that I could conveniently display the zone for my nodes view... Sounds like this would be a great way to accomplish that and more!

cotej avatar Jul 28 '20 18:07 cotej

This is an absolute killer feature !

Xyaren avatar Oct 01 '20 14:10 Xyaren

This would be a great feature ! I am looking for a way to add a custom column to display a CRD specific field. In fact we are leveraging flux and the helm operator for deployment and we are deploying a lot of HelmRelease CRDs. In order to view that a HelmRealse has been updated I would like to display the .spec.chart.version as a column.

sgandon avatar Dec 21 '20 09:12 sgandon

inspired by this, i created a k9s plugin to do reconcile and resume/suspend on helmreleases, kustomizations and git sources

fragolinux avatar May 16 '21 19:05 fragolinux

i added a plugin to allow showing of suspended resources, till custom columns based on spec will be available: https://github.com/derailed/k9s/pull/1584

fragolinux avatar Jun 03 '22 09:06 fragolinux

A little over two years old, this would be a great feature. Lens looks fine, but I'd prefer to stick to k9s.

natdm avatar Jun 29 '22 17:06 natdm

@derailed sounds like must have feature. so much use cases in my head for custom columns. please think about that. On next v0.26.6 :)?

danielrubin1989 avatar Sep 24 '22 18:09 danielrubin1989

Absolutely useful for PVs so I can see which AZ/region they're in. Same for nodes.

danielloader avatar Apr 04 '23 14:04 danielloader

It would be super useful for our Custom Resources which have a lot of annotations and labels that we would like to be able to filter easily.

Of course I can use e.g. -o 'custom-columns=NAME:.metadata.name, DESCRIPTION:.metadata.annotations.description' in kubectl get but I love k9s so much that I really hope it can have this feature ❤️

Taiquan-Liu avatar Apr 14 '23 08:04 Taiquan-Liu

found this because I want to display the csi.volume.kubernetes.io/nodeid annotation and the topology.kubernetes.io/zone label

thanks so much for k9s ❤️

hotzen avatar Aug 24 '23 07:08 hotzen

I'm a big fan of k9s! Just came accross the views.yml and it would be so cool to have it to work with paths!

fred161 avatar Sep 14 '23 12:09 fred161

+1

loquilloll avatar Sep 15 '23 20:09 loquilloll

I vote for it as well!

  • 1

smangels avatar Sep 28 '23 11:09 smangels

+1 for this

matiaszilli avatar Oct 16 '23 09:10 matiaszilli

+1

saedx1 avatar Nov 14 '23 23:11 saedx1

+1

diegodiaz1256 avatar Dec 03 '23 13:12 diegodiaz1256

+

It would be great to see custom FluxCD Kustomization .spec.suspend column in a single Kustomization view.

qlimenoque avatar Jan 24 '24 09:01 qlimenoque

Hey checking in here, is this available in the latest k9s release? would love to see a column in my pods view showing availability zone

nirajvora1 avatar Mar 21 '24 17:03 nirajvora1

+1

foglienimatteo avatar Apr 19 '24 12:04 foglienimatteo

In a world where code is king, and GitHub's the court, Where programmers commune to build and support. There's a tiny transgression, a seemingly slight act, That, repeated again and again, becomes a tract.

On threads of code, a vast digital sea, A chorus emerges, "I agree!", "Count me!", But alas, what's this, not words, but ardor plain, The "+1" comment audaciously staking its claim.

It's tiny, it's quick, it seems so neat, But does it help? Or simply repeat? "On GitHub, our realm," developers lament, "These '+1s' clutter up our environment."

A scroll, a scroll, so many to review, Beneath each proposal, "+1", "Me too!" While the thoughtful, insightful, lose their hue, In a surging sea of '+1', they're lost to view.

Votes of support, they seem at a glance, But in the clutter, do our codes advance? We squint our eyes, we sift, we squander, In this "+1" storm, too much to ponder.

So here's a plea, a method less mundane, A way to cast your vote without pain. Use the "+1" reaction, let your conservatism recede, In a cleaner thread, we all can proceed.

Hover your pointer, the emoji's right there, A tidy '+1', floating in air. Just a click, and voila, your vote is cast, No lengthy scroll, the clutter reduced, at last!

"Ah," you sigh, "Our threads are so clear!" "+1" in comments? No, not here. Reduced to meaning, stripped of the frivolous, Each issue, crisp; each comment, meticulous.

So next time on GitHub, when the pull requests dance, Choose the "+1" emoji, give clarity a chance. Let not our efforts be merely symbolic, In this realm of code, let's be methodically stoic.

-- GPT-4 Prompt: can you write me a poem about "why people commenting +1 on github is really irritating and how they should use the +1 reaction instead"?

GlacierWalrus avatar Apr 19 '24 18:04 GlacierWalrus