Fix E2T dynamic loglevel definitions
[ric-plt/ric-dep.git] / helm / e2term / templates / deployment.yaml
index 1f4e149..7a33429 100644 (file)
@@ -16,6 +16,7 @@
 ################################################################################
 {{- $topCtx :=  . }}
 {{- $health := .Values.health }}
+{{- $common_env := .Values.common_env_variables }}
 {{- range keys .Values.e2term }}
 {{- $key := . }}
 {{- with index $topCtx.Values.e2term . }}
@@ -29,7 +30,7 @@ metadata:
   name: {{ include "common.deploymentname.e2term" $topCtx }}-{{ $key }}
   namespace: {{ include "common.namespace.platform" $topCtx }}
   labels:
-    app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}
+    app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}-{{ $key }}
     chart: {{ $topCtx.Chart.Name }}-{{ $topCtx.Chart.Version | replace "+" "_" }}
     release: {{ $topCtx.Release.Name }}
     heritage: {{ $topCtx.Release.Service }}
@@ -37,7 +38,7 @@ spec:
   replicas: {{ .replicaCount }}
   selector:
     matchLabels:
-      app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}
+      app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}-{{ $key }}
       release: {{ $topCtx.Release.Name }}
   template:
     metadata:
@@ -91,7 +92,7 @@ spec:
           {{- end }}
         {{- end }}
       labels:
-        app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}
+        app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}-{{ $key }}
         release: {{ $topCtx.Release.Name }}
     spec:
       hostname: {{ include "common.name.e2term" $topCtx }}-{{ $key }}
@@ -113,6 +114,8 @@ spec:
           - mountPath: /tmp/rmr_verbose
             name: local-router-file
             subPath: rmr_verbose
+          - mountPath: {{ dir $common_env.ConfigMapName }}
+            name: local-loglevel-file
 {{ if .pizpub.enabled }}
           - mountPath: "{{ .env.messagecollectorfile }}"
             name: vol-shared
@@ -126,14 +129,33 @@ spec:
           envFrom:
             - configMapRef:
                 name: {{ include "common.configmapname.e2term" $topCtx }}-env-{{ $key }}
+          env:
+            - name: SYSTEM_NAME
+              value: "SEP"
+            - name: CONFIG_MAP_NAME
+              value: "{{ $common_env.ConfigMapName }}"
+            - name: HOST_NAME
+              valueFrom:
+               fieldRef:
+                fieldPath: spec.nodeName
+            - name: SERVICE_NAME
+              value: "{{ $common_env.ServiceName }}"
+            - name: CONTAINER_NAME
+              value: "{{ include "common.containername.e2term" $topCtx }}"
+            - name: POD_NAME
+              valueFrom:
+               fieldRef:
+                fieldPath: metadata.name
           ports:
             - name: "rmrroute-{{ $key }}"
               containerPort: {{ include "common.serviceport.e2term.rmr.route" $topCtx }}
             - name: "rmrdata-{{ $key }}"
               containerPort: {{ include "common.serviceport.e2term.rmr.data" $topCtx }}
-            - name: "rmrsctp-{{ $key }}" 
+            - name: "sctp-{{ $key }}"
               containerPort: 36422
-              protocol: SCTP 
+              protocol: SCTP
+            - name: "prmts-{{ $key }}"
+              containerPort: {{ include "common.serviceport.e2term.prometheus" $topCtx }}
           stdin: true
           tty: true
           securityContext:
@@ -175,6 +197,9 @@ spec:
         - name: local-router-file
           configMap:
             name: {{ include "common.configmapname.e2term" $topCtx }}-router-configmap
+        - name: local-loglevel-file
+          configMap:
+            name: {{ include "common.configmapname.e2term" $topCtx }}-loglevel-configmap
 {{ if .pizpub.enabled }}
         - name: localtime
           hostPath: