14.3. Monitoring Central services by using Helm
You can monitor Central services, Central and Scanner, by changing the configuration options in the central-services Helm chart. For more information, see "Changing configuration options after deploying the central-services Helm chart" in the "Additional resources" section.
Procedure
Update the
values-public.yamlconfiguration file with the following values:central.exposeMonitoring: true scanner.exposeMonitoring: true-
Run the
helm upgradecommand and specify the configuration files.
If you are using the Prometheus Operator, you can use a service monitor to scrape the metrics from Red Hat Advanced Cluster Security for Kubernetes (RHACS).
If you are not using the Prometheus operator, you must edit the Prometheus configuration files to receive the data from RHACS.
Procedure
Create a new
servicemonitor.yamlfile with the following content:apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: prometheus-stackrox namespace: stackrox spec: endpoints: - interval: 30s port: monitoring scheme: http selector: matchLabels: app.kubernetes.io/name: <stackrox-service>1 - 1
- The labels must match with the
Serviceresource that you want to monitor. For example,centralorscanner.
Apply the YAML to the cluster:
$ oc apply -f servicemonitor.yaml1 - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
Verification
Run the following command to check the status of service monitor:
$ oc get servicemonitor --namespace stackrox1 - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.