Kubernetes v1.37: Metrics API ... Note

Kubernetes v1.37: Metrics API graduates to stable

Kubernetes v1.37 has promoted the metrics.k8s.io API to stable v1. This API provides essential CPU and memory usage data for nodes and Pods. It underpins critical functionalities like kubectl top and resource-metrics-based autoscaling. For cluster operators and developers, this graduation signifies the API's guaranteed stability. The v1 API retains the same resource types and fields as its v1beta1 predecessor. Introduced as alpha in v1.6, the Resource Metrics API became beta in v1.8 and has been reliably used in production for years. The API exposes NodeMetrics for node resource usage and PodMetrics for Pod resource usage, including per-container breakdowns. It deliberately offers only the metrics necessary for autoscaling and basic inspection, not a full monitoring solution. The v1 API surface is identical to v1beta1, excluding only the API version itself. While kubectl top supports both versions, preferring v1, the Horizontal Pod Autoscaler controller currently only supports v1beta1. No feature gate needs to be enabled, as the API is served via API aggregation by implementations like metrics-server. To make v1 available, implementations must serve it and have an associated APIService registered. During this transition, implementations should continue serving both v1 and v1beta1 for backward compatibility.