Creating Prometheus instance
The OpenShift® administrator can create the Prometheus instance from the OpenShift Container Platform (OCP) OperatorHub.
Procedure
- Log in to the OpenShift Container Platform (OCP) by using the OpenShift administrator credentials.
- In the left panel, go to Operators > Installed Operators.
- Select the project from the Project list, where you installed Prometheus operator.
- Click the Prometheus Operator link from the Name column.
- Click the Prometheus tab, and click Create Prometheus.
- On the Create Prometheus page, use one of the following options to
edit the custom resource to create a Prometheus instance:
- YAML View: You are provided with full control of object creation.
- Form View: You can enter the details in a form.
- Enter the following details in the YAML file:
- name: Enter the name of the Prometheus instance. Refer to the example, wherein the Prometheus instance name is entered as app-monitor.
- namespace: Enter the name of the project or the namespace where you installed Prometheus operator. Refer to the example, wherein the namespace is entered as test00.
-
As shown in the example, enter the following details in the Custom Resource (CR). Enter the key that is mentioned is in the service monitors that points to RQA services. Refer to the example, wherein the Key is mentioned as rqa-app.
serviceMonitorSelector: matchExpressions: - key: rqa-app operator: Exists
apiVersion: monitoring.coreos.com/v1 kind: Prometheus metadata: name: app-monitor labels: prometheus: k8s namespace: test00 spec: replicas: 1 serviceAccountName: prometheus-k8s securityContext: {} serviceMonitorSelector: matchExpressions: - key: rqa-app operator: Exists ruleSelector: {} alerting: alertmanagers: - namespace: openshift-monitoring name: alertmanager-main port: web - Click Create.