We have an Kubernetes cluster (AWS EKS) with numerous identical micro workloads. Developers use them for feature testing before it gets to staging. External devices connect to these workloads. Topoligy is really simple:
External device -> Classic Loadbalancer-> NodePort service -> Statefulset
Once developers are done with their work, the workloads are no longer used. I label a workload as not used when there are no connections thru the path described above. Thare are no connections from external device, that is.
Are there any mechanism, plugin or whatever which can monitor/measure inbound traffic to either Kubernetes service or pod? I could, based on the connections number, decide whether to delete the workload.
Most of monitoring tools for traffic monitoring in Kubernetes cluster you can find here: traffics monitoring.
I highly recommend you to use Prometheus.
It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true.
There are many option to integrate it with tools eg. Grafana to present and aggregate the collected information.
You can also use Jaeger which is a tracing system released by Uber Technologies; it's used for troubleshooting and monitoring transactions in complex distributed systems.
Take a look on useful article: monitorig.