2. Add persistency for grafana dashboards

When label monitoring_storage_class_name is specified
dashboards altered using the grafana UI are now
persisted if the pod is terminated.
It is still recommended that the user utilizes a
kubernetes configMap to persist the dashboard.

task: 39514
story: 2006765

Depends-On: I42117837e8e3cd03f3cb723df4d73692ead0d169
Change-Id: Ieb90605182626869528349a7fdeed65061914bcb
Signed-off-by: Diogo Guerra <diogo.filipe.tomas.guerra@cern.ch>
This commit is contained in:
Diogo Guerra 2020-04-23 20:22:41 +09:00 committed by Diogo Guerra
parent 37497ccf5b
commit aec5d469be
3 changed files with 21 additions and 0 deletions

View File

@ -1500,6 +1500,9 @@ _`monitoring_storage_class_name`
The kubernetes storage class name to use for the prometheus pvc.
Using this label will activate the usage of a pvc instead of local
disk space.
When using monitoring_storage_class_name 2 pvcs will be created.
One for the prometheus server which size is set by
monitoring_retention_size and one for grafana which is fixed at 1Gi.
Default: ""
_`prometheus_adapter_enabled`

View File

@ -24,7 +24,12 @@ EOF
# Because the PVC and Prometheus use different scales for the volume size
# conversion is needed. The prometheus-monitoring value (in GB) is the conversion
# with a ratio of (1 GiB = 1.073741824 GB) and then rounded to int
MONITORING_RETENTION_SIZE_GB=$(echo | awk "{print int(${MONITORING_RETENTION_SIZE}*1.073741824)}")
APP_GRAFANA_PERSISTENT_STORAGE="false"
if [ "${MONITORING_STORAGE_CLASS_NAME}" != "" ]; then
APP_GRAFANA_PERSISTENT_STORAGE="true"
fi
# Validate if communication node <-> master is secure or insecure
PROTOCOL="https"
@ -71,6 +76,10 @@ prometheus-operator:
cpu: 100m
memory: 128Mi
adminPassword: ${GRAFANA_ADMIN_PASSWD}
persistence:
enabled: ${APP_GRAFANA_PERSISTENT_STORAGE}
storageClassName: ${MONITORING_STORAGE_CLASS_NAME}
size: 1Gi
kubeApiServer:
tlsConfig:

View File

@ -0,0 +1,9 @@
---
features:
- |
Add persistency for grafana UI altered dashboards. To enable this use
monitoring_storage_class_name label.
It is recommended that dashboards be persisted by other means, mainly
by using kubernetes configMaps. More info [0].
[0] https://github.com/helm/charts/tree/master/stable/grafana#sidecar-for-dashboards