Chronos exporter: Added demo alert file to helm chart

Change-Id: Iea692517754d1f7bc2f95f5d47bb570a2b0cfe5c
diff --git a/chronos-exporter/Chart.yaml b/chronos-exporter/Chart.yaml
index 081f3c7..afffe47 100644
--- a/chronos-exporter/Chart.yaml
+++ b/chronos-exporter/Chart.yaml
@@ -7,8 +7,8 @@
 description: Chronos Exporter

 kubeVersion: ">=1.15.0"

 type: application

-version: 0.0.18

-appVersion: v0.0.16

+version: 0.0.19

+appVersion: v0.0.17

 keywords:

   - aether

   - exporter

diff --git a/chronos-exporter/files/alerts/demo-alert.yaml b/chronos-exporter/files/alerts/demo-alert.yaml
new file mode 100644
index 0000000..fe1f5a6
--- /dev/null
+++ b/chronos-exporter/files/alerts/demo-alert.yaml
@@ -0,0 +1,49 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>

+#

+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0

+---

+  - alert-id: 21e43108-8c6b-4c92-b80a-b1f365ae14ea

+    configpath: "/sites/site[site-id=fremont]/devices/device[serial-number=752365A]"

+    message: Device error - 123

+    raised-at: '2022-01-27T11:31:02Z'

+    severity: CRITICAL

+  - alert-id: 57321f48-c0c8-4a0f-b2dd-fd98aa584bb4

+    configpath: "/sites/site[site-id=fremont]/devices/device[serial-number=7568111]"

+    message: Device error - 456

+    raised-at: '2022-01-27T11:20:02Z'

+    severity: CRITICAL

+  - alert-id: 11b289ec-3773-4203-a2c4-79b20daae4bd

+    configpath: "/sites/site[site-id=fremont]/slices/slice[slice-id=fremont-slice-cameras]"

+    message: slice problem abc

+    raised-at: '2022-01-27T10:22:11Z'

+    severity: WARNING

+  - alert-id: 76678889-3586-488f-810b-dbfa0709705d

+    configpath: "/sites/site[site-id=fremont]/small-cells/small-cell[small-cell-id=fremont-sc-east]"

+    message: Small cell temperature warning

+    raised-at: '2022-01-27T09:55:02Z'

+    severity: WARNING

+  - alert-id: ed0633d6-0df2-4548-8099-6bcf97e0b07a

+    configpath: "/sites/site[site-id=fremont]/devices/device[serial-number=7568114]"

+    message: Camera focus error - 123

+    raised-at: '2022-01-27T09:55:12Z'

+    severity: INFO

+  - alert-id: 91eb5c78-61ee-437b-b09f-119124f374f9

+    configpath: "/sites/site[site-id=bengaluru]/devices/device[serial-number=9870002]"

+    message: Phone error - 123

+    raised-at: '2022-01-27T10:31:02Z'

+    severity: CRITICAL

+  - alert-id: c3a03710-dc01-42ed-a5cb-47bec37d11c5

+    configpath: "/sites/site[site-id=bengaluru]/devices/device[serial-number=80003XC]"

+    message: Drone battery low

+    raised-at: '2022-01-27T10:15:02Z'

+    severity: WARNING

+  - alert-id: 508c8770-f012-401d-a1d3-b59fc943e8e3

+    configpath: "/sites/site[site-id=berlin]/small-cells/small-cell[small-cell-id=berlin-sc-north]"

+    message: Small cell on backup power drop

+    raised-at: '2022-01-27T10:42:02Z'

+    severity: CRITICAL

+  - alert-id: e693f045-3407-421a-80a6-0eaeb291483a

+    configpath: "/sites/site[site-id=berlin]/devices/device[serial-number=18876885]"

+    message: Camera error - 123

+    raised-at: '2022-01-27T09:55:02Z'

+    severity: WARNING

diff --git a/chronos-exporter/templates/configmap.yaml b/chronos-exporter/templates/configmap.yaml
index 393926f..53bdb4e 100644
--- a/chronos-exporter/templates/configmap.yaml
+++ b/chronos-exporter/templates/configmap.yaml
@@ -48,3 +48,15 @@
   {{ base $path }}: '{{ $root.Files.Get $path | b64enc }}'
   {{ end }}
 
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ template "chronos-exporter.fullname" . }}-alert
+  labels:
+    app: {{ template "chronos-exporter.fullname" . }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    release: "{{ .Release.Name }}"
+    heritage: "{{ .Release.Service }}"
+data:
+{{ (.Files.Glob "files/alerts/*.yaml").AsConfig | indent 2 }}
diff --git a/chronos-exporter/templates/deployment.yaml b/chronos-exporter/templates/deployment.yaml
index bfe6ae5..750300b 100644
--- a/chronos-exporter/templates/deployment.yaml
+++ b/chronos-exporter/templates/deployment.yaml
@@ -47,6 +47,8 @@
             - "/usr/local/bin/chronos-exporter"

             - "--config"

             - {{ .Values.configfile }}

+            - "--alert"

+            - {{ .Values.alertfile }}

           ports:

             - name: metrics

               containerPort: 2112

@@ -72,6 +74,9 @@
             - name: exporter-site-plans

               mountPath: /opt/site-plans/fremont

               readOnly: true

+            - name: exporter-alert

+              mountPath: /etc/chronos-exporter/alerts

+              readOnly: true

       volumes:

         - name: secret

           secret:

@@ -85,3 +90,6 @@
         - name: exporter-site-plans

           configMap:

             name: {{ template "chronos-exporter.fullname" . }}-site-plans

+        - name: exporter-alert

+          configMap:

+            name: {{ template "chronos-exporter.fullname" . }}-alert

diff --git a/chronos-exporter/values.yaml b/chronos-exporter/values.yaml
index c9e1c7d..c13aed0 100644
--- a/chronos-exporter/values.yaml
+++ b/chronos-exporter/values.yaml
@@ -10,7 +10,7 @@
 

 image:

   repository: onosproject/chronos-exporter

-  tag: v0.0.16

+  tag: v0.0.17

   pullPolicy: IfNotPresent

   pullSecrets: []

 

@@ -18,3 +18,4 @@
   type: ClusterIP

 

 configfile: /etc/chronos-exporter/configs/demo-configuration.yaml

+alertfile: /etc/chronos-exporter/alerts/demo-alert.yaml

diff --git a/chronos-umbrella/Chart.yaml b/chronos-umbrella/Chart.yaml
index e693979..8e5b7e9 100644
--- a/chronos-umbrella/Chart.yaml
+++ b/chronos-umbrella/Chart.yaml
@@ -7,7 +7,7 @@
 description: Chronos Umbrella chart to deploy all Aether ROC

 kubeVersion: ">=1.18.0"

 type: application

-version: 0.1.20

+version: 0.1.21

 appVersion: v0.0.0

 keywords:

   - aether

@@ -29,7 +29,7 @@
   - name: chronos-exporter

     condition: import.chronos-exporter.enabled

     repository: "file://../chronos-exporter"

-    version: 0.0.18

+    version: 0.0.19

   - name: aether-enterprise-portal

     condition: import.aether-enterprise-portal.enabled

     repository: "file://../aether-enterprise-portal"