k9s icon indicating copy to clipboard operation
k9s copied to clipboard

Custom resource links

Open thejoeejoee opened this issue 1 year ago • 0 comments




Is your feature request related to a problem? Please describe. Currently, the <ENTER> press is handled for some resources by displaying related resources. For all the other resources, the <ENTER> press is handled by displaying the resource describe. That's not intuitive for custom resources, where some kind of relations might be defined - e.g. ExternalSecrets from ESO and related secrets.

Describe the solution you'd like I'd like to have an option to define a custom behaviour for the <ENTER> press based on the selected resource. It would be based on source and target GVR, also with some kind of relation/filtering definition.

Describe alternatives you've considered As relations like Deployment -> Pods are already built-in in k9s, not all resources could be handled in the same way. There's custom resource definitions, and it's not possible to define all of them in k9s, especially those close-sources.

Additional context The definition could look like this, as is currently implemented in #2562:

external-secrets.io/v1beta1/externalsecrets:
  target: v1/secrets
  fieldSelector:
    metadata.name: .spec.target.name

cluster.k8s.io/v1alpha1/machines:
  target: v1/pods
  fieldSelector:
    spec.nodeName: .metadata.name

custom.io/v1/customparents:
  target: v1/customchildren
  labelSelector:
    parent: .metadata.name
    type: .spec.type

thejoeejoee avatar Feb 23 '24 14:02 thejoeejoee