sidecar for automated dashboard creation

Change-Id: If4948f68e3111afec56abd3808122b1295650ef1
diff --git a/aether-roc-umbrella/Chart.yaml b/aether-roc-umbrella/Chart.yaml
index 748864e..a4e7527 100644
--- a/aether-roc-umbrella/Chart.yaml
+++ b/aether-roc-umbrella/Chart.yaml
@@ -7,7 +7,7 @@
 description: Aether ROC Umbrella chart to deploy all Aether ROC
 kubeVersion: ">=1.18.0"
 type: application
-version: 1.4.30
+version: 1.4.31
 appVersion: v0.0.0
 keywords:
   - aether
diff --git a/aether-roc-umbrella/files/dashboards/site/site-availability.json b/aether-roc-umbrella/files/dashboards/site/site-availability.json
new file mode 100644
index 0000000..f05f073
--- /dev/null
+++ b/aether-roc-umbrella/files/dashboards/site/site-availability.json
@@ -0,0 +1,135 @@
+{
+    
+        "annotations": {
+            "list": [
+                {
+                    "builtIn": 1,
+                    "datasource": "-- Grafana --",
+                    "enable": true,
+                    "hide": true,
+                    "iconColor": "rgba(0, 211, 255, 1)",
+                    "name": "Annotations & Alerts",
+                    "type": "dashboard"
+                }
+            ]
+        },
+        "description": "",
+        "editable": false,
+        "gnetId": null,
+        "graphTooltip": 0,
+        "links": [],
+        "panels": [
+            {
+                "datasource": "$ds",
+                "description": "Cluster Availability",
+                "fieldConfig": {
+                    "defaults": {
+                        "color": {
+                            "mode": "palette-classic"
+                        },
+                        "custom": {
+                            "axisLabel": "",
+                            "axisPlacement": "auto",
+                            "barAlignment": 0,
+                            "drawStyle": "line",
+                            "fillOpacity": 0,
+                            "gradientMode": "none",
+                            "hideFrom": {
+                                "legend": false,
+                                "tooltip": false,
+                                "viz": false
+                            },
+                            "lineInterpolation": "linear",
+                            "lineWidth": 1,
+                            "pointSize": 5,
+                            "scaleDistribution": {
+                                "type": "linear"
+                            },
+                            "showPoints": "auto",
+                            "spanNulls": false,
+                            "stacking": {
+                                "group": "A",
+                                "mode": "none"
+                            },
+                            "thresholdsStyle": {
+                                "mode": "off"
+                            }
+                        },
+                        "mappings": [],
+                        "thresholds": {
+                            "mode": "absolute",
+                            "steps": [
+                                {
+                                    "color": "green",
+                                    "value": null
+                                },
+                                {
+                                    "color": "red",
+                                    "value": 80
+                                }
+                            ]
+                        }
+                    },
+                    "overrides": []
+                },
+                "gridPos": {
+                    "h": 8,
+                    "w": 12,
+                    "x": 0,
+                    "y": 0
+                },
+                "id": 1,
+                "options": {
+                    "legend": {
+                        "calcs": [],
+                        "displayMode": "list",
+                        "placement": "bottom"
+                    },
+                    "tooltip": {
+                        "mode": "single"
+                    }
+                },
+                "targets": [
+                    {
+                        "exemplar": true,
+                        "expr": "sum by (node) (kube_node_status_condition{condition=~\"Ready\",status=~\"true\"})",
+                        "interval": "",
+                        "legendFormat": "{{node}}",
+                        "queryType": "randomWalk",
+                        "refId": "A"
+                    }
+                ],
+                "title": "Cluster Nodes Status",
+                "type": "timeseries"
+            }
+        ],
+        "refresh": "",
+        "schemaVersion": 30,
+        "style": "light",
+        "tags": [],
+        "templating": {
+            "list": [
+                {
+                    "label" : "Datasource",
+                    "multi" : false,
+                    "name" : "ds",
+                    "type" : "datasource",
+                    "query": "prometheus",
+                    "queryValue": "",
+                    "refresh": 1,
+                    "regex": ""
+                }
+            ]
+        },
+        "time": {
+            "from": "now-15m",
+            "to": "now"
+        },
+        "timepicker": {},
+        "timezone": "",
+        "title": "Cluster Health",
+        "uid": "site-availability",
+        "version": 1
+    }
+
+
diff --git a/aether-roc-umbrella/files/dashboards/site/site-monitoring.json b/aether-roc-umbrella/files/dashboards/site/site-monitoring.json
new file mode 100644
index 0000000..13a71b4
--- /dev/null
+++ b/aether-roc-umbrella/files/dashboards/site/site-monitoring.json
@@ -0,0 +1,149 @@
+{
+    
+        "annotations": {
+            "list": [
+                {
+                    "builtIn": 1,
+                    "datasource": "-- Grafana --",
+                    "enable": true,
+                    "hide": true,
+                    "iconColor": "rgba(0, 211, 255, 1)",
+                    "name": "Annotations & Alerts",
+                    "type": "dashboard"
+                }
+            ]
+        },
+        "description": "",
+        "editable": false,
+        "gnetId": null,
+        "graphTooltip": 0,
+        "links": [],
+        "panels": [
+            {
+                "datasource": "$ds",
+                "description": "E2E Tests",
+                "fieldConfig": {
+                    "defaults": {
+                        "color": {
+                            "mode": "palette-classic"
+                        },
+                        "custom": {
+                            "axisLabel": "",
+                            "axisPlacement": "auto",
+                            "barAlignment": 0,
+                            "drawStyle": "line",
+                            "fillOpacity": 0,
+                            "gradientMode": "none",
+                            "hideFrom": {
+                                "legend": false,
+                                "tooltip": false,
+                                "viz": false
+                            },
+                            "lineInterpolation": "linear",
+                            "lineWidth": 1,
+                            "pointSize": 5,
+                            "scaleDistribution": {
+                                "type": "linear"
+                            },
+                            "showPoints": "auto",
+                            "spanNulls": false,
+                            "stacking": {
+                                "group": "A",
+                                "mode": "none"
+                            },
+                            "thresholdsStyle": {
+                                "mode": "off"
+                            }
+                        },
+                        "mappings": [],
+                        "thresholds": {
+                            "mode": "absolute",
+                            "steps": [
+                                {
+                                    "color": "green",
+                                    "value": null
+                                },
+                                {
+                                    "color": "red",
+                                    "value": 80
+                                }
+                            ]
+                        }
+                    },
+                    "overrides": []
+                },
+                "gridPos": {
+                    "h": 9,
+                    "w": 12,
+                    "x": 0,
+                    "y": 0
+                },
+                "id": 1,
+                "options": {
+                    "legend": {
+                        "calcs": [],
+                        "displayMode": "list",
+                        "placement": "bottom"
+                    },
+                    "tooltip": {
+                        "mode": "single"
+                    }
+                },
+                "targets": [
+                    {
+                        "exemplar": true,
+                        "expr": "sum by (name) (aetheredge_e2e_tests_ok{name=~\"$agents\"})",
+                        "interval": "",
+                        "legendFormat": "{{name}}",
+                        "queryType": "randomWalk",
+                        "refId": "A"
+                    }
+                ],
+                "title": "Monitoring agents E2E Test",
+                "type": "timeseries"
+            }
+        ],
+        "refresh": "",
+        "schemaVersion": 30,
+        "style": "light",
+        "tags": [],
+        "templating": {
+            "list": [
+                {
+                    "label" : "Agents",
+                    "multi" : true,
+                    "name" : "agents",
+                    "type" : "query",
+                    "datasource": "$ds",
+                    "definition": "label_values(aetheredge_e2e_tests_ok, name)",
+                    "query": {
+                        "query": "label_values(aetheredge_e2e_tests_ok, name)",
+                        "refId": "StandardVariableQuery"
+                    },
+                    "refresh": 1,  
+                    "sort" : 1
+                },
+		{
+                    "label" : "Datasource",
+                    "multi" : false,
+                    "name" : "ds",
+                    "type" : "datasource",
+                    "query": "prometheus",
+                    "queryValue": "",
+                    "refresh": 1,
+                    "regex": ""
+                }
+	    ] 
+        },
+        "time": {
+            "from": "now-15m",
+            "to": "now"
+        },
+        "timepicker": {},
+        "timezone": "",
+        "title": "E2E Tests",
+        "uid": "site-monitoring",
+        "version": 1
+    }
+
+
diff --git a/aether-roc-umbrella/files/dashboards/ue/ue-connectivity.json b/aether-roc-umbrella/files/dashboards/ue/ue-connectivity.json
new file mode 100644
index 0000000..3bae4ed
--- /dev/null
+++ b/aether-roc-umbrella/files/dashboards/ue/ue-connectivity.json
@@ -0,0 +1,137 @@
+{
+ 
+    "annotations": {
+      "list": [
+        {
+          "builtIn": 1,
+          "datasource": "-- Grafana --",
+          "enable": true,
+          "hide": true,
+          "iconColor": "rgba(0, 211, 255, 1)",
+          "name": "Annotations & Alerts",
+          "type": "dashboard"
+        }
+      ]
+    },
+    "editable": false,
+    "gnetId": null,
+    "graphTooltip": 0,
+    "links": [],
+    "panels": [
+      {
+        "datasource": "$acc",
+        "description": "UE Connectivity",
+        "fieldConfig": {
+          "defaults": {
+            "color": {
+              "mode": "palette-classic"
+            },
+            "custom": {
+              "axisLabel": "",
+              "axisPlacement": "auto",
+              "barAlignment": 0,
+              "drawStyle": "line",
+              "fillOpacity": 0,
+              "gradientMode": "none",
+              "hideFrom": {
+                "legend": false,
+                "tooltip": false,
+                "viz": false
+              },
+              "lineInterpolation": "linear",
+              "lineWidth": 1,
+              "pointSize": 5,
+              "scaleDistribution": {
+                "type": "linear"
+              },
+              "showPoints": "auto",
+              "spanNulls": false,
+              "stacking": {
+                "group": "A",
+                "mode": "none"
+              },
+              "thresholdsStyle": {
+                "mode": "off"
+              }
+            },
+            "mappings": [],
+            "thresholds": {
+              "mode": "absolute",
+              "steps": [
+                {
+                  "color": "green",
+                  "value": null
+                },
+                {
+                  "color": "red",
+                  "value": 80
+                }
+              ]
+            }
+          },
+          "overrides": []
+        },
+        "gridPos": {
+          "h": 8,
+          "w": 12,
+          "x": 0,
+          "y": 0
+        },
+        "id": 1,
+        "options": {
+          "legend": {
+            "calcs": [],
+            "displayMode": "list",
+            "placement": "bottom"
+          },
+          "tooltip": {
+            "mode": "single"
+          }
+        },
+        "targets": [
+          {
+            "exemplar": true,
+            "expr": "subscribers_info{imsi=\"$imsi\"}",
+            "interval": "",
+            "legendFormat": "Connectivity",
+            "queryType": "randomWalk",
+            "refId": "A"
+          }
+        ],
+        "title": "UE $imsi Connectivity",
+        "type": "timeseries"
+      }
+    ],
+    "refresh": "",
+    "schemaVersion": 30,
+    "style": "light",
+    "tags": [],
+    "templating": {
+      "list": [
+          {
+                    "label" : "IMSI",
+                    "multi" : false,
+                    "name" : "imsi",
+                    "type" : "query",
+                    "datasource": "$acc",
+                    "definition": "label_values(subscribers_info, imsi)",
+                    "query": {
+                        "query": "label_values(subscribers_info, imsi)",
+                        "refId": "StandardVariableQuery"
+                    },
+                    "refresh": 1,  
+                    "sort" : 1
+        }
+      ]
+    },
+    "time": {
+      "from": "now-15m",
+      "to": "now"
+    },
+    "timepicker": {},
+    "timezone": "",
+    "title": "UE Connectivity",
+    "uid": "ue-conn",
+    "version": 1
+  }
+
diff --git a/aether-roc-umbrella/templates/dashboards-templated.yaml b/aether-roc-umbrella/templates/dashboards-templated.yaml
new file mode 100644
index 0000000..7b2000b
--- /dev/null
+++ b/aether-roc-umbrella/templates/dashboards-templated.yaml
@@ -0,0 +1,13 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ .Release.Name }}-dashboards-templated
+  namespace: {{ .Release.Namespace }}
+  labels:
+          grafana_dashboard: "aether-roc-gui"
+data:
+{{ (.Files.Glob "files/dashboards/**/*.json").AsConfig | indent 2 }}
diff --git a/aether-roc-umbrella/values.yaml b/aether-roc-umbrella/values.yaml
index 1b7ffc7..df08183 100644
--- a/aether-roc-umbrella/values.yaml
+++ b/aether-roc-umbrella/values.yaml
@@ -148,7 +148,12 @@
   config:
     upstream: http://aether-roc-umbrella-prometheus-acc-server
 
-grafana: 
+grafana:
+  sidecar:
+    dashboards:
+       enabled: true
+       label: grafana_dashboard
+       labelValue: aether-roc-gui 
   grafana.ini:
     log:
       level: debug