Instructions for creating custom monitoring stacks on OpenShift scoped to specific teams resources.
The question was proposed, how to create a way for teams to use Prometheus and Grafana to monitor their projects but no one else's to keep separation of data. This document outlines how to do this.
This has only been tested on OpenShift 4.x, but in theory it should work the same on OpenShift 3.x.
Since OpenShift ships with a running version of the Prometheus Operator in the openshift-monitoring project we need to be sure to not conflict with that. Therefor thse instructions are modified from the documentation in https://github.com/coreos/prometheus-operator.
- clone this repository
git clone https://github.com/itewk/openshift-custom-scoped-monitoring.git
- log in as cluster admin
- switch to the project for putting cluster wide operators
oc project openshift-operators
- create the custom prometheus operator
oc create -f openshift-custom-scoped-monitoring/custom-prometehus-operator.yml -n openshift-operators
- create the template for creating custom monitoring stacks
oc apply -f openshift-custom-scoped-monitoring/custom-monitoring-template.yml -n openshift
These are based on https://github.com/integr8ly/grafana-operator/blob/master/documentation/deploy_grafana.md.
TO DO
- clone this repository
git clone https://github.com/itewk/openshift-team-scoped-monitoring.git
cd openshift-team-scoped-monitoring
- log in as "normal" user
- create team specific monitoring project
export GROUP=
export MONITORING_NAMESPACE=${GROUP}-monitoring
oc new-project ${MONITORING_PROJECT}
- create custom monitoring resources
oc process openshift//custom-monitoring MONITOR_GROUP=${GROUP} NAMESPACE=${MONITORING_NAMESPACE} | oc create -n ${MONITORING_NAMESPACE} -f -
oc delete -f custom-prometehus-operator.yml -n openshift-operators
oc process openshift//custom-monitoring MONITOR_GROUP=team-a | oc delete -f -