Monitoring cluster state Managed Service for Kubernetes
Managed Service for Kubernetes automatically sends cluster metrics to Yandex Monitoring. Metrics are available for the following Kubernetes objects:
- Container
- Master
- Node
- Pod
- Persistent volume
You can find metrics description in Yandex Monitoring metric reference.
How to get statistics
There are several alternative ways:
-
View the statistics in the management console. It shows only the metrics for your master, nodes, and pods.
-
Open the Monitoring web interface. It shows all Managed Service for Kubernetes metrics.
-
Export metrics using the Monitoring API. Thus you can get only numerical values of metrics without visualization.
-
Install Metrics Provider. You can use it to transmit metrics in two directions:
- From Kubernetes objects to monitoring systems and automatic scaling systems
- From Monitoring to Kubernetes objects
-
Install Prometheus Operator to use the Yandex Managed Service for Prometheus® monitoring system. This way you can work with dashboards in Grafana
and take advantage of Prometheus .
Viewing statistics in the management console
Viewing master statistics
-
In the management console
, go to the Managed Service for Kubernetes cluster page. -
Under Overview, go to the Master tab.
Widgets with Managed Service for Kubernetes master metrics will open. The metrics are listed in the reference.
-
Specify the period to view the statistics for.
Charts on the widgets will be automatically updated.
Viewing node statistics
-
In the management console
, go to the Managed Service for Kubernetes cluster page. -
Under Node manager, go to the Nodes tab.
-
Open the page of the node whose statistics you want to view.
-
Go to the Monitoring tab.
Widgets with Managed Service for Kubernetes node metrics will open. The metrics are listed in the reference.
Widgets only show some of the available metrics. All metrics are available in Monitoring.
-
Specify the period to view the statistics for.
Charts on the widgets will be automatically updated.
Viewing pod statistics
-
In the management console
, go to the Managed Service for Kubernetes cluster page. -
In the left-hand panel, select Workload.
-
Open the page of the pod whose statistics you want to view.
-
Go to the Monitoring tab.
Widgets with Managed Service for Kubernetes pod metrics will open. The metrics are listed in the reference.
Widgets only show some of the available metrics. All metrics are available in Monitoring.
-
Specify the period to view the statistics for.
Charts on the widgets will be automatically updated.
Viewing statistics in Monitoring
- Open the Monitoring home page
. - In the left-hand panel, select Metrics.
- In the request field, click
. - Make a request for statistics.
- Specify the period to view the statistics for.
- Click Run.
Requests for statistics in Monitoring
-
For a Managed Service for Kubernetes container:
"<metric>"{folderId="<folder_ID>", service="managed-kubernetes", cluster_id="<cluster_name>", container="<container_name>"}In the request, specify the following parameters:
"<metric>": Container metric name, e.g.,"container.cpu.core_usage_time". The metrics are listed in the reference.folderId: Folder ID.cluster_id: Managed Service for Kubernetes cluster name.container: Name of the container you need the statistics for.
-
For a Managed Service for Kubernetes master:
"<metric>"{folderId="<folder_ID>", service="managed-kubernetes", cluster_id="<cluster_name>"}In the request, specify the following parameters:
"<metric>": Container metric name, e.g.,"master.cpu.utilization_percent". The metrics are listed in the reference.folderId: Folder ID.cluster_id: Managed Service for Kubernetes cluster name.
-
For a Managed Service for Kubernetes node:
"<metric>"{folderId="<folder_ID>", service="managed-kubernetes", cluster_id="<cluster_name>", node="<node_name>"}In the request, specify the following parameters:
"<metric>": Container metric name, e.g.,"node.cpu.core_usage_time". The metrics are listed in the reference.folderId: Folder ID.cluster_id: Managed Service for Kubernetes cluster name.node: Name of the node you need the statistics for.
-
For a Managed Service for Kubernetes pod:
"<metric>"{folderId="<folder_ID>", service="managed-kubernetes", cluster_id="<cluster_name>", pod="<pod_name>"}In the request, specify the following parameters:
"<metric>": Container metric name, e.g.,"pod.memory.used_bytes". The metrics are listed in the reference.folderId: Folder ID.cluster_id: Managed Service for Kubernetes cluster name.pod: Name of the pod you need the statistics for.
-
For a Managed Service for Kubernetes persistent volume claim (PVC):
"<metric>"{folderId="<folder_ID>", service="managed-kubernetes", cluster_id="<cluster_name>", persistentvolumeclaim="<PVC_name>"}In the request, specify the following parameters:
"<metric>": Container metric name, e.g.,"pod.memory.used_bytes". The metrics are listed in the reference.folderId: Folder ID.cluster_id: Managed Service for Kubernetes cluster name.persistentvolumeclaim: Name of the persistent volume you need the statistics for.