Near RT RIC Platform new-installer initial release
[ric-plt/ric-dep.git] / new-installer / helm / charts / nearrtric / alarmmanager / templates / deployment.yaml
diff --git a/new-installer/helm/charts/nearrtric/alarmmanager/templates/deployment.yaml b/new-installer/helm/charts/nearrtric/alarmmanager/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..08b041e
--- /dev/null
@@ -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 }}