diff --git a/charts/sourcegraph/README.md b/charts/sourcegraph/README.md index 5810d11e..c5a643c4 100644 --- a/charts/sourcegraph/README.md +++ b/charts/sourcegraph/README.md @@ -162,7 +162,8 @@ In addition to the documented values, all services also support the following va | jaeger.collector.serviceAnnotations | object | `{}` | Add extra annotations to jaeger `collector` service | | jaeger.collector.serviceLabels | object | `{}` | Add extra labels to jaeger `collector` service | | jaeger.collector.serviceType | string | "ClusterIP" | Kubernetes service type of jaeger `collector` service, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) | -| jaeger.config | object | `{"logLevel":"info","maxTraces":20000,"samplingDefaultProbability":1}` | Jaeger v2 configuration overrides. These values are templated into a ConfigMap mounted at `/etc/jaeger/jaeger-config.yaml`. See https://www.jaegertracing.io/docs/2.16/configuration/ | +| jaeger.config | object | `{"existingConfigMap":"","logLevel":"info","maxTraces":20000,"samplingDefaultProbability":1}` | Jaeger v2 configuration overrides. We only provide a limited number of options, use `existingConfigMap` to provide a full config if you need more control. | +| jaeger.config.existingConfigMap | string | `""` | Name of an preexisting ConfigMap containing Jaeger configuration. They must contain a `jaeger-config.yaml` key. If set, this will be used instead of the `config` values below. See https://www.jaegertracing.io/docs/2.16/configuration/ | | jaeger.config.logLevel | string | `"info"` | Log level for the Jaeger instance (debug, info, warn, error) | | jaeger.config.maxTraces | int | `20000` | Maximum number of traces stored in memory | | jaeger.config.samplingDefaultProbability | float | `1` | Default sampling probability (0.0 to 1.0) returned to services that query Jaeger for sampling config | diff --git a/charts/sourcegraph/templates/jaeger/jaeger.ConfigMap.yaml b/charts/sourcegraph/templates/jaeger/jaeger.ConfigMap.yaml index c5d553f9..7e2a388c 100644 --- a/charts/sourcegraph/templates/jaeger/jaeger.ConfigMap.yaml +++ b/charts/sourcegraph/templates/jaeger/jaeger.ConfigMap.yaml @@ -1,4 +1,4 @@ -{{- if .Values.jaeger.enabled -}} +{{- if and .Values.jaeger.enabled (not .Values.jaeger.config.existingConfigMap) -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml b/charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml index 409e462c..75c8961e 100644 --- a/charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml +++ b/charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml @@ -30,7 +30,9 @@ spec: kubectl.kubernetes.io/default-container: jaeger prometheus.io/port: "16686" sourcegraph.prometheus/scrape: "true" + {{- if not .Values.jaeger.config.existingConfigMap }} checksum/jaeger-config: {{ include (print $.Template.BasePath "/jaeger/jaeger.ConfigMap.yaml") . | sha256sum }} + {{- end }} {{- if .Values.sourcegraph.podAnnotations }} {{- toYaml .Values.sourcegraph.podAnnotations | nindent 8 }} {{- end }} @@ -111,7 +113,7 @@ spec: volumes: - name: jaeger-config configMap: - name: {{ .Values.jaeger.name }} + name: {{ default .Values.jaeger.name .Values.jaeger.config.existingConfigMap }} items: - key: jaeger-config.yaml path: jaeger-config.yaml diff --git a/charts/sourcegraph/values.yaml b/charts/sourcegraph/values.yaml index 3a79dc62..cdb59b5f 100644 --- a/charts/sourcegraph/values.yaml +++ b/charts/sourcegraph/values.yaml @@ -1183,10 +1183,11 @@ jaeger: [ "--config=/etc/jaeger/jaeger-config.yaml", ] - # -- Jaeger v2 configuration overrides. These values are templated into - # a ConfigMap mounted at `/etc/jaeger/jaeger-config.yaml`. - # See https://www.jaegertracing.io/docs/2.16/configuration/ + # -- Jaeger v2 configuration overrides. We only provide a limited number of options, use `existingConfigMap` to provide a full config if you need more control. config: + # -- Name of an preexisting ConfigMap containing Jaeger configuration. They must contain a `jaeger-config.yaml` key. If set, this will be used instead of the `config` values below. + # See https://www.jaegertracing.io/docs/2.16/configuration/ + existingConfigMap: "" # -- Maximum number of traces stored in memory maxTraces: 20000 # -- Log level for the Jaeger instance (debug, info, warn, error)