From d804dbfcaa0f5a58ebd7e99c1cd6e7cd990b7926 Mon Sep 17 00:00:00 2001 From: farhin23 Date: Tue, 5 Mar 2024 14:11:49 +0100 Subject: [PATCH] Implement configuration for debugging purpose --- launchers/connector/build.gradle.kts | 8 ++++++++ .../helm/helm-charts/company/templates/deployment.yaml | 8 ++++++++ system-tests/helm/helm-charts/company/values.yaml | 6 +++++- system-tests/helm/run-mvd.sh | 8 +++----- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/launchers/connector/build.gradle.kts b/launchers/connector/build.gradle.kts index 83032393..c3676805 100644 --- a/launchers/connector/build.gradle.kts +++ b/launchers/connector/build.gradle.kts @@ -85,3 +85,11 @@ tasks.withType { dependsOn(distTar, distZip) mustRunAfter(distTar, distZip) } + +tasks.withType { + + options.isDebug = true + + options.compilerArgs.add("-g") + +} diff --git a/system-tests/helm/helm-charts/company/templates/deployment.yaml b/system-tests/helm/helm-charts/company/templates/deployment.yaml index 8e5787a6..5f91b106 100644 --- a/system-tests/helm/helm-charts/company/templates/deployment.yaml +++ b/system-tests/helm/helm-charts/company/templates/deployment.yaml @@ -35,6 +35,14 @@ spec: containerPort: {{ .Values.ports.mgmt.containerPort }} - name: control containerPort: 8383 + - name: debug + containerPort: {{ .Values.ports.debug.port }} + protocol: TCP + {{- if .Values.debug.enabled }} + env: + - name: "JAVA_TOOL_OPTIONS" + value: '-Xdebug -agentlib:jdwp=transport=dt_socket,address=0.0.0.0:{{ .Values.ports.debug.port }},server=y,suspend=n' + {{- end }} envFrom: - configMapRef: name: {{ include "company.fullname" . }}-configmap diff --git a/system-tests/helm/helm-charts/company/values.yaml b/system-tests/helm/helm-charts/company/values.yaml index 19a24f6e..ce5d3936 100644 --- a/system-tests/helm/helm-charts/company/values.yaml +++ b/system-tests/helm/helm-charts/company/values.yaml @@ -27,6 +27,8 @@ serviceAccount: service: type: ClusterIP +debug: + enabled: false ports: http: @@ -46,6 +48,8 @@ ports: containerPort: 7171 servicePort: 7171 path: /api/v2/identity + debug: + port: 5005 volumes: hostPath: /var/lib/minikube/mvd-resources/resources @@ -55,7 +59,7 @@ ingress: enabled: true className: "" annotations: {} - # kubernetes.io/ingress.class: nginx + # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: - host: chart-example.local diff --git a/system-tests/helm/run-mvd.sh b/system-tests/helm/run-mvd.sh index c189f7e1..818a6074 100755 --- a/system-tests/helm/run-mvd.sh +++ b/system-tests/helm/run-mvd.sh @@ -9,13 +9,13 @@ echo "installing registration-service..." helm install registration-service ./helm-charts/registration-service echo "installing company1..." -helm install company1 --set nameOverride=company1 ./helm-charts/company +helm install company1 --set nameOverride=company1,ports.debug.port=5005 ./helm-charts/company echo "installing company2..." -helm install company2 --set nameOverride=company2 ./helm-charts/company +helm install company2 --set nameOverride=company2,ports.debug.port=5006 ./helm-charts/company echo "installing company3..." -helm install company3 --set nameOverride=company3 ./helm-charts/company +helm install company3 --set nameOverride=company3,ports.debug.port=5007 ./helm-charts/company echo "installing newman..." helm install newman ./helm-charts/newman @@ -25,11 +25,9 @@ helm install cli-tools ./helm-charts/cli-tools echo "installing company1 data dashboard..." helm install company1-datadashboard --set nameOverride=company1-datadashboard,companyName=company1 ./helm-charts/company-dashboard -#helm template company1-datadashboard --set nameOverride=company1-datadashboard,companyName=company1 ./helm-charts/company-dashboard echo "installing company2 data dashboard..." helm install company2-datadashboard --set nameOverride=company2-datadashboard,companyName=company2 ./helm-charts/company-dashboard -#helm template company2-datadashboard --set nameOverride=company2-datadashboard,companyName=company2 ./helm-charts/company-dashboard echo "installing company3 data dashboard..." helm install company3-datadashboard --set nameOverride=company3-datadashboard,companyName=company3 ./helm-charts/company-dashboard