From a150e07f991b941996dbfe2bf5db64f020f8b9fc Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Thu, 17 Oct 2024 13:30:13 +0530 Subject: [PATCH] resolve comments --- .../configs/config-service/application.conf | 2 +- .../main/resources/configs/common/application.conf | 2 +- helm/templates/config-service-config.yaml | 10 +++++++--- helm/templates/deployment.yaml | 13 +++++++++++++ helm/values.yaml | 5 ----- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/config-service/src/integrationTest/resources/configs/config-service/application.conf b/config-service/src/integrationTest/resources/configs/config-service/application.conf index 87035d31..4cbac52e 100644 --- a/config-service/src/integrationTest/resources/configs/config-service/application.conf +++ b/config-service/src/integrationTest/resources/configs/config-service/application.conf @@ -6,7 +6,7 @@ service.admin.port = 50102 generic.config.service { document.store { - appName = hypertrace-config-service-local + appName = config-service-config-test maxPoolSize = 10 dataStoreType = mongo mongo { diff --git a/config-service/src/main/resources/configs/common/application.conf b/config-service/src/main/resources/configs/common/application.conf index 06e96f02..8942a525 100644 --- a/config-service/src/main/resources/configs/common/application.conf +++ b/config-service/src/main/resources/configs/common/application.conf @@ -5,7 +5,7 @@ service.admin.port = 50102 generic.config.service { document.store { - appName = hypertrace-config-service-local + appName = config-service-config-local maxPoolSize = 10 dataStoreType = mongo mongo { diff --git a/helm/templates/config-service-config.yaml b/helm/templates/config-service-config.yaml index 3ef45afc..132eeaf8 100644 --- a/helm/templates/config-service-config.yaml +++ b/helm/templates/config-service-config.yaml @@ -14,7 +14,7 @@ data: {{- if .Values.database }} {{- $dst := .Values.database.type }} dataStoreType = {{ $dst }} - appName = {{ .Values.name }} + appName = {{ .Values.configServiceConfig.name }} {{- range $key, $value := (index .Values "database") }} {{- if ne $key $dst }} @@ -23,9 +23,13 @@ data: {{- end }} {{ $dst }} { - {{- range $key, $value := (index .Values "configServiceConfig" (printf "%s" $dst)) }} + {{- range $key, $value := (index .Values "database" (printf "%s" $dst)) }} {{- if $value }} - {{ $key }} = {{ $value | quote }} + {{- if hasPrefix "${?" (printf "%s" $value) }} + {{ $key }} = {{ $value }} + {{- else }} + {{ $key }} = {{- toJson $value }} + {{- end }} {{- end }} {{- end }} } diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index 0a3875e5..580b5542 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -64,6 +64,19 @@ spec: value: "/var/{{ .Chart.Name }}/log/log4j2.properties" - name: JAVA_OPTS value: {{ .Values.javaOpts | quote }} + {{- if and .Values.database .Values.database.mongo.authEnabled }} + {{- with .Values.database.mongo.credentials }} + - name: MONGO_SERVICE_USERNAME + valueFrom: + secretKeyRef: + name: {{ .secretName }} + key: {{ .secretUsernameKey }} + - name: MONGO_SERVICE_USER_PASSWORD + valueFrom: + secretKeyRef: + name: {{.secretName }} + key: {{.secretPasswordKey }} + {{- end }} volumeMounts: - name: service-config mountPath: /app/resources/configs/{{ .Chart.Name }}/application.conf diff --git a/helm/values.yaml b/helm/values.yaml index cf1983dd..005ba07c 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -13,7 +13,6 @@ ########### # Deployment and Service ########### -name: hypertrace-config-service replicaCount: 1 maxUnavailable: 0 @@ -81,10 +80,6 @@ serviceSelectorLabels: configServiceConfig: name: config-service-config publishChangeEvents: false - dataStoreType: "mongo" - mongo: - host: mongo - url: "" partitionerServiceConfig: defaultProfiles: