Helm scripts for alarm adapter 28/3028/3
authorwahidw <abdulwahid.w@nokia.com>
Fri, 27 Mar 2020 10:10:19 +0000 (10:10 +0000)
committerLusheng Ji <lji@research.att.com>
Tue, 14 Apr 2020 23:21:52 +0000 (23:21 +0000)
Change-Id: Ic841d1cdb8c5dc1b3b5b788559b9ef311e0c00ec
Signed-off-by: wahidw <abdulwahid.w@nokia.com>
12 files changed:
RECIPE_EXAMPLE/example_recipe.yaml
bin/install
bin/uninstall
helm/alarmadapter/.helmignore [new file with mode: 0644]
helm/alarmadapter/Chart.yaml [new file with mode: 0644]
helm/alarmadapter/requirements.yaml [new file with mode: 0644]
helm/alarmadapter/templates/config.yaml [new file with mode: 0644]
helm/alarmadapter/templates/deployment.yaml [new file with mode: 0644]
helm/alarmadapter/templates/env.yaml [new file with mode: 0644]
helm/alarmadapter/templates/service-http.yaml [new file with mode: 0644]
helm/alarmadapter/templates/service-rmr.yaml [new file with mode: 0644]
helm/alarmadapter/values.yaml [new file with mode: 0644]

index d72e25d..8747a4c 100644 (file)
@@ -184,3 +184,9 @@ xapponboarder:
      name: chartmuseum/chartmuseum
      tag: v0.8.2
   allow_redeploy: "True"
+
+alarmadapter:
+  image:
+    registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
+    name: ric-plt-alarm-go
+    tag: 0.4.3
index dc66832..e705e5e 100755 (executable)
@@ -71,7 +71,7 @@ INFRANAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *infra:/{print $2}')
 XAPPNAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *xapp:/{print $2}')
 RELEASE_PREFIX=$(echo "$COMMON_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
 # replace the dbaasha with dbaas1 if deploying non HA DBaaS
-COMPONENTS=${LIST_OF_COMPONENTS:-"infrastructure xapp-onboarder appmgr rtmgr dbaas1 e2mgr e2term a1mediator submgr vespamgr jaegeradapter o1mediator"}
+COMPONENTS=${LIST_OF_COMPONENTS:-"infrastructure xapp-onboarder appmgr rtmgr dbaas1 e2mgr e2term a1mediator submgr vespamgr jaegeradapter o1mediator alarmadapter"}
 echo "Deploying RIC infra components [$COMPONENTS]"
 
 
index 9f4f385..bb3091b 100755 (executable)
@@ -16,7 +16,7 @@
 #   limitations under the License.                                             #
 ################################################################################
 
-COMPONENTS="xapp-onboarder appmgr rtmgr dbaas1 dbaasha e2mgr e2term a1mediator submgr vespamgr jaegeradapter infrastructure o1mediator"
+COMPONENTS="xapp-onboarder appmgr rtmgr dbaas1 dbaasha e2mgr e2term a1mediator submgr vespamgr jaegeradapter infrastructure o1mediator alarmadapter"
 RECIPE_NAMESPACE=$(kubectl get cm --all-namespaces | grep ricplt-recipe | awk '{print $1}')
 kubectl get configmap  -n $RECIPE_NAMESPACE ricplt-recipe  -o jsonpath='{.data.recipe}' > /tmp/recipe.yaml
 
diff --git a/helm/alarmadapter/.helmignore b/helm/alarmadapter/.helmignore
new file mode 100644 (file)
index 0000000..50af031
--- /dev/null
@@ -0,0 +1,22 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/helm/alarmadapter/Chart.yaml b/helm/alarmadapter/Chart.yaml
new file mode 100644 (file)
index 0000000..af55ed9
--- /dev/null
@@ -0,0 +1,22 @@
+################################################################################
+#   Copyright (c) 2019 AT&T Intellectual Property.                             #
+#   Copyright (c) 2019 Nokia.                                                  #
+#                                                                              #
+#   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
+appVersion: "1.0"
+description: Helm chart for RIC Alarm Adapter
+name: alarmadapter
+version: 3.0.0
diff --git a/helm/alarmadapter/requirements.yaml b/helm/alarmadapter/requirements.yaml
new file mode 100644 (file)
index 0000000..855acfe
--- /dev/null
@@ -0,0 +1,21 @@
+################################################################################
+#   Copyright (c) 2019 AT&T Intellectual Property.                             #
+#   Copyright (c) 2019 Nokia.                                                  #
+#                                                                              #
+#   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.                                             #
+################################################################################
+
+dependencies:
+  - name: ric-common
+    version: ^3.3.0
+    repository: "@local"
diff --git a/helm/alarmadapter/templates/config.yaml b/helm/alarmadapter/templates/config.yaml
new file mode 100644 (file)
index 0000000..42f6ceb
--- /dev/null
@@ -0,0 +1,52 @@
+#==================================================================================
+#   Copyright (c) 2019 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: alarmadaptercfg
+  namespace: ricplt
+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"
diff --git a/helm/alarmadapter/templates/deployment.yaml b/helm/alarmadapter/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..4a9870d
--- /dev/null
@@ -0,0 +1,76 @@
+################################################################################
+#   Copyright (c) 2019 AT&T Intellectual Property.                             #
+#   Copyright (c) 2019 Nokia.                                                  #
+#                                                                              #
+#   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.                                             #
+################################################################################
+{{- $imagectx := dict "ctx" . "defaultregistry" .Values.alarmadapter.image.registry }}
+{{- $pullpolicyctx := dict "ctx" . "defaultpullpolicy" .Values.alarmadapter.imagePullPolicy }}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "common.deploymentname.alarmadapter" . }}
+  namespace: {{ include "common.namespace.platform" . }}
+  labels:
+    app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmadapter" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  replicas: {{ .Values.alarmadapter.replicaCount }}
+  selector:
+    matchLabels:
+      app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmadapter" . }}
+      release: {{ .Release.Name }}
+  template:
+    metadata:
+      {{- if .Values.alarmadapter.annotations }}
+      annotations:
+        {{- .Values.alarmadapter.annotations | nindent 8 -}}
+      {{ end }}
+      labels:
+        app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmadapter" . }}
+        release: {{ .Release.Name }}
+    spec:
+      hostname: {{ include "common.name.alarmadapter" . }}
+      imagePullSecrets:
+        - name: {{ include "common.dockerregistry.credential" $imagectx }}
+      containers:
+        - 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"]
+          envFrom:
+            - configMapRef:
+                name: {{ include "common.configmapname.alarmadapter" . }}-env
+          volumeMounts:
+            - mountPath: /cfg
+              name: config-volume
+              readOnly: true
+          ports:
+            - name: "http"
+              containerPort: {{ include "common.serviceport.alarmadapter.http" . }}
+            - name: "rmrroute"
+              containerPort: {{ include "common.serviceport.alarmadapter.rmr.route" . }}
+            - name: "rmrdata"
+              containerPort: {{ include "common.serviceport.alarmadapter.rmr.data" . }}
+      volumes:
+        - name: config-volume
+          configMap:
+            name: alarmadaptercfg
+            items:
+              - key: alarmadaptercfg
+                path: alarmadapter-config.yaml
+                mode: 0644
diff --git a/helm/alarmadapter/templates/env.yaml b/helm/alarmadapter/templates/env.yaml
new file mode 100644 (file)
index 0000000..84dd783
--- /dev/null
@@ -0,0 +1,27 @@
+#   Copyright (c) 2019 AT&T Intellectual Property.                             #
+#   Copyright (c) 2019 Nokia.                                                  #
+#                                                                              #
+#   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.alarmadapter" . }}-env
+data:
+  DBAAS_SERVICE_HOST: {{ include "common.servicename.dbaas.tcp" . | quote }}
+  DBAAS_SERVICE_PORT: {{ include "common.serviceport.dbaas.tcp" . | quote }}
+  DBAAS_PORT_6379_TCP_ADDR: {{ include "common.servicename.dbaas.tcp" . | quote }}
+  DBAAS_PORT_6379_TCP_PORT: {{ include "common.serviceport.dbaas.tcp" . | quote }}
+  RMR_RTG_SVC: {{ include "common.serviceport.alarmadapter.rmr.route" . | quote }}
+  RMR_SRC_ID: {{ include "common.servicename.alarmadapter.rmr" . }}.{{ include "common.namespace.platform" . }}
+  CFGFILE: "/cfg/alarmadapter-config.yaml"
diff --git a/helm/alarmadapter/templates/service-http.yaml b/helm/alarmadapter/templates/service-http.yaml
new file mode 100644 (file)
index 0000000..977c552
--- /dev/null
@@ -0,0 +1,40 @@
+#
+#==================================================================================
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#   Copyright (c) 2019 Nokia
+#
+#   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.
+#==================================================================================
+#
+#
+#
+kind: Service
+apiVersion: v1
+metadata:
+  name: {{ include "common.servicename.alarmadapter.http" . }}
+  namespace: {{ include "common.namespace.platform" . }}
+  labels:
+    app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmadapter" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  selector:
+    app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmadapter" . }}
+    release: {{ .Release.Name }}
+  clusterIP: None
+  ports:
+  - name: http
+    port: {{ include "common.serviceport.alarmadapter.http" . }}
+    protocol: TCP
+    targetPort: http
diff --git a/helm/alarmadapter/templates/service-rmr.yaml b/helm/alarmadapter/templates/service-rmr.yaml
new file mode 100644 (file)
index 0000000..1fd71c6
--- /dev/null
@@ -0,0 +1,42 @@
+#
+#==================================================================================
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#   Copyright (c) 2019 Nokia
+#
+#   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.
+#==================================================================================
+kind: Service
+apiVersion: v1
+metadata:
+  name: {{ include "common.servicename.alarmadapter.rmr" . }}
+  namespace: {{ include "common.namespace.platform" . }}
+  labels:
+    app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmadapter" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  selector:
+    app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmadapter" . }}
+    release: {{ .Release.Name }}       
+  clusterIP: None
+  ports:
+  - name: rmrdata
+    port: {{ include "common.serviceport.alarmadapter.rmr.data" . }}
+    protocol: TCP
+    targetPort: rmrdata
+  - name: rmrroute
+    port: {{ include "common.serviceport.alarmadapter.rmr.route" . }}
+    protocol: TCP
+    targetPort: rmrroute
+
diff --git a/helm/alarmadapter/values.yaml b/helm/alarmadapter/values.yaml
new file mode 100644 (file)
index 0000000..a2fd3c1
--- /dev/null
@@ -0,0 +1,22 @@
+################################################################################
+#   Copyright (c) 2019 AT&T Intellectual Property.                             #
+#   Copyright (c) 2019 Nokia.                                                  #
+#                                                                              #
+#   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.                                             #
+################################################################################
+alarmadapter:
+  imagePullPolicy: IfNotPresent
+  image:
+    name: ric-plt-alarm-go
+    tag: 0.4.3
+    registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"