Integrating existing agents into Kubernetes – Overcoming RAM/CPU Monitoring Hurdles

Hey folks. I’m seeking advice on integrating a product into a Kubernetes (k8s) environment. Currently, our approach was tailored for single host instances (bare-metal), and doesn’t seamlessly align with a Kubernetes infrastructure.

Let me provide more context. Our current practice involves attaching agents to database instances for monitoring and optimisation purposes. This monitoring encompasses tracking CPU usage (%) and RAM usage (%). Then we adjust database settings for optimal performance and set safeguards to revert changes if RAM spikes excessively (OOM).

While the traditional method of installing agents in a k8s Pod is feasible, the challenge lies in monitoring RAM/CPU usage. This is because the /proc is shared with the host machines, making the monitoring process seemingly impractical.

Any insights or suggestions on how to address this issue? How would you work with k8s on a problem like this?