Near RT RIC Platform new-installer initial release
[ric-plt/ric-dep.git] / new-installer / helm / charts / nearrtric / a1mediator / templates / deployment.yaml
diff --git a/new-installer/helm/charts/nearrtric/a1mediator/templates/deployment.yaml b/new-installer/helm/charts/nearrtric/a1mediator/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..a4023e7
--- /dev/null
@@ -0,0 +1,83 @@
+################################################################################
+#   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.a1mediator.image.registry }}
+{{- $pullpolicyctx := dict "ctx" . "defaultpullpolicy" .Values.a1mediator.imagePullPolicy }}
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "common.deploymentname.a1mediator" . }}
+  namespace: {{ include "common.namespace.platform" . }}
+  labels:
+    app: {{ include "common.namespace.platform" . }}-{{ include "common.name.a1mediator" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  replicas: {{ .Values.a1mediator.replicaCount }}
+  selector:
+    matchLabels:
+      app: {{ include "common.namespace.platform" . }}-{{ include "common.name.a1mediator" . }}
+      release: {{ .Release.Name }}
+  template:
+    metadata:
+      {{- if .Values.a1mediator.annotations }}
+      annotations:
+        {{- .Values.a1mediator.annotations | nindent 8 -}}
+      {{ end }}
+      labels:
+        app: {{ include "common.namespace.platform" . }}-{{ include "common.name.a1mediator" . }}
+        release: {{ .Release.Name }}
+    spec:
+      hostname: {{ include "common.name.a1mediator" . }}
+      imagePullSecrets:
+        - name: {{ include "common.dockerregistry.credential" $imagectx }}
+      containers:
+        - name: {{ include "common.containername.a1mediator" . }}
+          volumeMounts:
+          - name: a1conf
+            mountPath: /opt/route
+          envFrom:
+            - configMapRef:
+                name: {{ include "common.configmapname.a1mediator" . }}-env
+            - configMapRef:
+                name: {{ include "common.configmapname.dbaas" . }}-appconfig
+          image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .Values.a1mediator.image.name }}:{{ .Values.a1mediator.image.tag }}
+          imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
+          ports:
+            - name: http
+              containerPort: {{ include "common.serviceport.a1mediator.http" . }}
+              protocol: TCP
+            - name: rmrroute
+              containerPort: {{ include "common.serviceport.a1mediator.rmr.route" . }}
+              protocol: TCP
+            - name: rmrdata
+              containerPort: {{ include "common.serviceport.a1mediator.rmr.data" . }}
+              protocol: TCP
+          livenessProbe:
+            httpGet:
+              path: /a1-p/healthcheck
+              port: http
+          readinessProbe:
+            httpGet:
+              path: /a1-p/healthcheck
+              port: http
+      volumes:
+        - name: "a1conf"
+          configMap:
+            name:  {{ include "common.configmapname.a1mediator" . }}-a1conf