alarmadapter helm renamed to alarmmanager
modified requirements.yaml to update the ric-common version tag
renamed alarmadapter.tpl to alarmmanager.tpl
added reference to dbaas
helm version changed to 2.17.0
cherry update
Change-Id: I21197189f5f334d3c2bacaf857779240bca7e206
Signed-off-by: vipin <vipin.mavila@nokia.com>
diff --git a/helm/alarmmanager/.helmignore b/helm/alarmmanager/.helmignore
new file mode 100644
index 0000000..50af031
--- /dev/null
+++ b/helm/alarmmanager/.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/alarmmanager/Chart.yaml b/helm/alarmmanager/Chart.yaml
new file mode 100644
index 0000000..c279307
--- /dev/null
+++ b/helm/alarmmanager/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 Manager
+name: alarmmanager
+version: 5.0.0
diff --git a/helm/alarmmanager/requirements.yaml b/helm/alarmmanager/requirements.yaml
new file mode 100644
index 0000000..8030a8b
--- /dev/null
+++ b/helm/alarmmanager/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.2
+ repository: "@local"
diff --git a/helm/alarmmanager/templates/appconfig.yaml b/helm/alarmmanager/templates/appconfig.yaml
new file mode 100644
index 0000000..5f9af24
--- /dev/null
+++ b/helm/alarmmanager/templates/appconfig.yaml
@@ -0,0 +1,36 @@
+################################################################################
+# Copyright (c) 2020 AT&T Intellectual Property. #
+# Copyright (c) 2020 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. #
+################################################################################
+{{ $platformNameSpace := include "common.namespace.platform" . }}
+{{ $xAppNameSpace := include "common.namespace.xapp" . }}
+{{ $nameSpaceList := list $platformNameSpace $xAppNameSpace }}
+{{- range $nameSpaceList }}
+{{- $namespace := . }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+{{- if eq $namespace $platformNameSpace }}
+ name: {{ include "common.configmapname.alarmmanager" $ }}-appconfig
+{{- else }}
+ name: alarm-appconfig
+{{- end }}
+ namespace: {{ $namespace }}
+data:
+ ALARM_MGR_SERVICE_NAME: {{ include "common.servicename.alarmmanager.rmr" $ }}.{{ $platformNameSpace }}
+ ALARM_MGR_SERVICE_PORT: {{ include "common.serviceport.alarmmanager.rmr.data" $ | quote }}
+
+{{- end }}
diff --git a/helm/alarmmanager/templates/configmap.yaml b/helm/alarmmanager/templates/configmap.yaml
new file mode 100644
index 0000000..b01e24b
--- /dev/null
+++ b/helm/alarmmanager/templates/configmap.yaml
@@ -0,0 +1,50 @@
+#==================================================================================
+# 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: {{ include "common.configmapname.alarmmanager" . }}-alarmmanagercfg
+ namespace: {{ include "common.namespace.platform" . }}
+data:
+ alarmmanagercfg: |-
+ {
+ "local": {
+ "host": ":8080"
+ },
+ "logger": {
+ "level": 4
+ },
+ "db": {
+ "namespaces": ["sdl", "rnib"]
+ },
+ "rmr": {
+ "protPort": "tcp:4560",
+ "maxSize": 1024,
+ "numWorkers": 1
+ },
+ "controls": {
+ "promAlertManager": {
+ "address": "cpro-alertmanager:80",
+ "baseUrl": "api/v2",
+ "schemes": "http",
+ "alertInterval": 30000
+ },
+ "maxActiveAlarms": 5000,
+ "maxAlarmHistory": 20000,
+ "alarmInfoPvFile": "/mnt/pv-ricplt-alarmmanager/alarminfo.json"
+ }
+ }
diff --git a/helm/alarmmanager/templates/deployment.yaml b/helm/alarmmanager/templates/deployment.yaml
new file mode 100644
index 0000000..08b041e
--- /dev/null
+++ b/helm/alarmmanager/templates/deployment.yaml
@@ -0,0 +1,90 @@
+################################################################################
+# 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. #
+################################################################################
+{{- $topCtx := . }}
+{{- $imagectx := dict "ctx" . "defaultregistry" .Values.alarmmanager.image.registry }}
+{{- $pullpolicyctx := dict "ctx" . "defaultpullpolicy" .Values.alarmmanager.imagePullPolicy }}
+{{- $imagetag := .Values.alarmmanager.image.tag }}
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "common.deploymentname.alarmmanager" . }}
+ namespace: {{ include "common.namespace.platform" . }}
+ labels:
+ app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmmanager" . }}
+ chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ replicas: {{ .Values.alarmmanager.replicaCount }}
+ selector:
+ matchLabels:
+ app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmmanager" . }}
+ release: {{ .Release.Name }}
+ template:
+ metadata:
+ {{- if .Values.alarmmanager.annotations }}
+ annotations:
+ {{- .Values.alarmmanager.annotations | nindent 8 -}}
+ {{ end }}
+ labels:
+ app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmmanager" . }}
+ release: {{ .Release.Name }}
+ spec:
+ hostname: {{ include "common.name.alarmmanager" . }}
+ imagePullSecrets:
+ - name: {{ include "common.dockerregistry.credential" $imagectx }}
+ serviceAccountName: {{ include "common.serviceaccountname.alarmmanager" . }}
+ containers:
+ - name: {{ include "common.containername.alarmmanager" . }}
+ image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .Values.alarmmanager.image.name }}:{{ $imagetag }}
+ imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
+ env:
+ - name: PLT_NAMESPACE
+ value: {{ include "common.namespace.platform" . }}
+ envFrom:
+ - configMapRef:
+ name: {{ include "common.configmapname.dbaas" . }}-appconfig
+ - configMapRef:
+ name: {{ include "common.configmapname.alarmmanager" . }}-env
+ ports:
+ - name: rmrroute
+ containerPort: {{ include "common.serviceport.alarmmanager.rmr.route" . }}
+ protocol: TCP
+ - name: rmrdata
+ containerPort: {{ include "common.serviceport.alarmmanager.rmr.data" . }}
+ protocol: TCP
+ - name: http
+ containerPort: {{ include "common.serviceport.alarmmanager.http" . }}
+ protocol: TCP
+ volumeMounts:
+ - name: config-volume
+ mountPath: /cfg
+ - name: am-persistent-storage
+ mountPath: /mnt/pv-ricplt-alarmmanager
+ volumes:
+ - name: config-volume
+ configMap:
+ name: {{ include "common.configmapname.alarmmanager" . }}-alarmmanagercfg
+ #name: alarmmanagercfg
+ items:
+ - key: alarmmanagercfg
+ path: config-file.json
+ mode: 0644
+ - name: am-persistent-storage
+ persistentVolumeClaim:
+ claimName: {{ include "common.pvcname.alarmmanager" $topCtx }}
diff --git a/helm/alarmmanager/templates/env.yaml b/helm/alarmmanager/templates/env.yaml
new file mode 100644
index 0000000..e7649cd
--- /dev/null
+++ b/helm/alarmmanager/templates/env.yaml
@@ -0,0 +1,25 @@
+################################################################################
+# 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.alarmmanager" . }}-env
+ namespace: {{ include "common.namespace.platform" . }}
+data:
+ RMR_RTG_SVC: {{ include "common.servicename.rtmgr.rmr" . }}:{{ include "common.serviceport.rtmgr.rmr.route" . }}
+ RMR_SEED_RT: "/cfg/uta_rtg.rt"
+ RMR_SRC_ID: {{ include "common.servicename.alarmmanager.rmr" . }}.{{ include "common.namespace.platform" . }}
diff --git a/helm/alarmmanager/templates/pv.yaml b/helm/alarmmanager/templates/pv.yaml
new file mode 100644
index 0000000..bb780f1
--- /dev/null
+++ b/helm/alarmmanager/templates/pv.yaml
@@ -0,0 +1,34 @@
+################################################################################
+# 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. #
+################################################################################1
+{{- $topCtx := . }}
+{{if eq .Values.alarmmanager.storageClassName "local-storage" }}
+---
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: {{ include "common.pvname.alarmmanager" $topCtx }}
+ namespace: {{ include "common.namespace.platform" $topCtx }}
+ labels:
+ type: local
+spec:
+ storageClassName: {{ .Values.alarmmanager.storageClassName }}
+ capacity:
+ storage: {{ .Values.alarmmanager.dataVolSize }}
+ accessModes:
+ - ReadWriteOnce
+ hostPath:
+ path: /mnt/{{ include "common.pvname.alarmmanager" $topCtx }}
+{{ end }}
diff --git a/helm/alarmmanager/templates/pvc.yaml b/helm/alarmmanager/templates/pvc.yaml
new file mode 100644
index 0000000..0efe288
--- /dev/null
+++ b/helm/alarmmanager/templates/pvc.yaml
@@ -0,0 +1,29 @@
+################################################################################
+# 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. #
+################################################################################
+{{- $topCtx := . }}
+---
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+ name: {{ include "common.pvcname.alarmmanager" $topCtx }}
+ namespace: {{ include "common.namespace.platform" $topCtx }}
+spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: {{ .Values.alarmmanager.dataVolSize }}
+ storageClassName: {{ .Values.alarmmanager.storageClassName }}
diff --git a/helm/alarmmanager/templates/service-http.yaml b/helm/alarmmanager/templates/service-http.yaml
new file mode 100644
index 0000000..e5abac6
--- /dev/null
+++ b/helm/alarmmanager/templates/service-http.yaml
@@ -0,0 +1,38 @@
+################################################################################
+# 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: Service
+metadata:
+ name: {{ include "common.servicename.alarmmanager.http" . }}
+ namespace: {{ include "common.namespace.platform" . }}
+ labels:
+ app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmmanager" . }}
+ chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ type: ClusterIP
+ ports:
+ - port: {{ include "common.serviceport.alarmmanager.http" . }}
+ protocol: "TCP"
+ name: http
+ targetPort: {{ include "common.serviceport.alarmmanager.http" . }}
+ selector:
+ app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmmanager" . }}
+ release: {{ .Release.Name }}
+
diff --git a/helm/alarmmanager/templates/service-rmr.yaml b/helm/alarmmanager/templates/service-rmr.yaml
new file mode 100644
index 0000000..7fb3fd0
--- /dev/null
+++ b/helm/alarmmanager/templates/service-rmr.yaml
@@ -0,0 +1,49 @@
+#
+#==================================================================================
+# 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.
+#==================================================================================
+#
+#
+# Abstract: Subscription Manager service manifest
+# Date: 28 May 2019
+#
+kind: Service
+apiVersion: v1
+metadata:
+ name: {{ include "common.servicename.alarmmanager.rmr" . }}
+ namespace: {{ include "common.namespace.platform" . }}
+ labels:
+ app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmmanager" . }}
+ chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ selector:
+ app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmmanager" . }}
+ release: {{ .Release.Name }}
+ type: ClusterIP
+ ports:
+ - name: rmrdata
+ port: {{ include "common.serviceport.alarmmanager.rmr.data" . }}
+ protocol: TCP
+ targetPort: rmrdata
+ - name: rmrroute
+ port: {{ include "common.serviceport.alarmmanager.rmr.route" . }}
+ protocol: TCP
+ targetPort: rmrroute
+ selector:
+ app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmmanager" . }}
+ release: {{ .Release.Name }}
diff --git a/helm/alarmmanager/templates/serviceaccount.yaml b/helm/alarmmanager/templates/serviceaccount.yaml
new file mode 100644
index 0000000..58dbf85
--- /dev/null
+++ b/helm/alarmmanager/templates/serviceaccount.yaml
@@ -0,0 +1,46 @@
+################################################################################
+# 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. #
+# 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: ServiceAccount
+metadata:
+ name: {{ include "common.serviceaccountname.alarmmanager" . }}
+ namespace: {{ include "common.namespace.platform" . }}
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+ name: {{ include "common.serviceaccountname.alarmmanager" . }}-{{ include "common.namespace.xapp" . }}-podreader
+ namespace: {{ include "common.namespace.xapp" . }}
+rules:
+- apiGroups: [""]
+ resources: ["pods"]
+ verbs: ["get", "list", "watch"]
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+ name: {{ include "common.serviceaccountname.alarmmanager" . }}-{{ include "common.namespace.xapp" . }}-podreader
+ namespace: {{ include "common.namespace.xapp" . }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: {{ include "common.serviceaccountname.alarmmanager" . }}-{{ include "common.namespace.xapp" . }}-podreader
+subjects:
+ - kind: ServiceAccount
+ name: {{ include "common.serviceaccountname.alarmmanager" . }}
+ namespace: {{ include "common.namespace.platform" . }}
+
diff --git a/helm/alarmmanager/values.yaml b/helm/alarmmanager/values.yaml
new file mode 100644
index 0000000..a3559eb
--- /dev/null
+++ b/helm/alarmmanager/values.yaml
@@ -0,0 +1,30 @@
+################################################################################
+# Copyright (c) 2019-2020 AT&T Intellectual Property. #
+# Copyright (c) 2019-2020 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. #
+################################################################################
+alarmmanager:
+ replicaCount: 1
+ imagePullPolicy: IfNotPresent
+ image:
+ name: ric-plt-alarmmanager
+ tag: 0.5.9
+ registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" #"ranco-dev-tools.eastus.cloudapp.azure.com:10001"
+ dataVolSize: 100Mi
+ storageClassName: local-storage
+
+ # 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
+ # update the _ports.tpl file with the new port number.