This repo stores all required manifests and instructions for deploying Application Monitoring Stack
in disconnected environments. The stack based on Prometheus and Grafana operators and can be safely deployed along side with default OpenShift Monitoring stack (which is based on the same operators).
As for today OpenShift does not provides any tooling for application monitoring.
As a result OpenShift users required to deploy their own monitoring stacks.
Nowadays Prometheus and Grafna
are de-facto a standards tooling for cloud native monitoring.
Usually thous tools are deployed and managed with concept of
Custom Resource Definitions
and Custom Resource
instances
by K8S Operators.
By default OpenShift includes out-of-the-box Prometheus Operator
which is deploys Prometheus instance, but this instance is limited to scarp only
OpenShift/K8S related endpoints and end user
is not allowed
to edit this Prometheus instance.
This repo explain how Prometheus and Grafana Operators could be installed
along side with OpenShift monitoring stack without braking our-of-the-box monitoring stack in disconnected environments.
- quay.io/coreos/configmap-reload:v0.0.1
- quay.io/coreos/prometheus-config-reloader:v0.34.0
- quay.io/coreos/prometheus-operator:v0.34.0
- quay.io/prometheus/prometheus:v2.7.1
- quay.io/prometheus/alertmanager:v0.17.0
- quay.io/pb82/grafana-operator:latest
- quay.io/openshift/origin-grafana:4.2
- quay.io/integreatly/grafana_plugins_init:0.0.2
- Update
--config-reloader-image=docker.io/dimssss/configmap-reload:v0.0.1
in file:prometheus-operator/1.1-prom-operator-bundle.yaml
- Update
--prometheus-config-reloader=docker.io/dimssss/prometheus-config-reloader:v0.34.0
in file:prometheus-operator/1.1-prom-operator-bundle.yaml
- Update
image: docker.io/dimssss/prometheus-operator:v0.34.0
in file:prometheus-operator/1.1-prom-operator-bundle.yaml
- Update
image: "docker.io/dimssss/prometheus:v2.7.1"
in fileprometheus-operator/2.2-prometheus.yaml
- Update
docker.io/dimssss/alertmanager:v0.17.0
in fileprometheus-operator/3.2-alertmanager.yaml
- Update
image: docker.io/dimssss/grafana-operator:latest
in filegrafana-operator/4.1-operator.yaml
- Update
--grafana-image=docker.io/dimssss/origin-grafana
and--grafana-image-tag=4.2
in filegrafana-operator/4.1-operator.yaml
- Update
--grafana-plugins-init-container-image=docker.io/dimssss/grafana_plugins_init
and'--grafana-plugins-init-container-tag=0.0.2
in filegrafana-operator/4.1-operator.yaml
All manifests in that repo have hard-coded values. None of the manifest are parameterized. And it's done by purpose. If you deciding to use this repo for installing your Monitoring stack, please make sure you understand each manifest and all related manifest values, such as namespaces, roles, service accounts, role bindings, cluster role bindings, etc...
By default the application monitoring stack will be deployed with the following
- Namespace:
appmon
- Service account for Prometheus operator:
appmon-prometheus-operator
- Service account for Prometheus instance:
appmon-prometheus
- For extra Prometheus operator flags check the operator's
Deployment
manifest here:prometheus-operator/1.1-prom-operator-bundle.yaml
- The Prometheus Operator deploying persistence Prometheus instance, as a result you've to make sure you've available 6 PVs in total. 3 PVs for Prometheus instance with
storageClassName: prom-storage
and 3 PVs for AlertManager withstorageClassName: alertmanager-storage
- Selectors
serviceMonitorNamespaceSelector: matchExpressions: - key: appmon operator: In values: - "yes" ruleNamespaceSelector: matchExpressions: - key: appmon operator: In values: - "yes" alerting: alertmanagers: - namespace: appmon name: appmon-alertmanager port: web serviceMonitorSelector: matchLabels: appmon: "service-yes" podMonitorSelector: matchLabels: appmon: "pod-yes" ruleSelector: matchLabels: role: alert-rules prometheus: appmon-prometheus
# Application monitoring project
oc new-project appmon
# Demo app project
oc new-project chuck
...
labels:
appmon: "yes"
...
oc create -f prometheus-operator/1.1-prom-operator-bundle.yaml
oc create -f prometheus-operator/2.1-pv.yaml
oc create -f prometheus-operator/2.2-prometheus.yaml
oc create -f prometheus-operator/2.3-prom-service-route.yaml
3.1 Optional - Create AlertManager Secret. Note, if you creating your own AlertManager secret, make sure to update prometheus-operator/3.2-alertmanager.yaml
file and remove the appmon-alertmanager
secret from there
# Create the AlertManager secret
oc create -f prometheus-operator/3.1-alertmanager-secret.yaml
Edit the prometheus-operator/3.2-alertmanager.yaml
and remove the following secret
kind: Secret
metadata:
name: appmon-alertmanager
namespace: appmon
apiVersion: v1
data:
alertmanager.yaml: Z2xvYmFsOgogIHJlc29sdmVfdGltZW91dDogNW0Kcm91dGU6CiAgZ3JvdXBfYnk6IFsnam9iJ10KICBncm91cF93YWl0OiAzMHMKICBncm91cF9pbnRlcnZhbDogNW0KICByZXBlYXRfaW50ZXJ2YWw6IDEyaAogIHJlY2VpdmVyOiAnd2ViaG9vaycKcmVjZWl2ZXJzOgotIG5hbWU6ICd3ZWJob29rJwogIHdlYmhvb2tfY29uZmlnczoKICAtIHVybDogJ2h0dHA6Ly9hbGVydG1hbmFnZXJ3aDozMDUwMC8nCg==
type: Opaque
oc create -f prometheus-operator/3.2-alertmanager.yaml
oc create -f prometheus-operator/4.1-service-monitor.yaml
oc create -f prometheus-operator/5.1-rule.yaml
oc create -f grafana-operator/1.1-grafana-crd.yaml
oc create -f grafana-operator/1.2-grafana-dashboard-crd.yaml
oc create -f grafana-operator/1.3-grafana-datasource-crd.yaml
oc create -f grafana-operator/2.1-service_account.yaml
oc create -f grafana-operator/2.2-role.yaml
oc create -f grafana-operator/2.3-role_binding.yaml
oc create -f grafana-operator/3.1-cluster_role.yaml
oc create -f grafana-operator/3.2-cluster_role_binding.yaml
oc create -f grafana-operator/4.1-operator.yaml
oc create -f grafana-operator/5.1-grafana.yaml
oc create -f /Users/dima/code/prom/grafana-operator/6.1-ds.yaml
oc create -f grafana-operator/7.1-dashboard.yaml
oc create -f deom-app/app.yaml