Helm scripts for alarm adapter
Change-Id: Ic841d1cdb8c5dc1b3b5b788559b9ef311e0c00ec
Signed-off-by: wahidw <abdulwahid.w@nokia.com>
diff --git a/helm/alarmadapter/.helmignore b/helm/alarmadapter/.helmignore
new file mode 100644
index 0000000..50af031
--- /dev/null
+++ b/helm/alarmadapter/.helmignore
@@ -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
index 0000000..af55ed9
--- /dev/null
+++ b/helm/alarmadapter/Chart.yaml
@@ -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
index 0000000..855acfe
--- /dev/null
+++ b/helm/alarmadapter/requirements.yaml
@@ -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
index 0000000..42f6ceb
--- /dev/null
+++ b/helm/alarmadapter/templates/config.yaml
@@ -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
index 0000000..4a9870d
--- /dev/null
+++ b/helm/alarmadapter/templates/deployment.yaml
@@ -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
index 0000000..84dd783
--- /dev/null
+++ b/helm/alarmadapter/templates/env.yaml
@@ -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
index 0000000..977c552
--- /dev/null
+++ b/helm/alarmadapter/templates/service-http.yaml
@@ -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
index 0000000..1fd71c6
--- /dev/null
+++ b/helm/alarmadapter/templates/service-rmr.yaml
@@ -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
index 0000000..a2fd3c1
--- /dev/null
+++ b/helm/alarmadapter/values.yaml
@@ -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"