Skip to content

DRAFT: Allow (Pod) label values as table columns #3076

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

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

Conversation

KevinGimbel
Copy link

Doesn't work yet.

I'm unsure if the direction is correct.

The idea from #3050 is to allow custom pod labels to be used as column values in the pod view.

For example:

  • given a pod with a Label severity=high
  • the following views.yaml config
# views.yaml
views:
  v1/pods:
    columns:
      - name: NAME
      - name: LABEL
        key: severity

would result in the following k9s view table being rendered

NAME    severity   STATUS   READY
my-pod  hight      Running  1/1

Potentially, this could be used for all resources but I don't know where to best place the code.

@KevinGimbel KevinGimbel marked this pull request as draft January 23, 2025 09:42
@KevinGimbel KevinGimbel mentioned this pull request Jan 23, 2025
@KevinGimbel
Copy link
Author

Another idea from #3011

views:
   v1/nodes:
      columns:
          - Capacity-Type: .metadata.labels.eks\.amazonaws\.com/capacityType
          - Instance-Type: .metadata.labels.eks\.amazonaws\.com/instance-type
          - AZ: .metadata.labels.topology\.kubernetes\.io/zone

This would add a key-value mapping where the key is the column name, and the value is the (label) source.

@derailed
Copy link
Owner

@KevinGimbel Thank you for taking a crack at this. I think we would need a more generic solution here to handle more than labels. Please see the update in v0.40.0

@derailed derailed added the enhancement New feature or request label Feb 16, 2025
@KevinGimbel
Copy link
Author

I just found #2953 which also worked on this feature.

@KevinGimbel
Copy link
Author

Oh wow! I just saw the notes on 40.0.0 (https://github.com/derailed/k9s/releases/tag/v0.40.0) - I'll rebase my branch and see where to build from there - or open a new PR! :)

@derailed
Copy link
Owner

@KevinGimbel Thank you Kevin! Please let us know if the impl needs additional TLC...

@derailed derailed added the in-flight PR is already implemented label Mar 12, 2025
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in-flight PR is already implemented stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants