From 23dab85957655ce7db02a81c6674ce8c6e1d6f1b Mon Sep 17 00:00:00 2001 From: Aaron Steinfeld <45047841+aaron-steinfeld@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:50:50 -0400 Subject: [PATCH] fix: update config for new new doc store format (#186) --- attribute-projection-registry/gradle.lockfile | 2 +- attribute-service-api/gradle.lockfile | 2 +- attribute-service-client/gradle.lockfile | 2 +- attribute-service-factory/gradle.lockfile | 3 +- .../service/AttributeServiceFactory.java | 4 ++- attribute-service-impl/build.gradle.kts | 2 ++ attribute-service-impl/gradle.lockfile | 35 +++++++++++++++++- .../service/AttributeServiceImpl.java | 36 +++++++++++++++---- attribute-service-tenant-api/gradle.lockfile | 2 +- attribute-service/build.gradle.kts | 5 ++- attribute-service/gradle.lockfile | 3 +- .../attribute-service/application.conf | 12 ------- .../resources/configs/common/application.conf | 16 ++++++--- .../gradle.lockfile | 2 +- helm/templates/configmap.yaml | 7 +++- helm/templates/deployment.yaml | 16 ++++++--- helm/values.yaml | 25 +++++++------ settings-gradle.lockfile | 2 +- 18 files changed, 127 insertions(+), 49 deletions(-) diff --git a/attribute-projection-registry/gradle.lockfile b/attribute-projection-registry/gradle.lockfile index 45a7d6c6..3f4cd2e5 100644 --- a/attribute-projection-registry/gradle.lockfile +++ b/attribute-projection-registry/gradle.lockfile @@ -19,6 +19,6 @@ io.grpc:grpc-protobuf:1.57.2=compileClasspath,runtimeClasspath io.grpc:grpc-stub:1.57.2=compileClasspath,runtimeClasspath javax.annotation:javax.annotation-api:1.3.2=runtimeClasspath org.checkerframework:checker-qual:3.33.0=compileClasspath,runtimeClasspath -org.hypertrace.bom:hypertrace-bom:0.2.3=compileClasspath,runtimeClasspath +org.hypertrace.bom:hypertrace-bom:0.2.4=compileClasspath,runtimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.3.2=compileClasspath,runtimeClasspath empty=annotationProcessor diff --git a/attribute-service-api/gradle.lockfile b/attribute-service-api/gradle.lockfile index 44ca6d9c..27b61624 100644 --- a/attribute-service-api/gradle.lockfile +++ b/attribute-service-api/gradle.lockfile @@ -18,6 +18,6 @@ io.grpc:grpc-protobuf:1.57.2=compileClasspath,runtimeClasspath io.grpc:grpc-stub:1.57.2=compileClasspath,runtimeClasspath javax.annotation:javax.annotation-api:1.3.2=compileClasspath,runtimeClasspath org.checkerframework:checker-qual:3.33.0=compileClasspath,runtimeClasspath -org.hypertrace.bom:hypertrace-bom:0.2.3=compileClasspath,runtimeClasspath +org.hypertrace.bom:hypertrace-bom:0.2.4=compileClasspath,runtimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.3.2=compileClasspath,runtimeClasspath empty=annotationProcessor diff --git a/attribute-service-client/gradle.lockfile b/attribute-service-client/gradle.lockfile index feaa69e9..f24d23ff 100644 --- a/attribute-service-client/gradle.lockfile +++ b/attribute-service-client/gradle.lockfile @@ -31,7 +31,7 @@ io.perfmark:perfmark-api:0.26.0=runtimeClasspath javax.annotation:javax.annotation-api:1.3.2=runtimeClasspath org.checkerframework:checker-qual:3.33.0=compileClasspath,runtimeClasspath org.codehaus.mojo:animal-sniffer-annotations:1.23=runtimeClasspath -org.hypertrace.bom:hypertrace-bom:0.2.3=compileClasspath,runtimeClasspath +org.hypertrace.bom:hypertrace-bom:0.2.4=compileClasspath,runtimeClasspath org.hypertrace.core.grpcutils:grpc-client-utils:0.12.5=compileClasspath,runtimeClasspath org.hypertrace.core.grpcutils:grpc-context-utils:0.12.5=runtimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.3.2=compileClasspath,runtimeClasspath diff --git a/attribute-service-factory/gradle.lockfile b/attribute-service-factory/gradle.lockfile index f625f37f..51443627 100644 --- a/attribute-service-factory/gradle.lockfile +++ b/attribute-service-factory/gradle.lockfile @@ -75,12 +75,13 @@ org.eclipse.jetty:jetty-servlet:9.4.52.v20230823=runtimeClasspath org.eclipse.jetty:jetty-util-ajax:9.4.52.v20230823=runtimeClasspath org.eclipse.jetty:jetty-util:9.4.52.v20230823=runtimeClasspath org.hdrhistogram:HdrHistogram:2.1.12=runtimeClasspath -org.hypertrace.bom:hypertrace-bom:0.2.3=compileClasspath,runtimeClasspath +org.hypertrace.bom:hypertrace-bom:0.2.4=compileClasspath,runtimeClasspath org.hypertrace.core.documentstore:document-store:0.7.37=compileClasspath,runtimeClasspath org.hypertrace.core.grpcutils:grpc-client-utils:0.12.5=compileClasspath,runtimeClasspath org.hypertrace.core.grpcutils:grpc-context-utils:0.12.5=runtimeClasspath org.hypertrace.core.grpcutils:grpc-server-utils:0.12.2=runtimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.3.2=compileClasspath,runtimeClasspath +org.hypertrace.core.serviceframework:docstore-metrics:0.1.60=runtimeClasspath org.hypertrace.core.serviceframework:platform-grpc-service-framework:0.1.60=compileClasspath,runtimeClasspath org.hypertrace.core.serviceframework:platform-metrics:0.1.60=runtimeClasspath org.hypertrace.core.serviceframework:platform-service-framework:0.1.60=compileClasspath,runtimeClasspath diff --git a/attribute-service-factory/src/main/java/org/hypertrace/core/attribute/service/AttributeServiceFactory.java b/attribute-service-factory/src/main/java/org/hypertrace/core/attribute/service/AttributeServiceFactory.java index 39e25b93..cfb57957 100644 --- a/attribute-service-factory/src/main/java/org/hypertrace/core/attribute/service/AttributeServiceFactory.java +++ b/attribute-service-factory/src/main/java/org/hypertrace/core/attribute/service/AttributeServiceFactory.java @@ -11,6 +11,8 @@ public class AttributeServiceFactory implements GrpcPlatformServiceFactory { @Override public List buildServices(GrpcServiceContainerEnvironment environment) { return List.of( - new GrpcPlatformService(new AttributeServiceImpl(environment.getConfig(SERVICE_NAME)))); + new GrpcPlatformService( + new AttributeServiceImpl( + environment.getConfig(SERVICE_NAME), environment.getLifecycle()))); } } diff --git a/attribute-service-impl/build.gradle.kts b/attribute-service-impl/build.gradle.kts index 830d7cbd..83355df9 100644 --- a/attribute-service-impl/build.gradle.kts +++ b/attribute-service-impl/build.gradle.kts @@ -6,6 +6,7 @@ plugins { dependencies { api(projects.attributeServiceApi) + api(commonLibs.hypertrace.framework.spi) implementation(projects.attributeServiceTenantApi) implementation(commonLibs.hypertrace.documentstore) implementation(commonLibs.hypertrace.grpcutils.context) @@ -14,6 +15,7 @@ dependencies { implementation(commonLibs.slf4j2.api) implementation(commonLibs.protobuf.javautil) implementation(commonLibs.guava) + implementation(commonLibs.hypertrace.framework.documentstore.metrics) testImplementation(commonLibs.mockito.core) testImplementation(commonLibs.junit.jupiter) diff --git a/attribute-service-impl/gradle.lockfile b/attribute-service-impl/gradle.lockfile index 3cb13306..2d91dcf1 100644 --- a/attribute-service-impl/gradle.lockfile +++ b/attribute-service-impl/gradle.lockfile @@ -22,6 +22,9 @@ com.google.protobuf:protobuf-java-util:3.24.1=compileClasspath,runtimeClasspath com.google.protobuf:protobuf-java:3.24.1=compileClasspath,runtimeClasspath com.typesafe:config:1.4.2=compileClasspath,runtimeClasspath commons-logging:commons-logging:1.2=runtimeClasspath +io.dropwizard.metrics:metrics-core:4.2.16=runtimeClasspath +io.dropwizard.metrics:metrics-jvm:4.2.16=runtimeClasspath +io.github.mweirauch:micrometer-jvm-extras:0.2.2=runtimeClasspath io.grpc:grpc-api:1.57.2=compileClasspath,runtimeClasspath io.grpc:grpc-bom:1.57.2=compileClasspath,runtimeClasspath io.grpc:grpc-context:1.57.2=runtimeClasspath @@ -29,19 +32,49 @@ io.grpc:grpc-core:1.57.2=runtimeClasspath io.grpc:grpc-protobuf-lite:1.57.2=compileClasspath,runtimeClasspath io.grpc:grpc-protobuf:1.57.2=compileClasspath,runtimeClasspath io.grpc:grpc-stub:1.57.2=compileClasspath,runtimeClasspath +io.micrometer:micrometer-commons:1.10.2=runtimeClasspath +io.micrometer:micrometer-core:1.10.2=runtimeClasspath +io.micrometer:micrometer-observation:1.10.2=runtimeClasspath +io.micrometer:micrometer-registry-prometheus:1.10.2=runtimeClasspath io.perfmark:perfmark-api:0.26.0=runtimeClasspath +io.prometheus:simpleclient:0.16.0=runtimeClasspath +io.prometheus:simpleclient_common:0.16.0=runtimeClasspath +io.prometheus:simpleclient_dropwizard:0.12.0=runtimeClasspath +io.prometheus:simpleclient_pushgateway:0.12.0=runtimeClasspath +io.prometheus:simpleclient_servlet:0.12.0=runtimeClasspath +io.prometheus:simpleclient_servlet_common:0.12.0=runtimeClasspath +io.prometheus:simpleclient_tracer_common:0.16.0=runtimeClasspath +io.prometheus:simpleclient_tracer_otel:0.16.0=runtimeClasspath +io.prometheus:simpleclient_tracer_otel_agent:0.16.0=runtimeClasspath javax.annotation:javax.annotation-api:1.3.2=runtimeClasspath +javax.servlet:javax.servlet-api:3.1.0=runtimeClasspath +javax.xml.bind:jaxb-api:2.3.0=runtimeClasspath net.jodah:failsafe:2.4.4=runtimeClasspath org.apache.commons:commons-collections4:4.4=runtimeClasspath org.apache.commons:commons-dbcp2:2.9.0=runtimeClasspath org.apache.commons:commons-lang3:3.12.0=runtimeClasspath org.apache.commons:commons-pool2:2.10.0=runtimeClasspath +org.apache.logging.log4j:log4j-api:2.19.0=runtimeClasspath +org.apache.logging.log4j:log4j-core:2.19.0=runtimeClasspath +org.apache.logging.log4j:log4j-slf4j-impl:2.19.0=runtimeClasspath org.checkerframework:checker-qual:3.33.0=compileClasspath,runtimeClasspath org.codehaus.mojo:animal-sniffer-annotations:1.23=runtimeClasspath -org.hypertrace.bom:hypertrace-bom:0.2.3=compileClasspath,runtimeClasspath +org.eclipse.jetty:jetty-http:9.4.52.v20230823=runtimeClasspath +org.eclipse.jetty:jetty-io:9.4.52.v20230823=runtimeClasspath +org.eclipse.jetty:jetty-security:9.4.52.v20230823=runtimeClasspath +org.eclipse.jetty:jetty-server:9.4.52.v20230823=runtimeClasspath +org.eclipse.jetty:jetty-servlet:9.4.52.v20230823=runtimeClasspath +org.eclipse.jetty:jetty-util-ajax:9.4.52.v20230823=runtimeClasspath +org.eclipse.jetty:jetty-util:9.4.52.v20230823=runtimeClasspath +org.hdrhistogram:HdrHistogram:2.1.12=runtimeClasspath +org.hypertrace.bom:hypertrace-bom:0.2.4=compileClasspath,runtimeClasspath org.hypertrace.core.documentstore:document-store:0.7.37=compileClasspath,runtimeClasspath org.hypertrace.core.grpcutils:grpc-context-utils:0.12.5=compileClasspath,runtimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.3.2=compileClasspath,runtimeClasspath +org.hypertrace.core.serviceframework:docstore-metrics:0.1.60=compileClasspath,runtimeClasspath +org.hypertrace.core.serviceframework:platform-metrics:0.1.60=runtimeClasspath +org.hypertrace.core.serviceframework:service-framework-spi:0.1.60=compileClasspath,runtimeClasspath +org.latencyutils:LatencyUtils:2.0.3=runtimeClasspath org.mongodb:bson-record-codec:4.9.0=runtimeClasspath org.mongodb:bson:4.9.0=runtimeClasspath org.mongodb:mongodb-driver-core:4.9.0=runtimeClasspath diff --git a/attribute-service-impl/src/main/java/org/hypertrace/core/attribute/service/AttributeServiceImpl.java b/attribute-service-impl/src/main/java/org/hypertrace/core/attribute/service/AttributeServiceImpl.java index 85fe2c86..3203577d 100644 --- a/attribute-service-impl/src/main/java/org/hypertrace/core/attribute/service/AttributeServiceImpl.java +++ b/attribute-service-impl/src/main/java/org/hypertrace/core/attribute/service/AttributeServiceImpl.java @@ -57,7 +57,11 @@ import org.hypertrace.core.documentstore.JSONDocument; import org.hypertrace.core.documentstore.Key; import org.hypertrace.core.documentstore.Query; +import org.hypertrace.core.documentstore.model.config.DatastoreConfig; +import org.hypertrace.core.documentstore.model.config.TypesafeConfigDatastoreConfigExtractor; import org.hypertrace.core.grpcutils.context.RequestContext; +import org.hypertrace.core.serviceframework.docstore.metrics.DocStoreMetricsRegistry; +import org.hypertrace.core.serviceframework.spi.PlatformServiceLifecycle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -84,8 +88,8 @@ private static String sourceMetadataPathFor(final AttributeSource source) { * Initiates with a configuration. The configuration should be production configuration, but for * V0 The attributes type data would be stored in the configuration */ - public AttributeServiceImpl(Config config) { - Datastore store = initDataStore(config); + public AttributeServiceImpl(Config config, PlatformServiceLifecycle platformServiceLifecycle) { + Datastore store = initDataStore(config, platformServiceLifecycle); this.collection = store.getCollection(ATTRIBUTE_METADATA_COLLECTION); this.validator = new AttributeMetadataValidator(config); this.converter = new AttributeMetadataConverterImpl(); @@ -99,11 +103,29 @@ public AttributeServiceImpl(Config config) { this.updater = new AttributeUpdaterImpl(collection); } - private Datastore initDataStore(Config config) { - Config docStoreConfig = config.getConfig(DOC_STORE_CONFIG_KEY); - String dataStoreType = docStoreConfig.getString(DATA_STORE_TYPE); - Config dataStoreConfig = docStoreConfig.getConfig(dataStoreType); - return DatastoreProvider.getDatastore(dataStoreType, dataStoreConfig); + private Datastore initDataStore( + Config config, PlatformServiceLifecycle platformServiceLifecycle) { + final Config docStoreConfig = config.getConfig(DOC_STORE_CONFIG_KEY); + final String dataStoreType = docStoreConfig.getString(DATA_STORE_TYPE); + final DatastoreConfig datastoreConfig = + TypesafeConfigDatastoreConfigExtractor.from(docStoreConfig, DATA_STORE_TYPE) + .hostKey(dataStoreType + ".host") + .portKey(dataStoreType + ".port") + .keysForEndpoints(dataStoreType + ".endpoints", "host", "port") + .authDatabaseKey(dataStoreType + ".authDb") + .replicaSetKey(dataStoreType + ".replicaSet") + .databaseKey(dataStoreType + ".database") + .usernameKey(dataStoreType + ".user") + .passwordKey(dataStoreType + ".password") + .applicationNameKey("appName") + .extract(); + + final Datastore datastore = DatastoreProvider.getDatastore(datastoreConfig); + new DocStoreMetricsRegistry(datastore) + .withPlatformLifecycle(platformServiceLifecycle) + .monitor(); + + return datastore; } @Override diff --git a/attribute-service-tenant-api/gradle.lockfile b/attribute-service-tenant-api/gradle.lockfile index 8fd4e046..6a4d9a20 100644 --- a/attribute-service-tenant-api/gradle.lockfile +++ b/attribute-service-tenant-api/gradle.lockfile @@ -3,6 +3,6 @@ # This file is expected to be part of source control. com.fasterxml.jackson:jackson-bom:2.15.2=compileClasspath,runtimeClasspath io.grpc:grpc-bom:1.57.2=compileClasspath,runtimeClasspath -org.hypertrace.bom:hypertrace-bom:0.2.3=compileClasspath,runtimeClasspath +org.hypertrace.bom:hypertrace-bom:0.2.4=compileClasspath,runtimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.3.2=compileClasspath,runtimeClasspath empty=annotationProcessor diff --git a/attribute-service/build.gradle.kts b/attribute-service/build.gradle.kts index 1c4685f8..4470e969 100644 --- a/attribute-service/build.gradle.kts +++ b/attribute-service/build.gradle.kts @@ -15,6 +15,8 @@ plugins { alias(commonLibs.plugins.hypertrace.jacoco) } +val mongoPort = "37017" + tasks.register("createIntegrationTestNetwork") { networkName.set("attr-svc-int-test") } @@ -33,7 +35,7 @@ tasks.register("createMongoContainer") { targetImageId(tasks.getByName("pullMongoImage").image) containerName.set("mongo-local") hostConfig.network.set(tasks.getByName("createIntegrationTestNetwork").networkId) - hostConfig.portBindings.set(listOf("27017:27017")) + hostConfig.portBindings.set(listOf("$mongoPort:27017")) hostConfig.autoRemove.set(true) } @@ -50,6 +52,7 @@ tasks.register("stopMongoContainer") { tasks.integrationTest { useJUnitPlatform() dependsOn("startMongoContainer") + environment("MONGO_PORT", mongoPort) finalizedBy("stopMongoContainer") } diff --git a/attribute-service/gradle.lockfile b/attribute-service/gradle.lockfile index cb8b20a9..4ed3ddf5 100644 --- a/attribute-service/gradle.lockfile +++ b/attribute-service/gradle.lockfile @@ -88,12 +88,13 @@ org.eclipse.jetty:jetty-servlet:9.4.52.v20230823=runtimeClasspath org.eclipse.jetty:jetty-util-ajax:9.4.52.v20230823=runtimeClasspath org.eclipse.jetty:jetty-util:9.4.52.v20230823=runtimeClasspath org.hdrhistogram:HdrHistogram:2.1.12=runtimeClasspath -org.hypertrace.bom:hypertrace-bom:0.2.3=compileClasspath,runtimeClasspath +org.hypertrace.bom:hypertrace-bom:0.2.4=compileClasspath,runtimeClasspath org.hypertrace.core.documentstore:document-store:0.7.37=runtimeClasspath org.hypertrace.core.grpcutils:grpc-client-utils:0.12.5=compileClasspath,runtimeClasspath org.hypertrace.core.grpcutils:grpc-context-utils:0.12.5=runtimeClasspath org.hypertrace.core.grpcutils:grpc-server-utils:0.12.2=runtimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.3.2=compileClasspath,runtimeClasspath +org.hypertrace.core.serviceframework:docstore-metrics:0.1.60=runtimeClasspath org.hypertrace.core.serviceframework:platform-grpc-service-framework:0.1.60=compileClasspath,runtimeClasspath org.hypertrace.core.serviceframework:platform-metrics:0.1.60=runtimeClasspath org.hypertrace.core.serviceframework:platform-service-framework:0.1.60=compileClasspath,runtimeClasspath diff --git a/attribute-service/src/integrationTest/resources/configs/attribute-service/application.conf b/attribute-service/src/integrationTest/resources/configs/attribute-service/application.conf index a8d0a7b8..e69de29b 100644 --- a/attribute-service/src/integrationTest/resources/configs/attribute-service/application.conf +++ b/attribute-service/src/integrationTest/resources/configs/attribute-service/application.conf @@ -1,12 +0,0 @@ -main.class = org.hypertrace.core.attribute.service.AttributeServiceEntry -service.name = attribute-service -service.admin.port = 9013 -document.store { - dataStoreType = mongo - mongo { - host = localhost - host = ${?MONGO_HOST} # provides a way to override the mongo_host via an environment variable - port = 27017 - } -} -attributes.type.server.port = 9012 diff --git a/attribute-service/src/main/resources/configs/common/application.conf b/attribute-service/src/main/resources/configs/common/application.conf index 2174eb5f..20040fe2 100644 --- a/attribute-service/src/main/resources/configs/common/application.conf +++ b/attribute-service/src/main/resources/configs/common/application.conf @@ -3,11 +3,19 @@ service.name = attribute-service service.admin.port = 9013 document.store { dataStoreType = mongo + appName = attribute-service-local mongo { - host = localhost - host = ${?MONGO_HOST} # provides a way to override the mongo_host via an environment variable - port = 27017 - port = ${?MONGO_PORT} + database = default_db + user = ${?MONGO_SERVICE_USERNAME} + password = ${?MONGO_SERVICE_USER_PASSWORD} + endpoints = [ + { + host = localhost + host = ${?MONGO_HOST} # provides a way to override the mongo_host via an environment variable + port = 27017 + port = ${?MONGO_PORT} + } + ] } } attributes.type.server.port = 9012 diff --git a/caching-attribute-service-client/gradle.lockfile b/caching-attribute-service-client/gradle.lockfile index 2c36f73e..f3f5b89a 100644 --- a/caching-attribute-service-client/gradle.lockfile +++ b/caching-attribute-service-client/gradle.lockfile @@ -31,7 +31,7 @@ io.reactivex.rxjava3:rxjava:3.1.7=compileClasspath,runtimeClasspath javax.annotation:javax.annotation-api:1.3.2=runtimeClasspath org.checkerframework:checker-qual:3.33.0=compileClasspath,runtimeClasspath org.codehaus.mojo:animal-sniffer-annotations:1.23=runtimeClasspath -org.hypertrace.bom:hypertrace-bom:0.2.3=compileClasspath,runtimeClasspath +org.hypertrace.bom:hypertrace-bom:0.2.4=compileClasspath,runtimeClasspath org.hypertrace.core.grpcutils:grpc-client-rx-utils:0.12.5=compileClasspath,runtimeClasspath org.hypertrace.core.grpcutils:grpc-client-utils:0.12.5=compileClasspath,runtimeClasspath org.hypertrace.core.grpcutils:grpc-context-utils:0.12.5=compileClasspath,runtimeClasspath diff --git a/helm/templates/configmap.yaml b/helm/templates/configmap.yaml index 96d695f2..c37ec38f 100644 --- a/helm/templates/configmap.yaml +++ b/helm/templates/configmap.yaml @@ -9,13 +9,18 @@ data: document.store { {{- $dst := .Values.configMap.dataStoreType }} dataStoreType = {{ $dst }} + appName = {{ .Values.service.name }} {{ $dst }} { {{- range $key, $value := (index .Values "configMap" (printf "%s" $dst)) }} {{- if $value }} - {{- if eq $key "password" }} + {{- if hasPrefix "${?" (printf "%s" $value) }} {{ $key }} = {{ $value }} {{- else }} + {{- if eq $key "endpoints" }} + endpoints = {{- toJson $value }} + {{- else }} {{ $key }} = {{ $value | quote }} + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index 0a2424aa..ff2e09e7 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -75,14 +75,22 @@ spec: containerPort: {{ .Values.containerHealthProbePort }} protocol: TCP env: - - name: SERVICE_NAME - value: "{{ .Chart.Name }}" - - name: BOOTSTRAP_CONFIG_URI - value: "file:///app/resources/configs" - name: LOG4J_CONFIGURATION_FILE value: "/var/{{ .Chart.Name }}/log/log4j2.properties" - name: JAVA_OPTS value: {{ .Values.javaOpts | quote }} + {{- with .Values.configMap.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 e7dbded1..f6b8d0ed 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -11,7 +11,7 @@ image: pullPolicy: IfNotPresent tagOverride: "" -imagePullSecrets: {} +imagePullSecrets: { } containerPort: 9012 containerHealthProbePort: 9013 @@ -21,15 +21,15 @@ service: type: ClusterIP port: 9012 -nodeLabels: {} +nodeLabels: { } -tolerations: [] +tolerations: [ ] -affinity: {} +affinity: { } -topologySpreadConstraints: [] +topologySpreadConstraints: [ ] -securityContext: {} +securityContext: { } javaOpts: "-XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=75.0 -XX:MaxDirectMemorySize=128M -XX:+ExitOnOutOfMemoryError" @@ -56,7 +56,7 @@ deploymentLabels: podLabels: app: attribute-service -podAnnotations: {} +podAnnotations: { } deploymentSelectorMatchLabels: app: attribute-service @@ -68,8 +68,13 @@ configMap: name: attribute-service-config dataStoreType: "mongo" mongo: - host: mongo - url: "" + endpoints: + - host: mongo + port: 27017 + # credentials: + # secretName: + # secretUsernameKey: + # secretPasswordKey: postgres: host: postgres port: 5432 @@ -88,7 +93,7 @@ logConfig: config-bootstrapper: job: prefix: attribute - configurationCommands: {} + configurationCommands: { } hpa: enabled: false diff --git a/settings-gradle.lockfile b/settings-gradle.lockfile index a1abe581..d9b5359c 100644 --- a/settings-gradle.lockfile +++ b/settings-gradle.lockfile @@ -1,5 +1,5 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -org.hypertrace.bom:hypertrace-version-catalog:0.2.3=incomingCatalogForCommonLibs0 +org.hypertrace.bom:hypertrace-version-catalog:0.2.4=incomingCatalogForCommonLibs0 empty=