diff --git a/charts/sourcegraph/README.md b/charts/sourcegraph/README.md index f9e0c1b7..c5a643c4 100644 --- a/charts/sourcegraph/README.md +++ b/charts/sourcegraph/README.md @@ -157,11 +157,16 @@ In addition to the documented values, all services also support the following va | indexedSearchIndexer.image.defaultTag | string | `"6.0.0@sha256:11539e07040b85045a9aa07f970aa310066e240dc28e6c9627653ee2bc6e0b91"` | Docker image tag for the `zoekt-indexserver` image | | indexedSearchIndexer.image.name | string | `"search-indexer"` | Docker image name for the `zoekt-indexserver` image | | indexedSearchIndexer.resources | object | `{"limits":{"cpu":"8","memory":"8G"},"requests":{"cpu":"4","memory":"4G"}}` | Resource requests & limits for the `zoekt-indexserver` container, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) zoekt-indexserver is CPU bound. The more CPU you allocate to it, the lower lag between a new commit and it being indexed for search. | -| jaeger.args | list | `["--memory.max-traces=20000","--sampling.strategies-file=/etc/jaeger/sampling_strategies.json","--collector.otlp.enabled","--collector.otlp.grpc.host-port=:4320","--collector.otlp.http.host-port=:4321"]` | Default args passed to the `jaeger` binary | +| jaeger.args | list | `["--config=/etc/jaeger/jaeger-config.yaml"]` | Default args passed to the `jaeger` binary. Jaeger v2.16+ uses a YAML config file instead of CLI flags. See https://www.jaegertracing.io/docs/2.16/configuration/ | | jaeger.collector.name | string | `""` | Name of jaeger `collector` service | | 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 | `{"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 | | jaeger.containerSecurityContext | object | `{"allowPrivilegeEscalation":false,"readOnlyRootFilesystem":true,"runAsGroup":101,"runAsUser":100}` | Security context for the `jaeger` container, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) | | jaeger.enabled | bool | `false` | Enable `jaeger` | | jaeger.image.defaultTag | string | `"6.0.0@sha256:79548aa11d7e2e6bf3e2012fb9e046df12ba5c5410bc24ec8f4d7cbb880336b9"` | Docker image tag for the `jaeger` image | diff --git a/charts/sourcegraph/templates/jaeger/jaeger-collector.Service.yaml b/charts/sourcegraph/templates/jaeger/jaeger-collector.Service.yaml index 7e6ac14b..c03facd0 100644 --- a/charts/sourcegraph/templates/jaeger/jaeger-collector.Service.yaml +++ b/charts/sourcegraph/templates/jaeger/jaeger-collector.Service.yaml @@ -17,14 +17,14 @@ metadata: name: {{ default "jaeger-collector" .Values.jaeger.collector.name }} spec: ports: - - name: http-collector - port: 4321 + - name: http-otlp + port: 4318 protocol: TCP - targetPort: http-collector - - name: grpc-collector - port: 4320 + targetPort: http-otlp + - name: grpc-otlp + port: 4317 protocol: TCP - targetPort: grpc-collector + targetPort: grpc-otlp selector: {{- include "sourcegraph.jaeger.selectorLabels" . | nindent 4 }} app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/charts/sourcegraph/templates/jaeger/jaeger.ConfigMap.yaml b/charts/sourcegraph/templates/jaeger/jaeger.ConfigMap.yaml new file mode 100644 index 00000000..7e2a388c --- /dev/null +++ b/charts/sourcegraph/templates/jaeger/jaeger.ConfigMap.yaml @@ -0,0 +1,57 @@ +{{- if and .Values.jaeger.enabled (not .Values.jaeger.config.existingConfigMap) -}} +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + {{- include "sourcegraph.jaeger.labels" . | nindent 4 }} + deploy: sourcegraph + app.kubernetes.io/component: all-in-one + app: jaeger + name: {{ .Values.jaeger.name }} +data: + jaeger-config.yaml: | + service: + extensions: [jaeger_storage, jaeger_query, remote_sampling, healthcheckv2] + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [jaeger_storage_exporter] + telemetry: + logs: + level: {{ .Values.jaeger.config.logLevel | default "info" }} + extensions: + healthcheckv2: + use_v2: true + http: + endpoint: "0.0.0.0:13133" + jaeger_storage: + backends: + main_store: + memory: + max_traces: {{ .Values.jaeger.config.maxTraces | default 20000 }} + jaeger_query: + storage: + traces: main_store + base_path: "/-/debug/jaeger" + http: + endpoint: "0.0.0.0:16686" + remote_sampling: + file: + path: /etc/jaeger/sampling_strategies.json + default_sampling_probability: {{ .Values.jaeger.config.samplingDefaultProbability | default 1.0 }} + http: + endpoint: "0.0.0.0:5778" + receivers: + otlp: + protocols: + grpc: + endpoint: "0.0.0.0:4317" + http: + endpoint: "0.0.0.0:4318" + processors: + batch: {} + exporters: + jaeger_storage_exporter: + trace_storage: main_store +{{- end }} diff --git a/charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml b/charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml index 34eb8381..75c8961e 100644 --- a/charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml +++ b/charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml @@ -30,6 +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 }} @@ -53,36 +56,31 @@ spec: - name: jaeger image: {{ include "sourcegraph.image" (list . "jaeger") }} imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }} - args: {{- default (list "--memory.max-traces=20000" "--sampling.strategies-file=/etc/jaeger/sampling_strategies.json" "--collector.otlp.enabled") .Values.jaeger.args | toYaml | nindent 8 }} + args: {{- default (list "--config=/etc/jaeger/jaeger-config.yaml") .Values.jaeger.args | toYaml | nindent 8 }} env: {{- range $name, $item := .Values.jaeger.env}} - name: {{ $name }} {{- $item | toYaml | nindent 10 }} {{- end }} ports: - - containerPort: 5775 - protocol: UDP - - containerPort: 6831 - protocol: UDP - - containerPort: 6832 - protocol: UDP - containerPort: 5778 protocol: TCP - - containerPort: 14250 + - containerPort: 16686 + name: http protocol: TCP - - name: grpc-collector - containerPort: 4320 + - containerPort: 4317 + name: grpc-otlp protocol: TCP - - name: http-collector - containerPort: 4321 + - containerPort: 4318 + name: http-otlp protocol: TCP - - name: http - containerPort: 16686 + - containerPort: 13133 + name: health protocol: TCP readinessProbe: httpGet: - path: "/" - port: 14269 + path: "/status" + port: 13133 initialDelaySeconds: 5 {{- if not .Values.sourcegraph.localDevMode }} resources: @@ -91,6 +89,10 @@ spec: securityContext: {{- toYaml .Values.jaeger.containerSecurityContext | nindent 10 }} volumeMounts: + - name: jaeger-config + mountPath: /etc/jaeger/jaeger-config.yaml + subPath: jaeger-config.yaml + readOnly: true {{- if .Values.jaeger.extraVolumeMounts }} {{- toYaml .Values.jaeger.extraVolumeMounts | nindent 8 }} {{- end }} @@ -109,6 +111,12 @@ spec: {{- end }} {{- include "sourcegraph.renderServiceAccountName" (list . "jaeger") | trim | nindent 6 }} volumes: + - name: jaeger-config + configMap: + name: {{ default .Values.jaeger.name .Values.jaeger.config.existingConfigMap }} + items: + - key: jaeger-config.yaml + path: jaeger-config.yaml {{- if .Values.jaeger.extraVolumes }} {{- toYaml .Values.jaeger.extraVolumes | nindent 6 }} {{- end }} diff --git a/charts/sourcegraph/templates/otel-collector/otel-collector.Deployment.yaml b/charts/sourcegraph/templates/otel-collector/otel-collector.Deployment.yaml index d1d428a4..38d6d7c2 100644 --- a/charts/sourcegraph/templates/otel-collector/otel-collector.Deployment.yaml +++ b/charts/sourcegraph/templates/otel-collector/otel-collector.Deployment.yaml @@ -64,9 +64,9 @@ spec: - name: JAEGER_HOST value: jaeger-collector - name: JAEGER_OTLP_GRPC_PORT - value: "4320" + value: "4317" - name: JAEGER_OTLP_HTTP_PORT - value: "4321" + value: "4318" {{- end }} {{- range $name, $item := .Values.openTelemetry.gateway.env}} - name: {{ $name }} diff --git a/charts/sourcegraph/values.yaml b/charts/sourcegraph/values.yaml index 84af11e0..cdb59b5f 100644 --- a/charts/sourcegraph/values.yaml +++ b/charts/sourcegraph/values.yaml @@ -1176,15 +1176,24 @@ jaeger: name: "jaeger-all-in-one" # -- Name used by resources. Does not affect service names or PVCs. name: "jaeger" - # -- Default args passed to the `jaeger` binary + # -- Default args passed to the `jaeger` binary. + # Jaeger v2.16+ uses a YAML config file instead of CLI flags. + # See https://www.jaegertracing.io/docs/2.16/configuration/ args: [ - "--memory.max-traces=20000", - "--sampling.strategies-file=/etc/jaeger/sampling_strategies.json", - "--collector.otlp.enabled", - "--collector.otlp.grpc.host-port=:4320", - "--collector.otlp.http.host-port=:4321", + "--config=/etc/jaeger/jaeger-config.yaml", ] + # -- 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) + logLevel: info + # -- Default sampling probability (0.0 to 1.0) returned to services that query Jaeger for sampling config + samplingDefaultProbability: 1.0 # -- Security context for the `jaeger` container, # learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) containerSecurityContext: