Installing Prometheus Operator with Yandex Monitoring support
Prometheus Operator with Yandex Monitoring support facilitates deployment and management of the Yandex Managed Service for Prometheus® monitoring system. You can use it to collect, store, and query metrics from your containers, applications, and infrastructure. The system leverages the Prometheus data model and PromQL
Getting started
-
Make sure that the security groups for the Managed Service for Kubernetes cluster and its node groups are configured correctly. If any rule is missing, add it.
Warning
The configuration of security groups determines the performance and availability of the cluster and the services and applications running in it.
-
Create a service account with the monitoring.editor role.
-
Create an API key for the service account:
-
If you want to install Prometheus Operator using Yandex Cloud Marketplace, create an API key in JSON format and save it to a file named
sa-key.json
:yc iam api-key create \ --service-account-name=<service_account_name> \ --format=json > sa-key.json
-
If you want to install Prometheus Operator using a Helm chart, run the following command and save the
secret
key you get:yc iam api-key create --service-account-name=<service_account_name>
-
-
Install kubect
and configure it to work with the new cluster.
Installation using Yandex Cloud Marketplace
- Navigate to the folder dashboard
and select Managed Service for Kubernetes. - Click the name of the Kubernetes cluster you need and select the Marketplace tab.
- Under Application available for installation, select Prometheus Operator with Yandex Monitoring support and click Go to install.
- Configure the application:
- Namespace: Create a new namespace, e.g.,
prometheus-operator-space
. If you leave the default namespace, Prometheus Operator may work incorrectly. - Application name: Specify the application name.
- Prometheus Workspace: Select the Prometheus workspace.
- API key: Specify the contents of the
sa-key.json
file you got earlier.
- Namespace: Create a new namespace, e.g.,
- Click Install.
- Wait for the application to change its status to
Deployed
.
Installation using a Helm chart
-
Install Helm
v3.8.0 or higher. -
Get the Prometheus workspace ID as you will need it for further setup:
- On the Yandex Monitoring home page
, select Prometheus in the left-hand panel. - Go to the page of the workspace in question. You will find its ID there.
- On the Yandex Monitoring home page
-
To install a Helm chart
with Prometheus Operator, run the following command:helm pull oci://cr.yandex/yc-marketplace/yandex-cloud/prometheus/kube-prometheus-stack \ --version 57.2.0-1 \ --untar && \ helm install \ --namespace <namespace_for_Prometheus_Operator> \ --create-namespace \ --set prometheusWorkspaceId=<Prometheus_workspace_ID> \ --set iam_api_key_value_generated.secretAccessKey=<secret_part_of_API_key> \ prometheus ./kube-prometheus-stack/
This command will also create a new namespace for Prometheus Operator.
If you set
namespace
to the default namespace, Prometheus Operator may work incorrectly. We recommend that you specify a value different from all existing namespaces (e.g.,prometheus-operator-space
).Note
If you are using a Helm version below 3.8.0, append the
export HELM_EXPERIMENTAL_OCI=1 && \
string to the command to enable Open Container Initiative (OCI) support in the Helm client. -
Make sure the Prometheus Operator pods have changed their status to
Running
:kubectl get pods --namespace=<namespace_for_Prometheus_Operator> \ -l "release=prometheus"
Connecting to a Grafana dashboard
To connect to a Grafana dashboard:
-
Get the name of the pod running Grafana:
kubectl get pods --namespace=<namespace_for_Prometheus_Operator> \ | grep grafana
-
Set up
grafana
port forwarding to your local computer:kubectl port-forward --namespace=<namespace_for_Prometheus_Operator> \ <Grafana_pod_name> 8080:3000
Note
If you close the terminal window or abort the command, port forwarding will be stopped.
-
In your browser, open the Grafana dashboard at
http://localhost:8080
. -
Sign in using
admin
as the username andprom-operator
as the password.
See also
© 2025 Linux Foundation. All rights reserved. The Linux Foundation owns and uses registered trademarks. For a list of Linux Foundation trademarks, see Trademark Usage