This operator listens for all cluster events, filters events concerning pods, logs these events, and stores metrics that are then exported to Prometheus by an http server that the controller runs concurrently on a 'green thread'. Metrics include information such as the Pod ID and the server's UTC time of the event.
- Event Monitoring: Captures all Kubernetes cluster events.
- Pod Filtering: Focuses on pod-specific events.
- Logging: Logs pod events using the
tracingcrate. - Metrics Exporting: Stores metrics with the
metricscrate and exposes them to prometheus via a/metricsendpoint using anAxumserver withaxum_prometheus_exporter.
- A running Kubernetes cluster, or a local cluster created with Kind.
- Rust and Cargo installed on your system.
git clone https://github.com/Grsaiago/k8rs/tree/main <where_you_want_to_clone>
cd <where_you_want_to_clone>kind create cluster --config kind-cluster.ymlYou can optionally build a release binary version of the operator:
cargo build --releaseBut this should work as well (but it'll be a debug build):
cargo runNow, whenever you run or delete a pod:
You should see the following in the Operator's console:
If you see the logs, don't forget to check out your localhost:8080/metrics to see
the metrics being correctly exported to Prometheus.

