From 12014b15aadf7fa9c1a399aa7614c9446ba6790d Mon Sep 17 00:00:00 2001 From: Austin Cunningham Date: Thu, 16 May 2019 14:56:29 +0100 Subject: [PATCH] remove the installations commands from the readme and create an installation script --- Makefile | 4 ++++ README.md | 46 ++++++++++++++++++++-------------------------- scripts/install.sh | 18 ++++++++++++++++++ 3 files changed, 42 insertions(+), 26 deletions(-) create mode 100755 scripts/install.sh diff --git a/Makefile b/Makefile index 3533ff2c..32d0e342 100644 --- a/Makefile +++ b/Makefile @@ -81,3 +81,7 @@ cluster/clean: .PHONY: cluster/create/examples cluster/create/examples: -kubectl create -f deploy/examples/ApplicationMonitoring.yaml -n $(NAMESPACE) + +.PHONY: cluster/install +cluster/install: + ./scripts/install.sh \ No newline at end of file diff --git a/README.md b/README.md index 8f8a341d..b4b726d2 100644 --- a/README.md +++ b/README.md @@ -37,35 +37,29 @@ An example GrafanaDashboard can be seen in the example app [template](https://gi You will need cluster admin permissions to create CRDs, ClusterRoles & ClusterRoleBindings. ClusterRoles are needed to allow the operators to watch multiple namespaces. +```bash +make cluster/install ``` -oc new-project application-monitoring -oc label namespace application-monitoring monitoring-key=middleware -``` - -Grafana CRDs - -``` -oc apply -f https://raw.githubusercontent.com/integr8ly/grafana-operator/master/deploy/crds/Grafana.yaml -oc apply -f https://raw.githubusercontent.com/integr8ly/grafana-operator/master/deploy/crds/GrafanaDashboard.yaml -``` - -Cluster Roles & RoleBindings - -``` -oc apply -f ./deploy/roles -``` - -Application Monitoring Operator - -``` -oc apply -f ./deploy/operator_roles/ -oc apply -f ./deploy/crds/ApplicationMonitoring.yaml -oc apply -f ./deploy/operator.yaml -oc apply -f ./deploy/examples/ApplicationMonitoring.yaml -``` - You can access Grafana, Prometheus & AlertManager web consoles using the Routes in the project. +## Verify installation +Run the following commands +```bash +# Check the project exists +$ oc project +Using project "application-monitoring" on server "https://your-cluster-ip:8443" + +# Check the pods exist e.g. +$ oc get pods +NAME READY STATUS RESTARTS AGE +alertmanager-application-monitoring-0 2/2 Running 0 1h +application-monitoring-operator-77cdbcbff-fbrnr 1/1 Running 0 1h +grafana-deployment-6dc8df6bb4-rxdjs 1/1 Running 0 49m +grafana-operator-7c4869cfdc-6sdv9 1/1 Running 0 1h +prometheus-application-monitoring-0 4/4 Running 1 36m +prometheus-operator-7547bb757b-46lwh 1/1 Running 0 1h +``` + # Example Monitored Project These steps create a new project with a simple server exposing a metrics endpoint. diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 00000000..a529f9f7 --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# create the project and add a label +oc new-project application-monitoring +oc label namespace application-monitoring monitoring-key=middleware + +# Grafana CRDs +oc apply -f https://raw.githubusercontent.com/integr8ly/grafana-operator/master/deploy/crds/Grafana.yaml +oc apply -f https://raw.githubusercontent.com/integr8ly/grafana-operator/master/deploy/crds/GrafanaDashboard.yaml + +# Cluster Roles & RoleBindings +oc apply -f ./deploy/roles + +# Application Monitoring Operator +oc apply -f ./deploy/operator_roles/ +oc apply -f ./deploy/crds/ApplicationMonitoring.yaml +oc apply -f ./deploy/operator.yaml +oc apply -f ./deploy/examples/ApplicationMonitoring.yaml