Kubernetes Administration
medium

Questão de Kubernetes Administration #019e3a4f

Enunciado da Questão
Kubernetes Administration
#metrics-server
#resource-metrics
#kubernetes-api
Médio

What is the API that exposes resource metrics from the metrics-server?

A

custom.k8s.io

B

resources.k8s.io

C

metrics.k8s.io

Correta
D

cadvisor.k8s.io

Explicação Oficial / Explicações da Comunidade

The metrics-server collects resource metrics (CPU and memory usage) from nodes and pods and exposes them via the metrics.k8s.io API. This API is part of the Kubernetes API aggregation layer and is used by tools like kubectl top to display real-time resource usage.

How it Works

The metrics-server runs as a deployment in the kube-system namespace. It scrapes metrics from the kubelet's cAdvisor endpoint on each node, aggregates them, and serves them through the metrics.k8s.io API. This API is registered as an aggregated API, allowing kubectl and other clients to query it using standard Kubernetes API calls.

Why metrics.k8s.io is Correct

The metrics.k8s.io API group is the standard endpoint for resource metrics in Kubernetes. It is defined by the Kubernetes Metrics API specification and is implemented by the metrics-server. The API version is typically v1beta1 (e.g., /apis/metrics.k8s.io/v1beta1).

Why Other Options are Incorrect

  • custom.k8s.io: This API group is used for custom metrics, not resource metrics. Custom metrics are typically provided by adapters like the Prometheus adapter and are used for horizontal pod autoscaling based on custom application metrics.
  • resources.k8s.io: This is not a standard Kubernetes API group. Resource metrics are not exposed under this name.
  • cadvisor.k8s.io: cAdvisor is a component within the kubelet that collects container metrics, but it does not expose an API directly. The metrics-server scrapes cAdvisor data internally, but the external API is metrics.k8s.io.