alarmadapter helm renamed to alarmmanager
[ric-plt/ric-dep.git] / helm / alarmmanager / templates / deployment.yaml
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #   Copyright (c) 2019 Nokia.                                                  #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 {{- $topCtx :=  . }}
18 {{- $imagectx := dict "ctx" . "defaultregistry" .Values.alarmmanager.image.registry }}
19 {{- $pullpolicyctx := dict "ctx" . "defaultpullpolicy" .Values.alarmmanager.imagePullPolicy }}
20 {{- $imagetag := .Values.alarmmanager.image.tag }}
21 ---
22 apiVersion: apps/v1
23 kind: Deployment
24 metadata:
25   name: {{ include "common.deploymentname.alarmmanager" . }}
26   namespace: {{ include "common.namespace.platform" . }}
27   labels:
28     app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmmanager" . }}
29     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
30     release: {{ .Release.Name }}
31     heritage: {{ .Release.Service }}
32 spec:
33   replicas: {{ .Values.alarmmanager.replicaCount }}
34   selector:
35     matchLabels:
36       app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmmanager" . }}
37       release: {{ .Release.Name }}
38   template:
39     metadata:
40       {{- if .Values.alarmmanager.annotations }}
41       annotations:
42         {{- .Values.alarmmanager.annotations | nindent 8 -}}
43       {{ end }}
44       labels:
45         app: {{ include "common.namespace.platform" . }}-{{ include "common.name.alarmmanager" . }}
46         release: {{ .Release.Name }}
47     spec:
48       hostname: {{ include "common.name.alarmmanager" . }}
49       imagePullSecrets:
50         - name: {{ include "common.dockerregistry.credential" $imagectx }}
51       serviceAccountName: {{ include "common.serviceaccountname.alarmmanager" . }}
52       containers:
53         - name: {{ include "common.containername.alarmmanager" . }}
54           image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .Values.alarmmanager.image.name }}:{{ $imagetag }}
55           imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
56           env:
57             - name: PLT_NAMESPACE
58               value: {{ include "common.namespace.platform" . }}
59           envFrom:
60             - configMapRef:
61                 name: {{ include "common.configmapname.dbaas" . }}-appconfig      
62             - configMapRef:
63                 name: {{ include "common.configmapname.alarmmanager" . }}-env
64           ports:
65             - name: rmrroute
66               containerPort: {{ include "common.serviceport.alarmmanager.rmr.route" . }}
67               protocol: TCP
68             - name: rmrdata
69               containerPort: {{ include "common.serviceport.alarmmanager.rmr.data" . }}
70               protocol: TCP
71             - name: http
72               containerPort: {{ include "common.serviceport.alarmmanager.http" . }}
73               protocol: TCP
74           volumeMounts:
75             - name: config-volume
76               mountPath: /cfg
77             - name: am-persistent-storage
78               mountPath: /mnt/pv-ricplt-alarmmanager
79       volumes:
80         - name: config-volume
81           configMap:
82             name: {{ include "common.configmapname.alarmmanager" . }}-alarmmanagercfg
83             #name: alarmmanagercfg
84             items:
85               - key: alarmmanagercfg
86                 path: config-file.json
87                 mode: 0644
88         - name: am-persistent-storage
89           persistentVolumeClaim:
90             claimName: {{ include "common.pvcname.alarmmanager" $topCtx }}