Skip to content

Commit

Permalink
feat: Move dashboards and fix issues (#417)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Schuetz <[email protected]>
  • Loading branch information
thschue authored and Thomas Schuetz committed Nov 15, 2022
1 parent 76dba32 commit afd4ece
Show file tree
Hide file tree
Showing 26 changed files with 7,387 additions and 311 deletions.
1 change: 1 addition & 0 deletions .github/workflows/validate-semantic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
scheduler
operator
functions-runtime
dashboards
# Configure that a scope must always be provided.
requireScope: false
# When using "Squash and merge" on a PR with only one commit, GitHub
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ manifests/
# Examples
/examples/observability/assets/backups/

/dashboards/grafana/output/
28 changes: 28 additions & 0 deletions dashboards/grafana/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
GRAFANA_SCHEME ?= http
GRAFANA_HOSTNAME ?= localhost
GRAFANA_USERNAME ?= admin
GRAFANA_PASSWORD ?= admin
GRAFANA_PORT ?= 3000

.PHONY: generate
generate: generate-configmaps generate-import

.PHONY: generate-import
generate-import:
mkdir import | true
./utils/generate-import.sh ./import

.PHONY: generate-configmap
generate-configmaps:
mkdir configmap | true
kubectl create configmap grafana-dashboard-keptn-overview -n monitoring --from-file=./grafana_dashboard_overview.json -o yaml --dry-run=client > configmap/grafana-dashboard-keptn-overview.yaml
kubectl create configmap grafana-dashboard-keptn-applications -n monitoring --from-file=./grafana_dashboard_applications.json -o yaml --dry-run=client > configmap/grafana-dashboard-keptn-applications.yaml
kubectl create configmap grafana-dashboard-keptn-workloads -n monitoring --from-file=./grafana_dashboard_workloads.json -o yaml --dry-run=client > configmap/grafana-dashboard-keptn-workloads.yaml
cp configmap/* ../../examples/observability/config/prometheus

.PHONY: import
import:
@curl -X POST -H "Content-Type: application/json" -d @import/grafana_dashboard_overview.json ${GRAFANA_SCHEME}://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}:$(GRAFANA_PORT)/api/dashboards/db
@curl -X POST -H "Content-Type: application/json" -d @import/grafana_dashboard_applications.json ${GRAFANA_SCHEME}://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}:$(GRAFANA_PORT)/api/dashboards/db
@curl -X POST -H "Content-Type: application/json" -d @import/grafana_dashboard_workloads.json ${GRAFANA_SCHEME}://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}:$(GRAFANA_PORT)/api/dashboards/db

22 changes: 22 additions & 0 deletions dashboards/grafana/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Grafana Dashboards for the Lifecycle Toolkit

This folder contains the Grafana dashboards for the Keptn Lifecycle Toolkit.

## Installing the dashboards
It is assumed, that there is a Grafana Instance available. In our provided examples, the dashboards are automatically provisioned. If you want to install the dashboards manually, you can use the following steps:

```sh
# This defaults to http://localhost:3000, but can be changed by setting the GRAFANA_SCHEME, GRAFANA_URL and GRAFANA_PORT environment variable
# The default credentials are admin:admin, but can be changed by setting the GRAFANA_USERNAME and GRAFANA_PASSWORD environment variable
make install
```

## Changing the dashboards
The dashboards can be changed in the Grafana UI. To export dashboards, export them using the share button and replace them in this folder.

## Exporting the dashboards for the Examples
You can prepare the dashboards for the examples and import using the following command:

```sh
make generate
```
8 changes: 8 additions & 0 deletions dashboards/grafana/configmap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Autogenerated Files - Do not change

# Grafana Dashboards - ConfigMaps

This files can be used to autoprovision Grafana dashboards in Kubernetes.

More information: https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards

Loading

0 comments on commit afd4ece

Please sign in to comment.