Kubernetes v1.37: Metrics API Stabilization and Its Impact
The promotion of the metrics.k8s.io API to stable in Kubernetes v1.37 is a game changer for cluster monitoring. This API allows you to retrieve CPU and memory usage metrics for both nodes and Pods, which is essential for making informed decisions about resource allocation and autoscaling. With commands like kubectl top, you can easily access this data, which is vital for maintaining optimal performance in production environments.
The Metrics API operates through the API aggregation layer and requires an implementation, such as metrics-server, to function. To utilize the v1 metrics API, your chosen implementation must serve the v1.metrics.k8s.io API, and you must register an associated APIService. This setup ensures that you can efficiently query metrics data, enabling features like resource-metrics-based autoscaling. For example, you can run kubectl get --raw /apis/metrics.k8s.io/v1/nodes to fetch node metrics or kubectl get --raw /apis/metrics.k8s.io/v1/namespaces/default/pods for Pod metrics, including a per-container breakdown.
In production, leveraging the metrics.k8s.io API effectively can lead to significant performance improvements. Since it has been in the ecosystem since Kubernetes v1.6, it has matured through alpha and beta stages, ensuring stability and reliability. You don’t need to enable any feature gates, making it straightforward to implement. Just ensure that your metrics implementation is correctly configured and registered to take full advantage of this API's capabilities.
Key takeaways
- →Utilize the metrics.k8s.io API for real-time CPU and memory metrics.
- →Implement metrics-server or a compatible solution to access the v1 metrics API.
- →Run commands like `kubectl get --raw /apis/metrics.k8s.io/v1/nodes` for node metrics.
- →Use `kubectl top` to monitor resource usage effectively.
- →No feature gates are required to enable the Metrics API.
Why it matters
This stabilization means you can rely on the metrics.k8s.io API for critical monitoring and autoscaling tasks, enhancing your cluster's performance and resource management.
Code examples
kubectl get --raw /apis/metrics.k8s.io/v1/nodeskubectl get --raw /apis/metrics.k8s.io/v1/namespaces/default/podskubectl get apiservice v1.metrics.k8s.ioWhen NOT to use this
The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.
Want the complete reference?
Read official docsIndustry-standard certifications built by the people behind Linux and Kubernetes. Earn the CKA — the gold standard Kubernetes administrator cert. OpsCanary readers get 30% off year-round with code OPSCANARY3.
Get CKA certified →Kubernetes on Edge Day: Elevating Distributed Cloud Native Workloads
Kubernetes on Edge Day is back at KubeCon + CloudNativeCon North America 2026, and it’s crucial for engineers working with distributed systems. This event dives deep into observability and security, two pillars that are essential when managing cloud native workloads across various locations.
From 40 Seconds to Under 10: Revolutionizing Incident Detection with OpenTelemetry, Kafka, and Flink
Incident detection can make or break your system's reliability. By leveraging OpenTelemetry, Apache Kafka, and Apache Flink, you can reduce detection times from 40 seconds to under 10. This article dives into the architecture that powers this transformation.
Observability Day 2026: Bridging Gaps in Cloud Native Monitoring
Observability Day at KubeCon + CloudNativeCon North America 2026 is a must-attend for anyone serious about monitoring in Kubernetes environments. This event unites maintainers and practitioners to tackle the evolving challenges of observability, especially with the recent graduation of OpenTelemetry. Don't miss out on the chance to learn from the community and enhance your observability strategies.
Get the daily digest
One email. 5 articles. Every morning.
No spam. Unsubscribe anytime.