Merge "RMR Message Type configurable and added liveness/readiness check for rtmgr"
[ric-plt/ric-dep.git] / helm / e2mgr / templates / deployment.yaml
index f5cbafe..a4fafa5 100644 (file)
@@ -45,6 +45,14 @@ spec:
       hostname: {{ include "common.name.e2mgr" . }} 
       imagePullSecrets:
         - name: {{ include "common.dockerregistry.credential" $imagectx }}
+      initContainers:
+        - name: redis-init
+          image: "redis"
+          command:
+          - "/bin/sh"
+          args:
+          - '-c'
+          - "redis-cli -h {{ include "common.servicename.dbaas.tcp" . }} -p {{ include "common.serviceport.dbaas.redis" . }} SETNX \"{e2Manager},GENERAL\" \"{\\\"enableRic\\\":true}\""
       containers:
         - name: {{ include "common.containername.e2mgr" . }}
           image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .Values.e2mgr.image.name }}:{{ .Values.e2mgr.image.tag }}
@@ -72,6 +80,24 @@ spec:
           tty: true
           securityContext:
             privileged: {{ .Values.e2mgr.privilegedmode}}
+
+          {{- if eq .Values.e2mgr.liveness.enabled true }}
+          livenessProbe:
+            httpGet:
+              path: {{ .Values.e2mgr.liveness.api }}
+              port: {{ include "common.serviceport.e2mgr.http" . }}
+            initialDelaySeconds: {{ .Values.e2mgr.liveness.initialDelaySeconds }}
+            periodSeconds: {{ .Values.e2mgr.liveness.periodSeconds }}
+          {{- end }}
+          {{- if eq .Values.e2mgr.readiness.enabled true }}
+          readinessProbe:
+            httpGet:
+              path: {{ .Values.e2mgr.readiness.api }}
+              port: {{ include "common.serviceport.e2mgr.http" . }}
+            initialDelaySeconds: {{ .Values.e2mgr.liveness.initialDelaySeconds }}
+            periodSeconds: {{ .Values.e2mgr.liveness.periodSeconds }}
+          {{- end }}
+
       volumes:
         - name: local-router-file
           configMap: