[AAI] Add options for remote debugging and profiling
[oom.git] / kubernetes / aai / components / aai-resources / templates / deployment.yaml
index 626dc71..54097fa 100644 (file)
@@ -141,6 +141,14 @@ spec:
           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: LOCAL_USER_ID
           value: {{ .Values.global.config.userId | quote }}
         - name: LOCAL_GROUP_ID
@@ -184,10 +192,17 @@ 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.