Near RT RIC Platform new-installer initial release
[ric-plt/ric-dep.git] / new-installer / helm / charts / nearrtric / o1mediator / templates / deployment.yaml
diff --git a/new-installer/helm/charts/nearrtric/o1mediator/templates/deployment.yaml b/new-installer/helm/charts/nearrtric/o1mediator/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..71fc663
--- /dev/null
@@ -0,0 +1,76 @@
+################################################################################
+#   Copyright (c) 2019,2020 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.o1mediator.image.registry }}
+{{- $pullpolicyctx := dict "ctx" . "defaultpullpolicy" .Values.o1mediator.imagePullPolicy }}
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "common.deploymentname.o1mediator" . }}
+  namespace: {{ include "common.namespace.platform" . }}
+  labels:
+    app: {{ include "common.namespace.platform" . }}-{{ include "common.name.o1mediator" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  replicas: {{ .Values.o1mediator.replicaCount }}
+  selector:
+    matchLabels:
+      app: {{ include "common.namespace.platform" . }}-{{ include "common.name.o1mediator" . }}
+      release: {{ .Release.Name }}
+  template:
+    metadata:
+      {{- if .Values.o1mediator.annotations }}
+      annotations:
+        {{- .Values.o1mediator.annotations | nindent 8 -}}
+      {{ end }}
+      labels:
+        app: {{ include "common.namespace.platform" . }}-{{ include "common.name.o1mediator" . }}
+        release: {{ .Release.Name }}
+    spec:
+      hostname: {{ include "common.name.o1mediator" . }}
+      imagePullSecrets:
+        - name: {{ include "common.dockerregistry.credential" $imagectx }}
+      serviceAccountName: {{ include "common.serviceaccountname.o1mediator" . }}
+      containers:
+        - name: {{ include "common.containername.o1mediator" . }}
+          image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .Values.o1mediator.image.name }}:{{ .Values.o1mediator.image.tag }}
+          imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
+          envFrom:
+            - configMapRef:
+                name: {{ include "common.configmapname.dbaas" . }}-appconfig
+            - configMapRef:
+                name: {{ include "common.configmapname.o1mediator" . }}-env
+          volumeMounts:
+            - mountPath: /etc/o1agent
+              name: appconfig-file
+          ports:
+            - name: http-supervise
+              containerPort: {{ include "common.serviceport.o1mediator.http.supervise" . }}
+              protocol: TCP
+            - name: http-mediation
+              containerPort: {{ include "common.serviceport.o1mediator.http.mediation" . }}
+              protocol: TCP
+            - name: http-event
+              containerPort: {{ include "common.serviceport.o1mediator.http.event" . }}
+              protocol: TCP
+      volumes:
+        - name: appconfig-file
+          configMap:
+            name: {{ include "common.configmapname.o1mediator" . }}-appconfig-configmap