How to gather compliance and file integrity metrics operators in OpenShift Container Platform 4?

Solution Verified - Updated -

Issue

To gather compliance and file integrity operator metrics it is needed to have respective namespaces with “openshift.io/cluster-monitoring=true” label so it is possible to gather metrics in older versions, as this is configured already form OpenShift Container Platform 4.9 and onwards automatically, otherwise, the following errors are seen:

{"level":"error","ts":3200.30202,"logger":"cmd","msg":"Error getting metrics service","error":"services \"metrics\" not found","stacktrace":"main.RunOperator\n\t/go/src/github.com/openshift/compliance-operator/cmd/manager/operator.go

User \"system:serviceaccount:openshift-monitoring:prometheus-k8s\" cannot list resource \"endpoints\" in API group \"\" in the namespace \"openshift-file-integrity\": RBAC: role.rbac.authorization.k8s.io \"prometheus-k8s\" not found"
User \"system:serviceaccount:openshift-monitoring:prometheus-k8s\" cannot list resource \"endpoints\" in API group \"\" in the namespace \"openshift-compliance\": RBAC: role.rbac.authorization.k8s.io \"prometheus-k8s\" not found"

Environment

  • Red Hat OpenShift Container Platform (OCP) 4.
  • Compliance Operator
  • File Integrity Operator

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content