Installing Metrics Provider
Metrics Provider streams metrics of Managed Service for Kubernetes cluster objects to monitoring systems and auto scaling systems. You can also broadcast metrics in the reverse direction: for example, cluster objects can receive metrics from Yandex Monitoring.
The provider transforms the request to collect external metrics from a Managed Service for Kubernetes cluster object into the required Monitoring format, and also performs the reverse transformation: from Monitoring to the cluster object.
Getting started
-
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the
--folder-name
or--folder-id
parameter. -
Create a service account with the
monitoring.viewer
role. -
Create an authorized access key for the service account in JSON format and save it to the
sa-key.json
file:yc iam key create \ --service-account-name=<service_account_name> \ --output=sa-key.json
Installation using Yandex Cloud Marketplace
- Go to the folder page and select Managed Service for Kubernetes.
- Click the name of the Managed Service for Kubernetes cluster you need and select the Marketplace tab.
- Under Applications available for installation, select Metrics Provider and click Use.
- Configure the application:
-
Namespace: Select a namespace or create a new one.
-
Application name: Enter a name for the application.
-
Folder ID: Specify the ID of the folder where Metrics Provider will run.
-
Time window: Specify the time window for which metrics will be collected (in
DdHhMmSs
format, e.g.,5d10h30m20s
). -
(Optional) Disable decimation: Select this option not to apply a data decimation function.
-
(Optional) Aggregation function: Select a data aggregation function. The default value is
AVG
. -
(Optional) Data filling: Configure filling in missing data:
NULL
: Returnsnull
as the metric value andtimestamp
as the timestamp value. Default value.NONE
: Returns no values.PREVIOUS
: Returns the value from the previous data point.
-
(Optional) Maximum number of points: Specify the maximum number of points that will be returned in response to a request. Use a value greater than
10
. -
(Optional) Decimation time window: Specify a time window (grid) in milliseconds. It is used for decimation: points inside the window are combined into a single one using the aggregation function. Use a value greater than
0
.Note
Select only one of the settings: either Maximum number of points or Decimation time window. Leave both the fields blank not to use either setting. For more information, see the API documentation.
-
Secret Key: Copy and paste the contents of the
sa-key.json
file or create a new service account access key. The service account must have themonitoring.viewer
role.
-
- Click Install.
- Wait for the application to change its status to
Deployed
.
Installation using a Helm chart
-
Install Helm
v3.7.0 or higher. -
Install kubectl
and configure it to work with the created cluster. -
Add the
metric-provider
repository:export HELM_EXPERIMENTAL_OCI=1 && \ cat sa-key.json | helm registry login cr.yandex --username 'json_key' --password-stdin && \ helm pull oci://cr.yandex/yc-marketplace/yandex-cloud/metric-provider/chart/metric-provider \ --version=0.1.11 \ --untar
-
Set up and install Metrics Provider:
helm install \ --namespace <namespace> \ --create-namespace \ --set yandexMetrics.folderId=<folder_ID> \ --set window=<time_window> \ --set-file yandexMetrics.token.serviceAccountJson=<path_to_service_account_static_key_file> \ --set yandexMetrics.downsampling.gridAggregation=<aggregation_function> \ --set yandexMetrics.downsampling.gapFilling=<data_filling> \ --set yandexMetrics.downsampling.maxPoints=<maximum_number_of_points> \ --set yandexMetrics.downsampling.gridInterval=<decimation_time_window> \ --set yandexMetrics.downsampling.disabled=<data_decimation_mode> \ metric-provider ./chart/
Required parameters:
--namespace
: Namespace where the provider will be deployed.yandexMetrics.folderId
: ID of the folder where the provider will run.window
: Time window for which metrics will be collected (inDdHhMmSs
format, e.g.,5d10h30m20s
).yandexMetrics.token.serviceAccountJson
: Path to the static access key of the service account with themonitoring.viewer
role.
Decimation parameters (
downsampling
). For the provider to work, you need to select at least one of the parameters below:-
yandexMetrics.downsampling.gridAggregation
: Data aggregation function. The default value isAVG
. -
yandexMetrics.downsampling.gapFilling
: Settings for filling in missing data:NULL
: Returnsnull
as the metric value andtimestamp
as the timestamp value.NONE
: Returns no values.PREVIOUS
: Returns the value from the previous data point.
-
yandexMetrics.downsampling.maxPoints
: Maximum number of points to be received in response to a request. Use a value greater than10
. -
yandexMetrics.downsampling.gridInterval
: Time window (grid) in milliseconds. It is used for decimation: points inside the window are combined into a single one using the aggregation function. Use a value greater than0
. -
yandexMetrics.downsampling.disabled
: Disable data decimation. Valid values:true
orfalse
.Note
Use only one of the parameters:
yandexMetrics.downsampling.maxPoints
,yandexMetrics.downsampling.gridInterval
, oryandexMetrics.downsampling.disabled
. For more information about decimation parameters, see the API documentation.