To retrieve Kubernetes metrics, you have a few options. You can develop a custom solution that scrapes metrics via the Kubernetes API, or you can opt for an open-source monitoring solution.
OpenShift, on the other hand, comes with its own pre-built monitoring system, which is integrated upon cluster installation. For more details on OpenShift's monitoring capabilities, refer to the Red Hat Documentation for OpenShift Container Platform 4.9, specifically the "Monitoring" section.
In this case, Acceldata uses a custom solution (for example, OpenShift ). You can follow the steps below to send data to the Pulse databases.
Install the oc CLI to perform the following steps.
- Edit the
cluster-monitoring-configconfiguration map.
oc edit configmaps cluster-monitoring-config -n openshift-monitoring- Add the following properties in the configuration map.
prometheusK8s: remoteWrite: - url: "http://<VMUsername>:<VMPassword>@<VMInsert Hostname>:19043/insert/<ClusterHash>/prometheus" writeRelabelConfigs: - action: labelmap regex: __meta_kubernetes_(.+) - sourceLabels: [__meta_kubernetes_pod_annotation_prometheus_io_path] targetLabel: __metrics_path__ regex: (.+) action: replace - sourceLabels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] targetLabel: __address__ regex: (.+):(?:\d+);(\d+) replacement: ${1}:${2} action: replace - sourceLabels: [__name__] targetLabel: __name__ regex: (.*) replacement: 'kubernetes.${1}' action: replace- Save the changes.
- The next time the
Prometheus Operatorreconciles, it will apply the new configuration. To expedite the process, you can manually delete the pods.
oc delete pod -l prometheus=k8s -n openshift-monitoring- After the pods are up, you can see the metrics flowing inside the Pulse databases.
Was this page helpful?