derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
27.54k stars 1.73k forks source link

View all Dependents for specific object #2047

Open mnacharov opened 1 year ago

mnacharov commented 1 year ago

Is your feature request related to a problem? Please describe. It's quite hard to find resource Dependents in k9s UI right now

Describe the solution you'd like implement command like:dp pvc which shows all dependent pvc

Describe alternatives you've considered It would be great to have a command which shows all dependent resources regardless of their kind

Additional context Some gitops solutions provides this feature, f.e. ArgoCD WebUI:

Screenshot 2023-04-07 at 15 21 09
placintaalexandru commented 1 year ago

Hello @mnacharov

I think I solved this at the plugin level using the kubectl lineage plugin which i installed using krew:

plugin:
  dependency:
    shortCut: Ctrl-V
    scopes:
      - all
    command: sh
    args:
      - -i
      - -c
      - "kubectl lineage $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT && tail -f /dev/null"

I had to add some workaround even for the plugin (like tail -f /dev/null part which can be replaced with a sleep). Without the tail, k9s gets closed with the TTY being suspended. I hope this helps you.