Closed florin555 closed 8 months ago
Hi mate, I dug into this exact rabbit hole yesterday, as well. Welcome to the club :D
@florin555 Right, labels in kubernetes.io are now protected. Unless I am missing it, this would mean a departure between what k9s displays and what kubectl displays while listing the nodes as the proposed label won't show up in kubectl. If this is correct not sure if this is the best way to handle this??
In kubectl it is possible to display a custom column like this:
kubectl get node -o custom-columns='MY_ROLE:.metadata.labels.node\.kubernetes\.io/role'
# Example output
MY_ROLE
web
web
background
I was wondering if a feature would be possible in k9s to also specify such a custom column.
From a user perspective this would seem to be a feature that could work well with the k9s Resource Custom Columns specification https://github.com/derailed/k9s#resource-custom-columns
It would be great if one could select not only from predefine columns, but also define their own, similarly to how it is possible for kubectl using jsonpath.
Is your feature request related to a problem? Please describe. In our setup, since Kubernetes 1.16, we can no longer set the "kubernetes.io/role" label on nodes. Instead we have to use the "node.kubernetes.io/role" label. This does not show up in the "nodes" table in the "ROLE" column.
Describe the solution you'd like We would like to be able to configure the label that is used to read the node role that is displayed in the "ROLE" column.
Describe alternatives you've considered In the code I found that the labels "kubernetes.io/role" and "node-role.kubernetes.io/" are used. Unfortunately we can not use either of those.