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 visualizes only the metrics for master hosts, nodes, and pods.
-
Open the Monitoring web interface. It visualizes all Managed Service for Kubernetes metrics.
-
Upload metrics using the Monitoring API. This method is suitable if you want to get only numerical values of metrics without visualization.
-
Install the Metrics Provider app. 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 the Prometheus Operator app to work with 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. -
In the Overview section, go to the Master tab.
Widgets with Managed Service for Kubernetes master metrics will open. The metrics are listed in the reference.
-
Specify the statistics period.
The charts on the widgets will be automatically updated.
Viewing node statistics
-
In the management console
, go to the Managed Service for Kubernetes cluster page. -
In the Nodes manager section, go to the Nodes tab.
-
Open the page of the node for which you want to view statistics.
-
Go to the Monitoring tab.
Widgets with Managed Service for Kubernetes node metrics will open. The metrics are listed in the reference.
The widgets show only some of the available metrics. All metrics are available in the Monitoring service.
-
Specify the statistics period.
The 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 for which you want to view statistics.
-
Go to the Monitoring tab.
Widgets with Managed Service for Kubernetes pod metrics will open. The metrics are listed in the reference.
The widgets show only some of the available metrics. All metrics are available in the Monitoring service.
-
Specify the statistics period.
The charts on the widgets will be automatically updated.
Viewing statistics in Monitoring
- Open the service home page
Monitoring. - In the panel on the left, select the Metric Explorer section.
- In the request field, click
. - Configure a request for statistics.
- Specify the statistics period.
- Click Run.
Requests for statistics in Monitoring
-
For a Managed Service for Kubernetes container:
"<metric>"{folderId="<folder_ID>", service="managed-kubernetes", cluster_id="<cluster_ID>", 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 PVC you need the statistics for.