Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,11 @@ In order for it to access these APIs, cluster administrators must ensure that:
generally provided by [metrics-server](https://github.com/kubernetes-sigs/metrics-server).
It can be launched as a cluster add-on.

{{< note >}}
The HorizontalPodAutoscaler currently supports the `metrics.k8s.io/v1beta1`
API for resource metrics. It does not support `metrics.k8s.io/v1` yet.
{{< /note >}}

- For custom metrics, this is the `custom.metrics.k8s.io` [API](/docs/reference/external-api/custom-metrics.v1beta2/).
It's provided by "adapter" API servers provided by metrics solution vendors.
Check with your metrics pipeline to see if there is a Kubernetes metrics adapter available.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The architecture components, from right to left in the figure, consist of the fo
<!-- body -->

## Metrics API
{{< feature-state for_k8s_version="1.8" state="beta" >}}
{{< feature-state for_k8s_version="1.37" state="stable" >}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use fg name instead of manually change versions here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't have an FG name before; what's the best way to write it?


The metrics-server implements the Metrics API. This API allows you to access CPU and memory usage
for the nodes and pods in your cluster. Its primary role is to feed resource usage metrics to K8s
Expand All @@ -100,24 +100,24 @@ Here is an example of the Metrics API request for a `minikube` node piped throug
reading:

```shell
kubectl get --raw "/apis/metrics.k8s.io/v1beta1/nodes/minikube" | jq '.'
kubectl get --raw "/apis/metrics.k8s.io/v1/nodes/minikube" | jq '.'
```

Here is the same API call using `curl`:

```shell
curl http://localhost:8080/apis/metrics.k8s.io/v1beta1/nodes/minikube
curl http://localhost:8080/apis/metrics.k8s.io/v1/nodes/minikube
```

Sample response:

```json
{
"kind": "NodeMetrics",
"apiVersion": "metrics.k8s.io/v1beta1",
"apiVersion": "metrics.k8s.io/v1",
"metadata": {
"name": "minikube",
"selfLink": "/apis/metrics.k8s.io/v1beta1/nodes/minikube",
"selfLink": "/apis/metrics.k8s.io/v1/nodes/minikube",
"creationTimestamp": "2022-01-27T18:48:43Z"
},
"timestamp": "2022-01-27T18:48:33Z",
Expand All @@ -133,25 +133,25 @@ Here is an example of the Metrics API request for a `kube-scheduler-minikube` po
`kube-system` namespace and piped through `jq` for easier reading:

```shell
kubectl get --raw "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/kube-scheduler-minikube" | jq '.'
kubectl get --raw "/apis/metrics.k8s.io/v1/namespaces/kube-system/pods/kube-scheduler-minikube" | jq '.'
```

Here is the same API call using `curl`:

```shell
curl http://localhost:8080/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/kube-scheduler-minikube
curl http://localhost:8080/apis/metrics.k8s.io/v1/namespaces/kube-system/pods/kube-scheduler-minikube
```

Sample response:

```json
{
"kind": "PodMetrics",
"apiVersion": "metrics.k8s.io/v1beta1",
"apiVersion": "metrics.k8s.io/v1",
"metadata": {
"name": "kube-scheduler-minikube",
"namespace": "kube-system",
"selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/kube-scheduler-minikube",
"selfLink": "/apis/metrics.k8s.io/v1/namespaces/kube-system/pods/kube-scheduler-minikube",
"creationTimestamp": "2022-01-27T19:25:00Z"
},
"timestamp": "2022-01-27T19:24:31Z",
Expand Down