Merge "[MARIADB] Provide S3 Backup for MariaDB instances"
diff --git a/kubernetes/aai/components/aai-graphadmin/resources/config/application.properties b/kubernetes/aai/components/aai-graphadmin/resources/config/application.properties
index 37d02a0..b63cd83 100644
--- a/kubernetes/aai/components/aai-graphadmin/resources/config/application.properties
+++ b/kubernetes/aai/components/aai-graphadmin/resources/config/application.properties
@@ -5,7 +5,7 @@
 # ================================================================================
 # Copyright � 2018 AT&T Intellectual Property. All rights reserved.
 # Modifications Copyright © 2021 Orange
-# Modifications Copyright © 2023 Nordix Foundation
+# Modifications Copyright � 2023 Nordix Foundation
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -103,6 +103,8 @@
 aperture.service.timeout-in-milliseconds=300000
 
 #To Expose the Prometheus scraping endpoint
-management.port=8448
+management.server.port=8448
+management.endpoints.enabled-by-default=true
+management.endpoints.web.exposure.include=info,health,prometheus
 endpoints.enabled=false
 management.security.enabled=false
\ No newline at end of file
diff --git a/kubernetes/aai/components/aai-graphadmin/values.yaml b/kubernetes/aai/components/aai-graphadmin/values.yaml
index 749d6a5..e320f51 100644
--- a/kubernetes/aai/components/aai-graphadmin/values.yaml
+++ b/kubernetes/aai/components/aai-graphadmin/values.yaml
@@ -264,7 +264,7 @@
   serviceMonitor:
     enabled: false
     targetPort: 8448
-    path: /prometheus
+    path: /actuator/prometheus
     basicAuth:
       enabled: false
 
diff --git a/kubernetes/aai/components/aai-resources/resources/config/application.properties b/kubernetes/aai/components/aai-resources/resources/config/application.properties
index 817849f..1b7bdf8 100644
--- a/kubernetes/aai/components/aai-resources/resources/config/application.properties
+++ b/kubernetes/aai/components/aai-resources/resources/config/application.properties
@@ -98,9 +98,9 @@
 schema.service.client=no-auth
 
 #to expose the Prometheus scraping endpoint
-management.port=8448
-management.endpoints.enabled-by-default=false
-management.security.enabled=false
+management.server.port=8448
+management.endpoints.enabled-by-default=true
+management.endpoints.web.exposure.include=info,health,prometheus
 endpoints.enabled={{ .Values.endpoints.enabled }}
 endpoints.info.enabled={{ .Values.endpoints.info.enabled }}
 endpoints.prometheus.enabled={{ .Values.metrics.serviceMonitor.enabled }}
diff --git a/kubernetes/aai/components/aai-resources/templates/deployment.yaml b/kubernetes/aai/components/aai-resources/templates/deployment.yaml
index 626dc71..54097fa 100644
--- a/kubernetes/aai/components/aai-resources/templates/deployment.yaml
+++ b/kubernetes/aai/components/aai-resources/templates/deployment.yaml
@@ -141,6 +141,14 @@
           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 @@
         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.
diff --git a/kubernetes/aai/components/aai-resources/values.yaml b/kubernetes/aai/components/aai-resources/values.yaml
index ba0897e..cf8d17b 100644
--- a/kubernetes/aai/components/aai-resources/values.yaml
+++ b/kubernetes/aai/components/aai-resources/values.yaml
@@ -193,6 +193,27 @@
     MAX_HEAP_SIZE: "1024m"
     MAX_METASPACE_SIZE: "512m"
 
+  # adds jvm args for remote debugging the application
+  debug:
+    enabled: false
+    args: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
+
+  # adds jvm args for remote profiling the application
+  # port-forward, i.e:
+  # $ PODNAME=traversal
+  # $ kubectl -n ${NAMESPACE:=onap} port-forward pod/$(kubectl -n ${NAMESPACE:=onap}
+  # get pods | awk '{print $1}' | grep -m1 -e "$PODNAME") 9999:9999
+  profiling:
+    enabled: false
+    args:
+      - "-Dcom.sun.management.jmxremote"
+      - "-Dcom.sun.management.jmxremote.ssl=false"
+      - "-Dcom.sun.management.jmxremote.authenticate=false"
+      - "-Dcom.sun.management.jmxremote.local.only=false"
+      - "-Dcom.sun.management.jmxremote.port=9999"
+      - "-Dcom.sun.management.jmxremote.rmi.port=9999"
+      - "-Djava.rmi.server.hostname=127.0.0.1"
+
 nodeSelector: {}
 
 affinity: {}
@@ -282,7 +303,7 @@
   serviceMonitor:
     enabled: false
     targetPort: 8448
-    path: /prometheus
+    path: /actuator/prometheus
     basicAuth:
       enabled: false
       externalSecretName: mysecretname
diff --git a/kubernetes/aai/components/aai-traversal/resources/config/application.properties b/kubernetes/aai/components/aai-traversal/resources/config/application.properties
index 67fefd2..276dbfe 100644
--- a/kubernetes/aai/components/aai-traversal/resources/config/application.properties
+++ b/kubernetes/aai/components/aai-traversal/resources/config/application.properties
@@ -92,9 +92,9 @@
 schema.service.client=no-auth
 
 #to expose the Prometheus scraping endpoint
-management.port=8448
-management.endpoints.enabled-by-default=false
-management.security.enabled=false
+management.server.port=8448
+management.endpoints.enabled-by-default=true
+management.endpoints.web.exposure.include=info,health,prometheus
 endpoints.enabled={{ .Values.endpoints.enabled }}
 endpoints.info.enabled={{ .Values.endpoints.info.enabled }}
 endpoints.prometheus.enabled={{ .Values.metrics.serviceMonitor.enabled }}
diff --git a/kubernetes/aai/components/aai-traversal/templates/deployment.yaml b/kubernetes/aai/components/aai-traversal/templates/deployment.yaml
index 9a61841..8f52fe2 100644
--- a/kubernetes/aai/components/aai-traversal/templates/deployment.yaml
+++ b/kubernetes/aai/components/aai-traversal/templates/deployment.yaml
@@ -160,6 +160,14 @@
           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
@@ -207,10 +215,18 @@
         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.
diff --git a/kubernetes/aai/components/aai-traversal/values.yaml b/kubernetes/aai/components/aai-traversal/values.yaml
index 88f81e3..a1c383e 100644
--- a/kubernetes/aai/components/aai-traversal/values.yaml
+++ b/kubernetes/aai/components/aai-traversal/values.yaml
@@ -183,6 +183,23 @@
     MAX_HEAP_SIZE: "1024m"
     MAX_METASPACE_SIZE: "512m"
 
+  # adds jvm args for remote debugging the application
+  debug:
+    enabled: false
+    args: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
+
+  # adds jvm args for remote profiling the application
+  profiling:
+    enabled: false
+    args:
+      - "-Dcom.sun.management.jmxremote"
+      - "-Dcom.sun.management.jmxremote.ssl=false"
+      - "-Dcom.sun.management.jmxremote.authenticate=false"
+      - "-Dcom.sun.management.jmxremote.local.only=false"
+      - "-Dcom.sun.management.jmxremote.port=9999"
+      - "-Dcom.sun.management.jmxremote.rmi.port=9999"
+      - "-Djava.rmi.server.hostname=127.0.0.1"
+
   # Disables the updateQueryData script to run as part of traversal
   disableUpdateQuery: true
 
@@ -294,7 +311,7 @@
   serviceMonitor:
     enabled: false
     targetPort: 8448
-    path: /prometheus
+    path: /actuator/prometheus
     basicAuth:
       enabled: false
       externalSecretName: mysecretname
diff --git a/kubernetes/cds/components/cds-blueprints-processor/resources/config/application.properties b/kubernetes/cds/components/cds-blueprints-processor/resources/config/application.properties
index 7351b1f..b99bae7 100755
--- a/kubernetes/cds/components/cds-blueprints-processor/resources/config/application.properties
+++ b/kubernetes/cds/components/cds-blueprints-processor/resources/config/application.properties
@@ -195,3 +195,14 @@
 
 #Workflow audit store configuration
 blueprintsprocessor.workflow.self-service-api.audit.storeEnable={{ .Values.workflow.storeEnabled }}
+
+#Tracing
+spring.zipkin.baseUrl={{ .Values.tracing.collector.baseUrl }}
+spring.zipkin.checkTimeout=5000
+spring.zipkin.service.name={{ include "common.name" . }}
+spring.sleuth.messaging.jms.enabled=false
+spring.sleuth.trace-id128=true
+spring.sleuth.sampler.probability={{ .Values.tracing.sampling.probability }}
+spring.sleuth.propagation.type=w3c, b3
+spring.sleuth.supports-join=false
+spring.sleuth.web.skip-pattern={{ join "," .Values.tracing.ignorePatterns }}
diff --git a/kubernetes/cds/components/cds-blueprints-processor/values.yaml b/kubernetes/cds/components/cds-blueprints-processor/values.yaml
index a082c2c..3244748 100755
--- a/kubernetes/cds/components/cds-blueprints-processor/values.yaml
+++ b/kubernetes/cds/components/cds-blueprints-processor/values.yaml
@@ -231,3 +231,11 @@
 # workflow store flag
 workflow:
   storeEnabled: false
+
+tracing:
+  collector:
+    baseUrl: http://jaeger-collector.istio-system:9411
+  sampling:
+    probability: 1.0 # percentage of requests that are sampled (between 0-1/0%-100%)
+  ignorePatterns:
+    - .*/execution-service/health-check