Kubernetes: How do we List all objects modified in N days in a specific namespace?

9/10/2019

We have multiple people ( with admin access ) doing the deployments in kubernetes cluster. We are finding it difficult to manage who has modified which object.

We can control the access and privileges using RBAC with roles and role bindings. We are planning to implement well defined roles and rolebindings for different groups.

We would also want to list all objects modified in N days in a specific namespace. Is there a way to display the objects using kubectl? please let me know

-- P Ekambaram
kubectl
kubernetes

1 Answer

9/10/2019

This probably can't be done easily just with kubectl.

But you might look into Kubernetes auditing. It causes the API server to record all requests to the API, and you can query them in different ways. For example, it should be possible to query the audit logs for all the objects that have been specified in the last N days.

-- weibeld
Source: StackOverflow