Installing Prometheus Operator with Yandex Monitoring support
Prometheus Operator with Yandex Monitoring support streamlines the installation of Prometheus Operator, a popular solution for Kubernetes cluster monitoring, providing integration with Yandex Monitoring. You can use it to collect, store, and read metrics from containers, applications, and the 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 the
sa-key.jsonfile:yc iam api-key create \ --service-account-name=<service_account_name> \ --format=json | jq -c > sa-key.jsonTip
You can also automatically create a new API key during the app installation.
-
If you want to install Prometheus Operator using a Helm chart, run the following command and save the
secretkey you get:yc iam api-key create --service-account-name=<service_account_name>
-
-
Install kubect
and configure it to work with the new cluster. -
If you do not have a Prometheus workspace yet, create one:
Management console- Open the Monitoring home page
. - In the left-hand panel, select Prometheus.
- Click Create workspace.
- Open the Monitoring home page
Installation from 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 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 a Prometheus workspace.
- API key: Specify the contents of the
sa-key.jsonfile.
- 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:
Management console- Open the Monitoring home page
. - Select Prometheus on the left.
- Select a Prometheus workspace.
- This will open the General information tab displaying the workspace ID. Save the ID.
- Open the Monitoring home page
-
To install a Helm chart
with Prometheus Operator, run this command:helm pull oci://cr.yandex/yc-marketplace/yandex-cloud/prometheus/kube-prometheus-stack \ --version 72.6.2-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
namespaceto the default namespace, Prometheus Operator may work incorrectly. Use a value different from all the 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"
Viewing charts based on metrics
Adding charts to dashboards
- Build a chart.
- At the top right, click Add to dashboard.
- Enter a name for your chart.
- Select a cloud and folder.
- Select an existing dashboard or create a new one.
- Select a chart adding option:
- Add: To add the chart to the dashboard and stay in the Metrics section.
- Add and edit: To add the chart to the dashboard and go to the Dashboards section. The chart will not be saved in Metrics.
Tip
You can create an empty dashboard and then add the charts to it.
(Optional) Configuring alerts based on metrics
-
Create a notification channel by selecting an available sending method.
-
Set up the Alert Manager
responsible for sending notifications:-
Open the Monitoring home page
. -
Select Prometheus on the left.
-
Select a Prometheus workspace.
-
Navigate to the Alert manager configuration tab.
-
Click Upload a configuration file and upload the configuration
file inYAMLformat.Sample configuration file
global: resolve_timeout: 5m route: receiver: telegram routes: - receiver: "null" matchers: - severity="none" continue: false receivers: - name: telegram yandex_monitoring_configs: - channel_names: - "<notification_channel_name>" - name: "null" yandex_monitoring_configs: - channel_names: []
-
-
Add a test alerting rule:
cat <<EOF | kubectl apply -f - apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: labels: release: kube-prometheus-stack name: test spec: groups: - name: test rules: - alert: Test annotations: description: this is a test alert summary: test alert expr: vector(1) labels: severity: warning EOF -
Wait until you get alerted through the selected notification channel or check the alert status in the management console:
- Open the Monitoring home page
. - Select Prometheus on the left.
- Select a Prometheus workspace.
- Navigate to the Managing rules tab.
- Click the test alert name.
- Navigate to the Alerts tab.
- Make sure the test alert status changed to
FIRING.
- Open the Monitoring home page
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