Checking Kubernetes pod CPU and memory
Blog post from Octopus Deploy
In the blog post by Matthew Casperson, methods for tracking CPU and memory usage of Kubernetes pods are explored, focusing on using the metrics server and cgroup interfaces. The metrics server offers a lightweight and scalable solution for monitoring resources in Kubernetes clusters, and while not inherently integrated, it is often easily enabled or bundled with clusters. With the metrics server installed, resource usage can be accessed via `kubectl top pod` and `kubectl top node` commands. In the absence of the metrics server, resource usage can be manually determined through cgroup interface files, though this requires entering an interactive session with a pod and performing calculations to convert raw CPU time into more useful measurements like CPU usage percentage. The text also highlights differences between cgroups v1 and v2 in terms of accessing resource metrics, noting the need for conversion between units of measurement.