k9s
k9s copied to clipboard
Open controller shortcut
In the pods view I usually want to open the controller of a specific pod (ReplicaSet -> Deployment, for example) and then restart the deployment, without navigating to the deployments view, filter them out and selecting the one I need.
It would be awesome if k9s supported this with a shortcut.
Agreed this could be a nifty feature. Should be relatively simple to determine - look up the resource's owner references and iterate to find an entry with controller: true
. Edge cases would be
- resource lacks owner references -> no-op
- has owner references but no controller -> no-op
@sralloza you mention pods but I don't see a reason to limit the feature to a particular resource. It would be useful to navigate "upward" from any resource, such as Pod -> ReplicaSet, EndpointSlice -> Service, or PVC -> PV.
I'm not familiar enough with the codebase to say how this would be implemented, but I can dig a little to gauge complexity.
Believe this is definitely doable. As predicted finding the controller resource is straightforward. The tricky part then seems to be changing the view to display the resource. In cases like hitting Enter
on a Deployment, the selector is used to lookup Pods. That won't work here as we want to display only the controller resource, regardless of selectors.
I gave it a shot with #2133, let me know what you think.
I was just looking for this feature! Also completley new to k9s, but would it be possible to jump to any kind of resource?
I often find myself going to the owning custom resource, like cert-manager certificates/challenges/orders etc, or CloudNative-PGs PostgresCluster (owns the pod) etc...
but would it be possible to jump to any kind of resource?
See my comment in the PR. I didn't find an easy way on first try. But it should be possible.
Duplicated by #2696 and solved with the merge of #2700.