Add standalone R3 RIC platform helm charts and deployment scripts.
[ric-plt/ric-dep.git] / helm / e2term / templates / deployment.yaml
diff --git a/helm/e2term/templates/deployment.yaml b/helm/e2term/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..c258095
--- /dev/null
@@ -0,0 +1,120 @@
+################################################################################
+#   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.e2term.image.registry }}
+{{- $pullpolicyctx := dict "ctx" . "defaultpullpolicy" .Values.e2term.imagePullPolicy }}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "common.deploymentname.e2term" . }}
+  namespace: {{ include "common.namespace.platform" . }}
+  labels:
+    app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  replicas: {{ .Values.e2term.replicaCount }}
+  selector:
+    matchLabels:
+      app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }}
+      release: {{ .Release.Name }}
+  template:
+    metadata:
+      {{- if .Values.e2term.annotations }}
+      annotations:
+        {{- .Values.e2term.annotations | nindent 8 -}}
+      {{ end }}
+      labels:
+        app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }}
+        release: {{ .Release.Name }}
+    spec:
+      hostname: {{ include "common.name.e2term" . }}
+      hostNetwork: {{ .Values.e2term.hostnetworkmode }}
+      dnsPolicy: ClusterFirstWithHostNet
+      imagePullSecrets:
+        - name: {{ include "common.dockerregistry.credential" $imagectx }}
+      {{- with .Values.e2term.nodeselector }}
+      nodeSelector: {{ toYaml . | trim | nindent 8 -}}
+      {{- end }}
+      containers:
+        - name: {{ include "common.containername.e2term" . }}
+          image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .Values.e2term.image.name }}:{{ .Values.e2term.image.tag }}
+          imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
+          volumeMounts:
+          - mountPath: /opt/e2/router.txt
+            name: local-router-file
+            subPath: router.txt
+          - mountPath: /tmp/rmr_verbose
+            name: local-router-file
+            subPath: rmr_verbose
+{{ if .Values.e2term.pizpub.enabled }}
+          - mountPath: "{{ .Values.e2term.env.messagecollectorfile }}"
+            name: vol-shared
+            readOnly: false
+            subPath: "{{ .Values.e2term.pizpub.scanDirectory }}"
+{{ else }}
+          - mountPath: "{{ .Values.e2term.env.messagecollectorfile }}"
+            name: vol-shared
+            readOnly: false
+{{ end }}
+          envFrom:
+            - configMapRef:
+                name: {{ include "common.configmapname.e2term" . }}-env
+          ports:
+            - name: "rmrroute"
+              containerPort: {{ include "common.serviceport.e2term.rmr.route" . }}
+            - name: "rmrdata"
+              containerPort: {{ include "common.serviceport.e2term.rmr.data" . }}
+          stdin: true
+          tty: true
+          securityContext:
+            privileged: {{ .Values.e2term.privilegedmode }}
+
+{{ if .Values.e2term.pizpub.enabled }}
+        - name: {{ include "common.containername.e2term" . }}-pizpub
+          image: {{ include "common.repository" . }}/{{ .Values.e2term.pizpub.imageName }}:{{ .Values.e2term.pizpub.imageVersion }}
+          imagePullPolicy: {{ include "common.pullPolicy" . }}
+          volumeMounts:
+          - mountPath: /etc/localtime
+            name: localtime
+            readOnly: true
+          - mountPath: "{{ .Values.e2term.pizpub.dataRootDir }}"
+            name: vol-shared
+            readOnly: false
+          - name: pizpub-config
+            mountPath: /opt/app/config/conf/
+          lifecycle:
+            postStart:
+              exec:
+                command: ["/bin/sh", "/opt/app/config/conf/cleaner.sh", "{{ .Values.e2term.pizpub.dataRootDir }}/{{ .Values.e2term.pizpub.processedDirectory }}", "3"]
+{{ end }}
+      volumes:
+        - name: local-router-file
+          configMap:
+            name: {{ include "common.configmapname.e2term" . }}-router-configmap
+{{ if .Values.e2term.pizpub.enabled }}
+        - name: localtime
+          hostPath:
+            path: /etc/localtime
+        - name: pizpub-config
+          configMap:
+            name: {{ include "common.configmapname.e2term" . }}-pizpub
+{{ end }}
+        - name: vol-shared
+          persistentVolumeClaim:
+            claimName: {{ include "common.pvcname.e2term" . }}
+