Skip to content

Commit 43fbf49

Browse files
sourcegraph-release-botDaedalusGmichaellzc
authored
[Backport 7.1.x] fix helm manifests to support 2.16 jaeger configs (#845)
Backport 1b6f92b from #841 closes PLAT-485 Update manifests to support 2.16 jaeger configurations style This follows changes to the sourcegraph jaeger base image sourcegraph/sourcegraph#10912 ### Test plan See testing from original PR, this version of the charts was tested via `kind` Tested by generating a template of the jaeger deployment and running ``` helm unittest charts/sourcegraph -f 'tests/otelCollectorJaeger_test.yaml' -f 'tests/otelAgentHostPort_test.yaml' 2>&1 ``` Co-authored-by: Warren Gifford <warrenbruceg@gmail.com> Co-authored-by: Michael Lin <mlzc@hey.com>
1 parent 15b9378 commit 43fbf49

6 files changed

Lines changed: 110 additions & 31 deletions

File tree

charts/sourcegraph/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,16 @@ In addition to the documented values, all services also support the following va
157157
| indexedSearchIndexer.image.defaultTag | string | `"6.0.0@sha256:11539e07040b85045a9aa07f970aa310066e240dc28e6c9627653ee2bc6e0b91"` | Docker image tag for the `zoekt-indexserver` image |
158158
| indexedSearchIndexer.image.name | string | `"search-indexer"` | Docker image name for the `zoekt-indexserver` image |
159159
| 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. |
160-
| 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 |
160+
| 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/ |
161161
| jaeger.collector.name | string | `""` | Name of jaeger `collector` service |
162162
| jaeger.collector.serviceAnnotations | object | `{}` | Add extra annotations to jaeger `collector` service |
163163
| jaeger.collector.serviceLabels | object | `{}` | Add extra labels to jaeger `collector` service |
164164
| 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) |
165+
| 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. |
166+
| 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/ |
167+
| jaeger.config.logLevel | string | `"info"` | Log level for the Jaeger instance (debug, info, warn, error) |
168+
| jaeger.config.maxTraces | int | `20000` | Maximum number of traces stored in memory |
169+
| jaeger.config.samplingDefaultProbability | float | `1` | Default sampling probability (0.0 to 1.0) returned to services that query Jaeger for sampling config |
165170
| 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) |
166171
| jaeger.enabled | bool | `false` | Enable `jaeger` |
167172
| jaeger.image.defaultTag | string | `"6.0.0@sha256:79548aa11d7e2e6bf3e2012fb9e046df12ba5c5410bc24ec8f4d7cbb880336b9"` | Docker image tag for the `jaeger` image |

charts/sourcegraph/templates/jaeger/jaeger-collector.Service.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ metadata:
1717
name: {{ default "jaeger-collector" .Values.jaeger.collector.name }}
1818
spec:
1919
ports:
20-
- name: http-collector
21-
port: 4321
20+
- name: http-otlp
21+
port: 4318
2222
protocol: TCP
23-
targetPort: http-collector
24-
- name: grpc-collector
25-
port: 4320
23+
targetPort: http-otlp
24+
- name: grpc-otlp
25+
port: 4317
2626
protocol: TCP
27-
targetPort: grpc-collector
27+
targetPort: grpc-otlp
2828
selector:
2929
{{- include "sourcegraph.jaeger.selectorLabels" . | nindent 4 }}
3030
app.kubernetes.io/instance: {{ .Release.Name }}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{{- if and .Values.jaeger.enabled (not .Values.jaeger.config.existingConfigMap) -}}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
labels:
6+
{{- include "sourcegraph.jaeger.labels" . | nindent 4 }}
7+
deploy: sourcegraph
8+
app.kubernetes.io/component: all-in-one
9+
app: jaeger
10+
name: {{ .Values.jaeger.name }}
11+
data:
12+
jaeger-config.yaml: |
13+
service:
14+
extensions: [jaeger_storage, jaeger_query, remote_sampling, healthcheckv2]
15+
pipelines:
16+
traces:
17+
receivers: [otlp]
18+
processors: [batch]
19+
exporters: [jaeger_storage_exporter]
20+
telemetry:
21+
logs:
22+
level: {{ .Values.jaeger.config.logLevel | default "info" }}
23+
extensions:
24+
healthcheckv2:
25+
use_v2: true
26+
http:
27+
endpoint: "0.0.0.0:13133"
28+
jaeger_storage:
29+
backends:
30+
main_store:
31+
memory:
32+
max_traces: {{ .Values.jaeger.config.maxTraces | default 20000 }}
33+
jaeger_query:
34+
storage:
35+
traces: main_store
36+
base_path: "/-/debug/jaeger"
37+
http:
38+
endpoint: "0.0.0.0:16686"
39+
remote_sampling:
40+
file:
41+
path: /etc/jaeger/sampling_strategies.json
42+
default_sampling_probability: {{ .Values.jaeger.config.samplingDefaultProbability | default 1.0 }}
43+
http:
44+
endpoint: "0.0.0.0:5778"
45+
receivers:
46+
otlp:
47+
protocols:
48+
grpc:
49+
endpoint: "0.0.0.0:4317"
50+
http:
51+
endpoint: "0.0.0.0:4318"
52+
processors:
53+
batch: {}
54+
exporters:
55+
jaeger_storage_exporter:
56+
trace_storage: main_store
57+
{{- end }}

charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ spec:
3030
kubectl.kubernetes.io/default-container: jaeger
3131
prometheus.io/port: "16686"
3232
sourcegraph.prometheus/scrape: "true"
33+
{{- if not .Values.jaeger.config.existingConfigMap }}
34+
checksum/jaeger-config: {{ include (print $.Template.BasePath "/jaeger/jaeger.ConfigMap.yaml") . | sha256sum }}
35+
{{- end }}
3336
{{- if .Values.sourcegraph.podAnnotations }}
3437
{{- toYaml .Values.sourcegraph.podAnnotations | nindent 8 }}
3538
{{- end }}
@@ -53,36 +56,31 @@ spec:
5356
- name: jaeger
5457
image: {{ include "sourcegraph.image" (list . "jaeger") }}
5558
imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }}
56-
args: {{- default (list "--memory.max-traces=20000" "--sampling.strategies-file=/etc/jaeger/sampling_strategies.json" "--collector.otlp.enabled") .Values.jaeger.args | toYaml | nindent 8 }}
59+
args: {{- default (list "--config=/etc/jaeger/jaeger-config.yaml") .Values.jaeger.args | toYaml | nindent 8 }}
5760
env:
5861
{{- range $name, $item := .Values.jaeger.env}}
5962
- name: {{ $name }}
6063
{{- $item | toYaml | nindent 10 }}
6164
{{- end }}
6265
ports:
63-
- containerPort: 5775
64-
protocol: UDP
65-
- containerPort: 6831
66-
protocol: UDP
67-
- containerPort: 6832
68-
protocol: UDP
6966
- containerPort: 5778
7067
protocol: TCP
71-
- containerPort: 14250
68+
- containerPort: 16686
69+
name: http
7270
protocol: TCP
73-
- name: grpc-collector
74-
containerPort: 4320
71+
- containerPort: 4317
72+
name: grpc-otlp
7573
protocol: TCP
76-
- name: http-collector
77-
containerPort: 4321
74+
- containerPort: 4318
75+
name: http-otlp
7876
protocol: TCP
79-
- name: http
80-
containerPort: 16686
77+
- containerPort: 13133
78+
name: health
8179
protocol: TCP
8280
readinessProbe:
8381
httpGet:
84-
path: "/"
85-
port: 14269
82+
path: "/status"
83+
port: 13133
8684
initialDelaySeconds: 5
8785
{{- if not .Values.sourcegraph.localDevMode }}
8886
resources:
@@ -91,6 +89,10 @@ spec:
9189
securityContext:
9290
{{- toYaml .Values.jaeger.containerSecurityContext | nindent 10 }}
9391
volumeMounts:
92+
- name: jaeger-config
93+
mountPath: /etc/jaeger/jaeger-config.yaml
94+
subPath: jaeger-config.yaml
95+
readOnly: true
9496
{{- if .Values.jaeger.extraVolumeMounts }}
9597
{{- toYaml .Values.jaeger.extraVolumeMounts | nindent 8 }}
9698
{{- end }}
@@ -109,6 +111,12 @@ spec:
109111
{{- end }}
110112
{{- include "sourcegraph.renderServiceAccountName" (list . "jaeger") | trim | nindent 6 }}
111113
volumes:
114+
- name: jaeger-config
115+
configMap:
116+
name: {{ default .Values.jaeger.name .Values.jaeger.config.existingConfigMap }}
117+
items:
118+
- key: jaeger-config.yaml
119+
path: jaeger-config.yaml
112120
{{- if .Values.jaeger.extraVolumes }}
113121
{{- toYaml .Values.jaeger.extraVolumes | nindent 6 }}
114122
{{- end }}

charts/sourcegraph/templates/otel-collector/otel-collector.Deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ spec:
6464
- name: JAEGER_HOST
6565
value: jaeger-collector
6666
- name: JAEGER_OTLP_GRPC_PORT
67-
value: "4320"
67+
value: "4317"
6868
- name: JAEGER_OTLP_HTTP_PORT
69-
value: "4321"
69+
value: "4318"
7070
{{- end }}
7171
{{- range $name, $item := .Values.openTelemetry.gateway.env}}
7272
- name: {{ $name }}

charts/sourcegraph/values.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,15 +1176,24 @@ jaeger:
11761176
name: "jaeger-all-in-one"
11771177
# -- Name used by resources. Does not affect service names or PVCs.
11781178
name: "jaeger"
1179-
# -- Default args passed to the `jaeger` binary
1179+
# -- Default args passed to the `jaeger` binary.
1180+
# Jaeger v2.16+ uses a YAML config file instead of CLI flags.
1181+
# See https://www.jaegertracing.io/docs/2.16/configuration/
11801182
args:
11811183
[
1182-
"--memory.max-traces=20000",
1183-
"--sampling.strategies-file=/etc/jaeger/sampling_strategies.json",
1184-
"--collector.otlp.enabled",
1185-
"--collector.otlp.grpc.host-port=:4320",
1186-
"--collector.otlp.http.host-port=:4321",
1184+
"--config=/etc/jaeger/jaeger-config.yaml",
11871185
]
1186+
# -- Jaeger v2 configuration overrides. We only provide a limited number of options, use `existingConfigMap` to provide a full config if you need more control.
1187+
config:
1188+
# -- 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.
1189+
# See https://www.jaegertracing.io/docs/2.16/configuration/
1190+
existingConfigMap: ""
1191+
# -- Maximum number of traces stored in memory
1192+
maxTraces: 20000
1193+
# -- Log level for the Jaeger instance (debug, info, warn, error)
1194+
logLevel: info
1195+
# -- Default sampling probability (0.0 to 1.0) returned to services that query Jaeger for sampling config
1196+
samplingDefaultProbability: 1.0
11881197
# -- Security context for the `jaeger` container,
11891198
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container)
11901199
containerSecurityContext:

0 commit comments

Comments
 (0)