@@ -5,43 +5,37 @@ approvers:
5
5
title : Core metrics pipeline
6
6
---
7
7
8
- Resource usage metrics are important for:
9
-
10
- - Kubernetes components to operate (e.g. autoscalers to automatically scale user applications)
11
- - Kubernetes users to understand their applications behavior
12
-
13
- In Kubernetes they are available through Metrics API.
8
+ Starting from Kubernetes 1.8, resource usage metrics, such as container CPU and memory usage,
9
+ are available in Kubernetes though the Metrics API. These metrics can be either accessed directly
10
+ by user, for example by using ` kubectl top ` command, or used by a controller in the cluster, e.g.
11
+ Horizontal Pod Autoscaler to make decisions.
14
12
15
13
## Metrics API
16
14
17
- Metrics API provides current resource usage metrics for pods and nodes. It doesn't offer historical metrics, so one needs to
18
- archive metrics themselves. In the future Historical API might be defined but it will not be implemented as a part of
19
- the core metrics pipeline.
15
+ Through Metrics API you can get the amount of resource currently used
16
+ by a given node or a given pod. This API doesn't store the metric values,
17
+ so it's not possible for example to get the amount of resources used by a
18
+ given node 10 minutes ago.
20
19
21
- The API is discoverable through the same endpoint as the other Kubernetes APIs under ` /apis/metrics.k8s.io/ ` path.
20
+ The API no different from any other API:
21
+ it is discoverable through the same endpoint as the other Kubernetes APIs under ` /apis/metrics.k8s.io/ ` path.
22
22
It also offers the same security, scalability and reliability guarantees.
23
23
24
- The API is defined in [ k8s.io/metrics] ( https://github.com/kubernetes/metrics/tree/master/pkg/apis/metrics ) repository,
25
- where the detailed semantic is explained.
26
-
27
- ### Supported endpoints
28
-
29
- The list of supported endpoints in the API:
30
-
31
- - ` /nodes ` - all node metrics; support for ` labelSelector ` parameter
32
- - ` /nodes/{node} ` - metrics for the specified node
33
- - ` /namespaces/{namespace}/pods ` - all pod metrics within the namespace; support for ` labelSelector ` parameter
34
- - ` /namespaces/{namespace}/pods/{pod} ` - metrics for the specified pods
24
+ The API is defined in [ k8s.io/metrics] ( https://github.com/kubernetes/metrics/blob/master/pkg/apis/metrics/v1beta1/types.go )
25
+ repository. You can find more information about the API resources there.
35
26
36
27
## Metrics Server
37
28
38
- [ Metrics Server] ( https://github.com/kubernetes-incubator/metrics-server ) is a cluster-wide aggregator of monitoring data.
39
- Starting from Kubernetes 1.8 it's work on all Kubernetes setups
40
- and runs as a pod in a user space (on one of the nodes), similar to how any Kubernetes application would run.
29
+ [ Metrics Server] ( https://github.com/kubernetes-incubator/metrics-server ) is a cluster-wide aggregator of resource usage data.
30
+ Starting from Kubernetes 1.8 it's deployed by default in clusters crated by ` kube-up.sh ` script
31
+ as a Deployment object.
32
+ User can deploy it also using the provided [ deployment yamls] ( https://github.com/kubernetes-incubator/metrics-server/tree/master/deploy ) .
33
+ It's supported in Kubernetes 1.7+ (see details below).
41
34
42
- It discovers all nodes in the cluster and queries usage information from Summary API exposed by [ Kubelet] ( /docs/admin/kubelet/ ) s .
35
+ Metric server collects metrics from the Summary API, exposed by [ Kubelet] ( /docs/admin/kubelet/ ) on each node .
43
36
44
- Metrics Server use the same authorization/authentication mechanism as the main API server. It's registered there through
45
- [ Kubernetes aggregator] ( https://kubernetes.io/docs/concepts/api-extension/apiserver-aggregation/ ) .
37
+ Metrics Server registered in the main API server through
38
+ [ Kubernetes aggregator] ( https://kubernetes.io/docs/concepts/api-extension/apiserver-aggregation/ ) ,
39
+ which was introduced in Kubernetes 1.7.
46
40
47
41
Learn more about the metrics server in [ the design doc] ( https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/metrics-server.md ) .
0 commit comments