'Track API requests to each pod on my kubernetes cluster

I am trying to track all API requests to my kubernetes cluster running on some ec2 instances. How do I go about doing this?

I am basically trying to check which IP the request is sent from, any data sent and any other discerning information.

I tried using prometheus but have not had any luck so far.



Solution 1:[1]

You can enable Auditing on your cluster. For specific resource, use resourceNames in the audit policy to specify the resource name.

Solution 2:[2]

You can setup auditing in your Kubernetes Cluster. Refer to this link https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Anurag Tamrakar