[COMMON] Harmonize resource settings
[oom.git] / kubernetes / aai / components / aai-traversal / templates / deployment.yaml
index a2c81cf..3171d4c 100644 (file)
@@ -123,7 +123,7 @@ spec:
         - --job-name
         - {{ include "common.release" . }}-aai-graphadmin-create-db-schema
         {{- else }}
-        - --container-name
+        - --app-name
           {{- if .Values.global.cassandra.localCluster }}
         - aai-cassandra
           {{- else }}
@@ -142,6 +142,13 @@ spec:
         image: {{ include "repositoryGenerator.image.readiness" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-readiness
+        resources:
+          limits:
+            cpu: "100m"
+            memory: "0.5Gi"
+          requests:
+            cpu: "3m"
+            memory: "0.02Gi"
       containers:
       - name: {{ include "common.name" . }}
         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
@@ -154,6 +161,20 @@ spec:
           echo "*** actual launch of AAI Resources"
           /bin/bash /opt/app/aai-traversal/docker-entrypoint.sh
         env:
+        {{- if .Values.config.env }}
+        {{- range $key,$value := .Values.config.env }}
+        - name: {{ $key | upper | quote}}
+          value: {{ $value | quote}}
+        {{- end }}
+        {{- end }}
+        {{- if .Values.config.profiling.enabled }}
+        - name: PRE_JVM_ARGS
+          value: '{{ join " " .Values.config.profiling.args }}'
+        {{- end }}
+        {{- if .Values.config.debug.enabled }}
+        - name: POST_JVM_ARGS
+          value: {{ .Values.config.debug.args | quote }}
+        {{- end }}
         - name: DISABLE_UPDATE_QUERY
           value: {{ .Values.config.disableUpdateQuery | quote }}
         - name: LOCAL_USER_ID
@@ -201,10 +222,18 @@ spec:
         ports:
         - containerPort: {{ .Values.service.internalPort }}
           name: {{ .Values.service.portName }}
+
+        {{- if .Values.config.debug.enabled }}
         - containerPort: {{ .Values.service.internalPort2 }}
           name: {{ .Values.service.portName2 }}
+        {{- end }}
         - containerPort: {{ .Values.service.internalPort3 }}
           name: {{ .Values.service.portName3 }}
+        {{- if .Values.config.profiling.enabled }}
+        - containerPort: {{ .Values.service.internalPort4 }}
+          name: {{ .Values.service.portName4 }}
+        {{- end }}
+
         lifecycle:
           # wait for active requests (long-running tasks) to be finished
           # Before the SIGTERM is invoked, Kubernetes exposes a preStop hook in the Pod.