yonahd / kor

A Golang Tool to discover unused Kubernetes Resources
MIT License
959 stars 91 forks source link

Feature: User Impersonation #299

Open logan-bobo opened 3 months ago

logan-bobo commented 3 months ago

Is your feature request related to a problem? Please describe. Currently we are using Kor to produce a report of unused resources across our K8s infra. Our users need to escalate to an admin user via user impersonation to run high risk activities such as a PVC delete. Currently if we try to use the delete commands it does not work because Kor does not accept a --as admin flag

Describe the solution you'd like Allow for a --as flag for running deletions from the Kor CLI

Describe alternatives you've considered Currently I have got around this by running Kor and outputting the resources to be cleaned to json then iterating over a list of resources and the kubectl command to delete the resource. It would be great if we could remove this step and allow for user impersonation.

logan-bobo commented 3 months ago

I am also willing to help out on this change and will attempt to push a PR if the maintainers think this to be a good idea 🫶

yonahd commented 3 months ago

Hi @logan-bobo this is definitely a good feature. I'm not super familiar with user impersonation so I'm not sure what the cost of adding and maintaining this would be. So I can't guarantee it will be added.

You're welcome to work on this and we can see what this requires, my feeling is this won't be too hard

yonahd commented 2 weeks ago

Hey @logan-bobo Did you start any work on this?