[AAI] Service monitor for scraping prometheus metrics
[oom.git] / kubernetes / aai / components / aai-graphadmin / templates / deployment.yaml
index 6b58eaa..3e1479e 100644 (file)
@@ -63,9 +63,10 @@ spec:
           echo "*** retrieve Truststore and Keystore password"
           export $(cat {{ .Values.certInitializer.appMountPath }}/local/mycreds.prop | xargs -0)
           echo "*** obfuscate them "
-          export KEYSTORE_PASSWORD=`java -cp /usr/local/jetty/lib/jetty-util-9.4.44.v20210927.jar org.eclipse.jetty.util.security.Password ${KEYSTORE_PLAIN_PASSWORD} 2>&1 | grep "OBF:"`
-          export KEYSTORE_JKS_PASSWORD=`java -cp /usr/local/jetty/lib/jetty-util-9.4.44.v20210927.jar org.eclipse.jetty.util.security.Password ${KEYSTORE_JKS_PLAIN_PASSWORD} 2>&1 | grep "OBF:"`
-          export TRUSTSTORE_PASSWORD=`java -cp /usr/local/jetty/lib/jetty-util-9.4.44.v20210927.jar org.eclipse.jetty.util.security.Password ${TRUSTSTORE_PLAIN_PASSWORD} 2>&1 | grep "OBF:"`
+          export JETTY_UTIL_JAR=$(find /usr/local/jetty/lib/ -regextype sed -regex ".*jetty-util-[0-9].*.jar")
+          export KEYSTORE_PASSWORD=`java -cp ${JETTY_UTIL_JAR} org.eclipse.jetty.util.security.Password ${KEYSTORE_PLAIN_PASSWORD} 2>&1 | grep "OBF:"`
+          export KEYSTORE_JKS_PASSWORD=`java -cp ${JETTY_UTIL_JAR} org.eclipse.jetty.util.security.Password ${KEYSTORE_JKS_PLAIN_PASSWORD} 2>&1 | grep "OBF:"`
+          export TRUSTSTORE_PASSWORD=`java -cp ${JETTY_UTIL_JAR} org.eclipse.jetty.util.security.Password ${TRUSTSTORE_PLAIN_PASSWORD} 2>&1 | grep "OBF:"`
           echo "KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD}" >> {{ .Values.certInitializer.appMountPath }}/local/mycreds.prop
           echo "KEYSTORE_JKS_PASSWORD=${KEYSTORE_JKS_PASSWORD}" >> {{ .Values.certInitializer.appMountPath }}/local/mycreds.prop
           echo "TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD}" >> {{ .Values.certInitializer.appMountPath }}/local/mycreds.prop
@@ -142,6 +143,8 @@ spec:
           value: {{ .Values.service.internalPort | quote }}
         - name: INTERNAL_PORT_2
           value: {{ .Values.service.internalPort2 | quote }}
+        - name: INTERNAL_PORT_3
+          value: {{ .Values.service.internalPort3 | quote }}
         volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
         - mountPath: /etc/localtime
           name: localtime
@@ -172,6 +175,7 @@ spec:
         ports:
         - containerPort: {{ .Values.service.internalPort }}
         - containerPort: {{ .Values.service.internalPort2 }}
+        - containerPort: {{ .Values.service.internalPort3 }}
         lifecycle:
           # wait for active requests (long-running tasks) to be finished
           # Before the SIGTERM is invoked, Kubernetes exposes a preStop hook in the Pod.
@@ -222,12 +226,14 @@ spec:
       - name: config
         configMap:
           name: {{ include "common.fullname" . }}
-      - name: properties-input
-        configMap:
-          name: {{ include "common.fullname" . }}-properties
       - name: properties
+      {{- if .Values.global.aafEnabled }}
         emptyDir:
           medium: Memory
+      - name: properties-input
+      {{- end }}
+        configMap:
+          name: {{ include "common.fullname" . }}-properties
       restartPolicy: {{ .Values.restartPolicy }}
       imagePullSecrets:
       - name: {{ include "common.namespace" . }}-docker-registry-key