Fix for RIC alarm flow 70/4070/7
authorLusheng Ji <lji@research.att.com>
Thu, 11 Jun 2020 14:27:19 +0000 (10:27 -0400)
committerLusheng Ji <lji@research.att.com>
Thu, 11 Jun 2020 20:22:21 +0000 (16:22 -0400)
Change-Id: I63993075791246983adb343a9a694a710a9bee88
Signed-off-by: Lusheng Ji <lji@research.att.com>
19 files changed:
RECIPE_EXAMPLE/example_recipe.yaml
helm/alarmadapter/templates/config.yaml
helm/alarmadapter/templates/deployment.yaml
helm/alarmadapter/templates/env.yaml
helm/alarmadapter/templates/service-http.yaml
helm/alarmadapter/templates/service-rmr.yaml
helm/alarmadapter/values.yaml
helm/infrastructure/subcharts/prometheus/values.yaml
helm/o1mediator/resources/config-file.json [new file with mode: 0644]
helm/o1mediator/resources/uta_rtg.rt [new file with mode: 0644]
helm/o1mediator/templates/appconfig.yaml [new file with mode: 0644]
helm/o1mediator/templates/deployment.yaml
helm/o1mediator/templates/env.yaml [new file with mode: 0644]
helm/o1mediator/values.yaml
helm/vespamgr/requirements.yaml
helm/vespamgr/templates/deployment.yaml
helm/vespamgr/templates/service.yaml
helm/vespamgr/templates/vespa-config.yaml
helm/vespamgr/values.yaml

index a3b80d9..f494744 100644 (file)
@@ -53,6 +53,8 @@ extsvcplt:
 #        password: ""
 #        email: ""
 
+prometheus:
+  enabled: true
 
 a1mediator:
   image:
@@ -84,7 +86,7 @@ dbaas:
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
     name: ric-plt-dbaas
     tag: 0.2.2
-  enableHighAvailability: true
+  enableHighAvailability: false
   # Enable pod anti affinity only if you have more than 3 k8s nodes
   enablePodAntiAffinity: false
 
@@ -141,7 +143,7 @@ rtmgr:
   image:
     registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
     name: ric-plt-rtmgr
-    tag: 0.6.0
+    tag: 0.6.1
   rpe: rmrpush
   sbi: nngpush
   sbiurl: 0.0.0.0
@@ -159,7 +161,7 @@ vespamgr:
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
     name: ric-plt-vespamgr
     tag: 0.4.0
-  prometheusurl: "http://rec-prometheus-server.default"
+  prometheusurl: "http://r4-infrastructure-prometheus-server.ricplt"
 
 o1mediator:
   image:
@@ -172,7 +174,7 @@ xapponboarder:
    xapponboarder:
      registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
      name: xapp-onboarder
-     tag: 1.0.5
+     tag: 1.0.7
    chartmuseum:
      registry: "docker.io"
      name: chartmuseum/chartmuseum
@@ -183,4 +185,4 @@ alarmadapter:
   image:
     registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
     name: ric-plt-alarmadapter
-    tag: 0.4.4
+    tag: 0.4.5
index 42f6ceb..532a5b9 100644 (file)
@@ -1,5 +1,5 @@
 #==================================================================================
-#   Copyright (c) 2019 AT&T Intellectual Property.
+#   Copyright (c) 2019,2020 AT&T Intellectual Property.
 #
 #   Licensed under the Apache License, Version 2.0 (the "License");
 #   you may not use this file except in compliance with the License.
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: alarmadaptercfg
-  namespace: ricplt
+  name: {{ include "common.configmapname.alarmadapter" . }}-appconfig
+  namespace: {{ include "common.namespace.platform" . }}
 data:
-  # FQDN and port info of rtmgr
-  alarmadaptercfg: |
-    "local": 
-      "host": ":8080"
-    "logger": 
-      "level": 4
-    "db" : 
-      "namespaces": 
-        - 
-          "sdl"
-        - 
-          "rnib"
-    "rmr": 
-      "protPort": "tcp:4560"
-      "maxSize": 1024
-      "numWorkers": 1
-      "promAlertManager": 
-    "address": "elfkp-prometheus-alertmanager:9093"
-    "baseUrl": "/api/v2"
-    "schemes": http
-    "alertInterval": 30000
-    "alarmDefinitions: 
-      - 
-        "specificProblem": 1234
-        "Text": "Connection to DBAAS server lost"
-      -  
-        "specificProblem": 1235
-        "Text": "Distribution of internal routing table failed due to timeout"
-      - 
-        "specificProblem": 1236
-        "Text": "E2 connection to gNB lost"
+  config-file.json: |-
+    {
+      "local": {
+        "host": ":8080"
+      },
+      "logger": {
+        "level": 4
+      },
+      "db": {
+        "namespaces": ["sdl", "rnib"]
+      },
+      "rmr": {
+        "protPort": "tcp:4560",
+        "maxSize": 1024,
+        "numWorkers": 1
+      },
+      "promAlertManager": {
+        "address": {{ .Values.alarmadapter.alertManagerAddress | quote }},
+        "baseUrl": "/api/v2",
+        "schemes": "http",
+        "alertInterval": 30000
+      },
+      "alarmDefinitions": [
+        {
+          "specificProblem": 1234,
+          "Text": "Connection to DBAAS server lost"
+        },
+        {
+          "specificProblem": 1235,
+          "Text": "Distribution of internal routing table failed due to timeout"
+        },
+        {
+          "specificProblem": 1236,
+          "Text": "E2 connection to gNB lost"
+        }
+      ]
+    }
index 2a98220..47e8e66 100644 (file)
@@ -49,18 +49,19 @@ spec:
         - name: {{ include "common.containername.alarmadapter" . }}
           image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .Values.alarmadapter.image.name }}:{{ .Values.alarmadapter.image.tag }}
           imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
-          command: ["/run_adapter.sh"]
           #command: ["/bin/sh"]
           #args: ["-c", "while true; do echo hello; sleep 10;done"]
+          command: ["/bin/sh"]
+          args: ["-c", "/alarm-adapter -f /alarmadaptercfg/config-file.json"]
           envFrom:
             - configMapRef:
                 name: {{ include "common.configmapname.alarmadapter" . }}-env
             - configMapRef:
                 name: {{ include "common.configmapname.dbaas" . }}-appconfig
           volumeMounts:
-            - mountPath: /cfg
-              name: config-volume
-              readOnly: true
+            - mountPath: /alarmadaptercfg
+              name: appconfig-file
+              subpath: config-file.json
           ports:
             - name: "http"
               containerPort: {{ include "common.serviceport.alarmadapter.http" . }}
@@ -69,10 +70,6 @@ spec:
             - name: "rmrdata"
               containerPort: {{ include "common.serviceport.alarmadapter.rmr.data" . }}
       volumes:
-        - name: config-volume
+        - name: appconfig-file
           configMap:
-            name: alarmadaptercfg
-            items:
-              - key: alarmadaptercfg
-                path: alarmadapter-config.yaml
-                mode: 0644
+            name: {{ include "common.configmapname.alarmadapter" . }}-appconfig
index 545b266..ac1569e 100644 (file)
@@ -18,6 +18,6 @@ kind: ConfigMap
 metadata:
   name: {{ include "common.configmapname.alarmadapter" . }}-env
 data:
-  RMR_RTG_SVC: {{ include "common.serviceport.alarmadapter.rmr.route" . | quote }}
+  RMR_RTG_SVC: {{ include "common.servicename.rtmgr.rmr" . }}:{{ include "common.serviceport.rtmgr.rmr.route" . }}
+  RMR_SEED_RT: "/uta_rtg.rt"
   RMR_SRC_ID: {{ include "common.servicename.alarmadapter.rmr" . }}.{{ include "common.namespace.platform" . }}
-  CFGFILE: "/cfg/alarmadapter-config.yaml"
index 977c552..b589851 100644 (file)
@@ -32,7 +32,7 @@ spec:
   selector:
     app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmadapter" . }}
     release: {{ .Release.Name }}
-  clusterIP: None
+  type: ClusterIP
   ports:
   - name: http
     port: {{ include "common.serviceport.alarmadapter.http" . }}
index 1fd71c6..3cb6796 100644 (file)
@@ -29,7 +29,7 @@ spec:
   selector:
     app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmadapter" . }}
     release: {{ .Release.Name }}       
-  clusterIP: None
+  type: ClusterIP
   ports:
   - name: rmrdata
     port: {{ include "common.serviceport.alarmadapter.rmr.data" . }}
index a2fd3c1..b8ddbff 100644 (file)
@@ -20,3 +20,5 @@ alarmadapter:
     name: ric-plt-alarm-go
     tag: 0.4.3
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
+
+  alertManagerAddress: "r4-infrastructure-prometheus-alertmanager:80"
index 6afa967..601b438 100644 (file)
@@ -30,7 +30,7 @@ serviceAccounts:
 alertmanager:
   ## If false, alertmanager will not be installed
   ##
-  enabled: false
+  enabled: true
 
   ## alertmanager container name
   ##
@@ -169,7 +169,7 @@ alertmanager:
     ## If true, alertmanager will create/use a Persistent Volume Claim
     ## If false, use emptyDir
     ##
-    enabled: true
+    enabled: false
 
     ## alertmanager data Persistent Volume access modes
     ## Must match those of existing PV or dynamic provisioner
@@ -1117,20 +1117,27 @@ pushgateway:
 ##
 alertmanagerFiles:
   alertmanager.yml:
-    global: {}
-      # slack_api_url: ''
-
+    global:
+      resolve_timeout: 5m
+    route:
+      group_wait: 5s
+      group_interval: 3m
+      repeat_interval: 1h
+      group_by: ['alertname', 'severity', 'instance', 'job']
+      receiver: vespa
+      routes:
+      #  - receiver: echo
+      #    continue: true
+        - receiver: vespa
+          continue: true
     receivers:
-      - name: default-receiver
-        # slack_configs:
-        #  - channel: '@you'
-        #    send_resolved: true
+    #  - name: echo
+    #    webhook_configs:
+    #      - url: 'http://10.244.0.1:5001'
+      - name: vespa
+        webhook_configs:
+          - url: 'http://service-ricplt-vespamgr-http:9095/alerts'
 
-    route:
-      group_wait: 10s
-      group_interval: 5m
-      receiver: default-receiver
-      repeat_interval: 3h
 
 ## Prometheus server ConfigMap entries
 ##
diff --git a/helm/o1mediator/resources/config-file.json b/helm/o1mediator/resources/config-file.json
new file mode 100644 (file)
index 0000000..e7fc512
--- /dev/null
@@ -0,0 +1,28 @@
+{
+    "local": {
+        "host": ":8080"
+    },
+    "logger": {
+        "level": 4
+    },
+    "db": {
+        "namespaces": ["sdl", "rnib"]
+    },
+    "rmr": {
+        "protPort": "tcp:4560",
+        "maxSize": 65536,
+        "numWorkers": 1
+    },
+    "sbi": {
+        "appmgrAddr": "{{ include "common.servicename.appmgr.http" . }}:{{ include "common.serviceport.appmgr.http" . }}",
+        "alertmgrAddr": {{ .Values.o1mediator.prometheusAMUrl | quote }},
+        "timeout": 30
+    },
+    "nbi": {
+        "schemas": ["o-ran-sc-ric-xapp-desc-v1", "o-ran-sc-ric-ueec-config-v1"]
+    },
+    "controls": {
+        "active": true
+    }
+}
+
diff --git a/helm/o1mediator/resources/uta_rtg.rt b/helm/o1mediator/resources/uta_rtg.rt
new file mode 100644 (file)
index 0000000..900f071
--- /dev/null
@@ -0,0 +1,4 @@
+newrt|start
+rte|13111|127.0.0.1:4588
+rte|13111|127.0.0.1:4560
+newrt|end
diff --git a/helm/o1mediator/templates/appconfig.yaml b/helm/o1mediator/templates/appconfig.yaml
new file mode 100644 (file)
index 0000000..5262dfa
--- /dev/null
@@ -0,0 +1,23 @@
+################################################################################
+#   Copyright (c) 2020 AT&T Intellectual Property.                             #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ include "common.configmapname.o1mediator" . }}-appconfig-configmap
+  namespace: {{ include "common.namespace.platform" . }}
+data:
+{{ tpl (.Files.Glob "resources/*").AsConfig . | indent 2 }}
index ddd2685..71fc663 100644 (file)
@@ -1,5 +1,5 @@
 ################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
+#   Copyright (c) 2019,2020 AT&T Intellectual Property.                        #
 #   Copyright (c) 2019 Nokia.                                                  #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
@@ -55,6 +55,11 @@ spec:
           envFrom:
             - configMapRef:
                 name: {{ include "common.configmapname.dbaas" . }}-appconfig
+            - configMapRef:
+                name: {{ include "common.configmapname.o1mediator" . }}-env
+          volumeMounts:
+            - mountPath: /etc/o1agent
+              name: appconfig-file
           ports:
             - name: http-supervise
               containerPort: {{ include "common.serviceport.o1mediator.http.supervise" . }}
@@ -65,3 +70,7 @@ spec:
             - name: http-event
               containerPort: {{ include "common.serviceport.o1mediator.http.event" . }}
               protocol: TCP
+      volumes:
+        - name: appconfig-file
+          configMap:
+            name: {{ include "common.configmapname.o1mediator" . }}-appconfig-configmap
diff --git a/helm/o1mediator/templates/env.yaml b/helm/o1mediator/templates/env.yaml
new file mode 100644 (file)
index 0000000..58ada9a
--- /dev/null
@@ -0,0 +1,20 @@
+#   Copyright (c) 2020 AT&T Intellectual Property.                             #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ include "common.configmapname.o1mediator" . }}-env
+data:
+  RMR_SEED_RT: "/etc/o1agent/uta_rtg.rt"
index 55d51ab..79240af 100644 (file)
@@ -22,6 +22,8 @@ o1mediator:
     tag: 0.3.1
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
 
+  prometheusAMUrl: "r4-infrastructure-prometheus-alertmanager:80"
+
   # Service ports are now defined in
   # ric-common/Common-Template/helm/ric-common/templates/_ports.tpl file.
   # If need to change a service port, make the code change necessary, then
index ba6a220..4207832 100644 (file)
@@ -17,5 +17,5 @@
 
 dependencies:
   - name: ric-common
-    version: ^3.1.0
+    version: ^3.3.2
     repository: "@local"
index 6c9db0b..6e2e225 100644 (file)
@@ -55,13 +55,16 @@ spec:
             - name: http
               containerPort: {{ include "common.serviceport.vespamgr.http" . }}
               protocol: TCP
+            - name: alert
+              containerPort: {{ include "common.serviceport.vespamgr.alert" . }}
+              protocol: TCP
           envFrom:
             - configMapRef:
                 name: {{ include "common.configmapname.vespamgr" . }}
             - secretRef:
                 name: vespa-secrets
           env:
-            - name: VESMGR_APPMGRDOMAIN
+            - name: VESMGR_APPMGRDOMAN
               value: {{ include "common.servicename.appmgr.http" . }}
           livenessProbe:
             httpGet:
index cb26519..634a256 100644 (file)
@@ -30,6 +30,10 @@ spec:
       protocol: "TCP"
       name: "http"
       targetPort: "http"
+    - port: {{ include "common.serviceport.vespamgr.alert" . }}
+      protocol: "TCP"
+      name: "alert"
+      targetPort: "alert"
   selector:
     app: {{ include "common.namespace.platform" . }}-{{ include "common.name.vespamgr" . }}
     release: {{ .Release.Name }}
index 60f4963..2efec72 100644 (file)
@@ -8,6 +8,9 @@ data:
   VESMGR_MEAS_INTERVAL: "30s"
   VESMGR_PRICOLLECTOR_ADDR: {{ include "common.ingresscontroller.url.aux" . | quote }}
   VESMGR_PRICOLLECTOR_SERVERROOT: {{ include "common.kongpath.aux.vescollector" . | quote }}
-  VESMGR_PRICOLLECTOR_PORT: "80"
+  VESMGR_PRICOLLECTOR_PORT: "8443"
   VESMGR_PRICOLLECTOR_SECURE: "false"
   VESMGR_PROMETHEUS_ADDR: {{ .Values.vespamgr.prometheusurl }}
+  VESMGR_PRICOLLECTOR_USER: "sample1"
+  VESMGR_PRICOLLECTOR_PASSWORD: "sample1"
+  VESMGR_ALERTMANAGER_BIND_ADDR: ":9095"
index a241eaf..23b709b 100644 (file)
@@ -24,7 +24,7 @@ vespamgr:
   replicaCount: 1
   image:
     name: ric-plt-vespamgr
-    tag: 0.0.8
+    tag: 0.4.0
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
 
   # Service ports are now defined in
@@ -32,4 +32,4 @@ vespamgr:
   # If need to change a service port, make the code change necessary, then
   # update the _ports.tpl file with the new port number.
   
-  prometheusurl: "http://rec-prometheus-server.default"
+  prometheusurl: "http://r4-infrastructure-prometheus-server.ricplt"