Skip to content

Commit e9655bc

Browse files
hellspawn679rgaduputmehulyurishkuro
authored
[jaeger-v2] Add support for Elasticsearch (#617)
* Jaeger allInOne allow different storage types (#603) Signed-off-by: Reddysekhar Gaduputi <[email protected]> upgrade jaeger-operator to latest 1.61.0 (#605) Signed-off-by: Blair Bowden <[email protected]> added all-in-one deployment and configmap for jaeger-v2 Signed-off-by: Mehul <[email protected]> lint fix Signed-off-by: Mehul <[email protected]> fixed Signed-off-by: Mehul <[email protected]> lint fix Signed-off-by: Mehul <[email protected]> lint fix Signed-off-by: Mehul <[email protected]> fixed using pre-hook Signed-off-by: Mehul <[email protected]> fixed --config flag is not been passed Signed-off-by: mehul <[email protected]> release ns for config-map.yaml Signed-off-by: mehul <[email protected]> testing ci Signed-off-by: mehul <[email protected]> testing ci Signed-off-by: mehul <[email protected]> fixed ns Signed-off-by: mehul <[email protected]> fixed ns Signed-off-by: mehul <[email protected]> fixed template Signed-off-by: mehul <[email protected]> removed sampling Signed-off-by: mehul <[email protected]> removed adaptive sampling from processors Signed-off-by: mehul <[email protected]> Revert "Jaeger v2 test2" Signed-off-by: mehul <[email protected]> attempt to create v2 chart in v1 Signed-off-by: mehul <[email protected]> enabled collector query and agent Signed-off-by: mehul <[email protected]> version bump Signed-off-by: mehul <[email protected]> testing-v2-ci Signed-off-by: mehul <[email protected]> testing-v2-ci Signed-off-by: mehul <[email protected]> added --helm-extra-set-args flag Signed-off-by: mehul <[email protected]> fixed healthcheck port-v2 Signed-off-by: mehul <[email protected]> Fix health check path Signed-off-by: Yuri Shkuro <[email protected]> minor changes Signed-off-by: mehul <[email protected]> * minor changes Signed-off-by: mehul <[email protected]> * added image changes Signed-off-by: mehul <[email protected]> * fix lint Signed-off-by: mehul <[email protected]> * removed v1 allInOne and added jaeger-v2 Signed-off-by: mehul <[email protected]> * removed v2 references Signed-off-by: mehul <[email protected]> * added allInOne again Signed-off-by: mehul <[email protected]> * minor fix Signed-off-by: mehul <[email protected]> * fixed how the config is being passed Signed-off-by: mehul <[email protected]> * fixed mirror template change Signed-off-by: mehul <[email protected]> * use --set-file for user config Signed-off-by: mehul <[email protected]> * removed config-test and updated configmap template Signed-off-by: mehul <[email protected]> * fixed Signed-off-by: mehul <[email protected]> * fixed minor naming Signed-off-by: mehul <[email protected]> * indentation Signed-off-by: Yuri Shkuro <[email protected]> * v2-elasticsearch Signed-off-by: mehul <[email protected]> * fix ci Signed-off-by: mehul <[email protected]> * fix ci Signed-off-by: mehul <[email protected]> * fixed Signed-off-by: mehul <[email protected]> * fixed and added docs Signed-off-by: mehul <[email protected]> * fixed Signed-off-by: mehul <[email protected]> * added port Signed-off-by: mehul <[email protected]> * fixed Signed-off-by: mehul <[email protected]> * fixed Signed-off-by: mehul <[email protected]> * fixed typo Signed-off-by: mehul <[email protected]> * fixed Signed-off-by: mehul <[email protected]> * removed test config Signed-off-by: mehul <[email protected]> * updated docs Signed-off-by: mehul <[email protected]> --------- Signed-off-by: mehul <[email protected]> Signed-off-by: mehul gautam <[email protected]> Signed-off-by: mehul <[email protected]> Signed-off-by: Yuri Shkuro <[email protected]> Co-authored-by: Reddysekhar Gaduputi <[email protected]> Co-authored-by: mehul <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]>
1 parent 6b4a59c commit e9655bc

12 files changed

+267
-44
lines changed

.github/workflows/lint-test.yaml

+25-8
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,29 @@ jobs:
4949

5050
- name: Run chart-testing (install)
5151
run: |
52-
ct install --config ct.yaml \
53-
--helm-extra-set-args "
54-
--set provisionDataStore.cassandra=false \
55-
--set storage.type=memory \
56-
--set allInOne.enabled=true \
57-
--set agent.enabled=false \
58-
--set collector.enabled=false \
59-
--set query.enabled=false "
52+
ct install --config ct.yaml
53+
test-with-elasticsearch:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v2
57+
with:
58+
fetch-depth: 0
59+
60+
- uses: ./.github/actions/prepare-k8s
61+
62+
- name: Run chart-testing (install)
63+
run: |
64+
ct install --config ct.yaml \
65+
--helm-extra-set-args " \
66+
--set provisionDataStore.elasticsearch=true \
67+
--set allInOne.enabled=false \
68+
--set storage.type=elasticsearch \
69+
--set elasticsearch.master.masterOnly=false \
70+
--set elasticsearch.master.replicaCount=1 \
71+
--set elasticsearch.data.replicaCount=0 \
72+
--set elasticsearch.coordinating.replicaCount=0 \
73+
--set elasticsearch.ingest.replicaCount=0
74+
--set agent.enabled=true \
75+
--set collector.enabled=true \
76+
--set query.enabled=true"
6077

charts/jaeger/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: A Jaeger Helm chart for Kubernetes
44
name: jaeger
55
type: application
66
version: 4.0.0
7+
annotations:
8+
Jaegerv1Version: "1.62.0"
79
# CronJobs require v1.21
810
kubeVersion: ">= 1.21-0"
911
keywords:
@@ -16,8 +18,6 @@ icon: https://www.jaegertracing.io/img/jaeger-icon-reverse-color.svg
1618
sources:
1719
- https://hub.docker.com/u/jaegertracing/
1820
maintainers:
19-
- name: dvonthenen
20-
2121
- name: mehta-ankit
2222
2323
- name: mikelorant

charts/jaeger/README-v2.md

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
2+
---
3+
4+
# Jaeger Helm-chart Documentation
5+
6+
## Overview
7+
This documentation provides step-by-step setup and configuration instructions for running Jaeger in various modes, with sections for both the `all-in-one` mode and the `Elasticsearch` configuration, followed by details on optional `--set` flags for custom configurations.
8+
9+
---
10+
11+
### 1. Jaeger All-in-One Mode
12+
13+
Jaeger’s all-in-one mode combines the Jaeger Agent, Collector, and Query into a single pod for simplicity. Use this mode for testing or lightweight deployments.
14+
15+
#### **Command to Run All-in-One**
16+
17+
```bash
18+
helm install <chart_name> charts/jaeger \
19+
--set-file userconfig=path/to/configfile.yaml # Optional: user-specific config
20+
```
21+
22+
- **Flags Explained**:
23+
- `provisionDataStore.cassandra=false`: Disable Cassandra provision.
24+
- `storage.type=memory`: Use in-memory storage (non-persistent).
25+
- `allInOne.enabled=true`: Enable the all-in-one Jaeger setup.
26+
- `agent.enabled=false`, `collector.enabled=false`, `query.enabled=false`: Disable separate components since they’re embedded in all-in-one.
27+
- `userconfig`: Optional file for additional configuration.
28+
29+
30+
---
31+
32+
### 2. Elasticsearch Mode with Provisioned Data Store
33+
34+
This mode configures Jaeger to store trace data in an Elasticsearch backend, suitable for production-level usage.
35+
36+
#### **Command to Run with Elasticsearch**
37+
38+
1. **Single Master Node Configuration**
39+
For a basic setup with only one Elasticsearch master node, use this command:
40+
41+
```bash
42+
helm install <chart_name> charts/jaeger \
43+
--set provisionDataStore.elasticsearch=true \
44+
--set allInOne.enabled=false \
45+
--set storage.type=elasticsearch \
46+
--set elasticsearch.master.masterOnly=false \
47+
--set elasticsearch.master.replicaCount=1 \
48+
--set elasticsearch.data.replicaCount=0 \
49+
--set elasticsearch.coordinating.replicaCount=0 \
50+
--set elasticsearch.ingest.replicaCount=0
51+
--set agent.enabled=true \
52+
--set collector.enabled=true \
53+
--set query.enabled=true
54+
--set-file userconfig=path/to/configfile.yaml # Optional: user-specific config
55+
```
56+
57+
2. **Default Configuration**
58+
For a more straightforward setup with default Elasticsearch configuration, use:
59+
60+
```bash
61+
helm install <chart_name> charts/jaeger \
62+
--set provisionDataStore.elasticsearch=true \
63+
--set allInOne.enabled=false \
64+
--set storage.type=elasticsearch \
65+
--set agent.enabled=true \
66+
--set collector.enabled=true \
67+
--set query.enabled=true
68+
--set-file userconfig=path/to/configfile.yaml # Optional: user-specific config
69+
```
70+
71+
- **Flags Explained**:
72+
- `provisionDataStore.cassandra=false`: Disable Cassandra provision.
73+
- `provisionDataStore.elasticsearch=true`: Enable Elasticsearch as the storage.
74+
- `storage.type=elasticsearch`: Use Elasticsearch for storage.
75+
- **Single Master Node Settings** (optional for simplified configuration):
76+
- `elasticsearch.master.masterOnly=false`
77+
- `elasticsearch.master.replicaCount=1`
78+
- `elasticsearch.data.replicaCount=0`
79+
- `elasticsearch.coordinating.replicaCount=0`
80+
- `elasticsearch.ingest.replicaCount=0`
81+
- `userconfig`: Optional file for additional configuration.
82+
83+
---
84+
85+
86+
### 3. Additional `--set` Configuration Options
87+
88+
For custom configurations, the following flags are commonly used. These cover primary Elasticsearch storage settings and additional archive configurations.
89+
90+
#### **Primary Storage Settings**
91+
- `.Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.index_prefix`: Set the prefix for Elasticsearch indices.
92+
- `.Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.host`: Specify the Elasticsearch host.
93+
- `.Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.user`: Username for Elasticsearch authentication.
94+
- `.Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.password`: Password for Elasticsearch authentication.
95+
96+
Here’s the updated documentation with the archive storage settings referenced and with similar flags specified for archive configurations.
97+
98+
99+
#### **Archive Storage Settings**
100+
- Similar flags for archive configurations can be used to manage archived trace data.
101+
102+
The `values.yaml` file shows archive configurations under `jaeger_storage` with the `archive_store` section for Elasticsearch. You can configure these with the following flags:
103+
104+
- `.Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.index_prefix`
105+
- `.Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.server_urls`
106+
- `.Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.username`
107+
- `.Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.password`
108+
109+
---

charts/jaeger/templates/_helpers.tpl

+2-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,8 @@ Create pull secrets for ingester image
608608
Create image name for agent image
609609
*/}}
610610
{{- define "agent.image" -}}
611-
{{- include "renderImage" ( dict "imageRoot" .Values.agent.image "context" $ ) -}}
611+
{{- $image := merge .Values.agent.image (dict "tag" .Chart.Annotations.Jaegerv1Version) -}}
612+
{{- include "renderImage" ( dict "imageRoot" $image "context" $ ) -}}
612613
{{- end -}}
613614

614615
{{/*

charts/jaeger/templates/collector-deploy.yaml

+16-6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ spec:
4343
url="{{ include "elasticsearch.client.url" . }}"
4444
until [ "$(curl -s -o /dev/null -w '%{http_code}' "$url/_cluster/health")" = "200" ]; do
4545
echo "Waiting for Elasticsearch at $url"
46+
echo "$(curl -s "$url/_cluster/health")"
4647
sleep 5
4748
done
4849
{{- end}}
@@ -64,6 +65,8 @@ spec:
6465
image: {{ include "collector.image" . }}
6566
imagePullPolicy: {{ .Values.collector.image.pullPolicy }}
6667
args:
68+
- "--config"
69+
- "/etc/jaeger/user-config.yaml"
6770
{{ include "extra.cmdArgs" ( dict "cmdlineParams" .Values.collector.cmdlineParams ) | nindent 10 }}
6871
{{- if not .Values.ingester.enabled -}}
6972
{{- include "storage.cmdArgs" . | nindent 10 }}
@@ -123,8 +126,8 @@ spec:
123126
- containerPort: {{ .Values.collector.service.http.port }}
124127
name: http
125128
protocol: TCP
126-
- containerPort: 14269
127-
name: admin
129+
- containerPort: 13133
130+
name: healthcheck
128131
protocol: TCP
129132
{{- if .Values.collector.service.zipkin }}
130133
- containerPort: {{ .Values.collector.service.zipkin.port }}
@@ -141,15 +144,19 @@ spec:
141144
{{- end }}
142145
readinessProbe:
143146
httpGet:
144-
path: /
145-
port: admin
147+
path: /status
148+
port: healthcheck
149+
scheme: HTTP
146150
livenessProbe:
147151
httpGet:
148-
path: /
149-
port: admin
152+
path: /status
153+
port: healthcheck
154+
scheme: HTTP
150155
resources:
151156
{{- toYaml .Values.collector.resources | nindent 10 }}
152157
volumeMounts:
158+
- name: user-config
159+
mountPath: /etc/jaeger
153160
{{- range .Values.collector.extraConfigmapMounts }}
154161
- name: {{ .name }}
155162
mountPath: {{ .mountPath }}
@@ -189,6 +196,9 @@ spec:
189196
dnsPolicy: {{ .Values.collector.dnsPolicy }}
190197
restartPolicy: Always
191198
volumes:
199+
- name: user-config
200+
configMap:
201+
name: user-config
192202
{{- range .Values.collector.extraConfigmapMounts }}
193203
- name: {{ .name }}
194204
configMap:

charts/jaeger/templates/collector-servicemonitor.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ metadata:
1818
{{- end }}
1919
spec:
2020
endpoints:
21-
- port: admin
21+
- port: healthcheck
2222
path: /metrics
2323
{{- if .Values.collector.serviceMonitor.interval }}
2424
interval: {{ .Values.collector.serviceMonitor.interval }}

charts/jaeger/templates/collector-svc.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ spec:
6060
protocol: TCP
6161
targetPort: {{ .Values.collector.service.otlp.http.name }}
6262
{{- end }}
63-
- name: {{ .Values.collector.service.admin.name }}
64-
port: 14269
65-
targetPort: {{ .Values.collector.service.admin.targetPort }}
63+
- name: {{ .Values.collector.service.healthCheck.name }}
64+
port: 13133
65+
targetPort: {{ .Values.collector.service.healthCheck.targetPort }}
6666
selector:
6767
{{- include "jaeger.selectorLabels" . | nindent 4 }}
6868
app.kubernetes.io/component: collector
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{{ if (and (not .Values.userconfig) .Values.provisionDataStore.elasticsearch) }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: user-config
6+
namespace: {{ include "jaeger.namespace" . }}
7+
labels:
8+
{{- include "jaeger.labels" . | nindent 4 }}
9+
data:
10+
user-config.yaml: |
11+
service:
12+
extensions: [jaeger_storage, jaeger_query, healthcheckv2]
13+
pipelines:
14+
traces:
15+
receivers: [otlp]
16+
processors: [batch]
17+
exporters: [jaeger_storage_exporter]
18+
19+
extensions:
20+
healthcheckv2:
21+
use_v2: true
22+
http:
23+
endpoint: 0.0.0.0:13133
24+
25+
jaeger_query:
26+
storage:
27+
traces: primary_store
28+
traces_archive: archive_store
29+
30+
31+
jaeger_storage:
32+
backends:
33+
primary_store:
34+
elasticsearch:
35+
index_prefix: {{- .Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.index_prefix | quote | indent 2 }}
36+
server_urls: ["{{ include "elasticsearch.client.url" . }}"]
37+
username: {{- .Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.username | quote | indent 2 }}
38+
{{- if .Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.password }}
39+
password: {{- .Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.password | quote | indent 2 }}
40+
{{- end }}
41+
archive_store:
42+
elasticsearch:
43+
index_prefix: {{- .Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.index_prefix | quote | indent 2 }}
44+
server_urls: ["{{ include "elasticsearch.client.url" . }}"]
45+
username: {{- .Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.username | quote | indent 2 }}
46+
{{- if .Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.password }}
47+
password: {{- .Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.password | quote | indent 2 }}
48+
{{- end }}
49+
50+
receivers:
51+
otlp:
52+
protocols:
53+
grpc:
54+
endpoint:{{ .Values.config.receivers.otlp.protocols.grpc.endpoint | indent 1 }}
55+
http:
56+
endpoint:{{ .Values.config.receivers.otlp.protocols.http.endpoint | indent 1 }}
57+
58+
processors:
59+
batch:
60+
61+
exporters:
62+
jaeger_storage_exporter:
63+
trace_storage: primary_store
64+
{{- end }}

charts/jaeger/templates/query-deploy.yaml

+15-6
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ spec:
7070
image: {{ include "query.image" . }}
7171
imagePullPolicy: {{ .Values.query.image.pullPolicy }}
7272
args:
73+
- "--config"
74+
- "/etc/jaeger/user-config.yaml"
7375
{{ include "extra.cmdArgs" ( dict "cmdlineParams" .Values.query.cmdlineParams ) | nindent 10 }}
7476
{{- include "storage.cmdArgs" . | nindent 10 }}
7577
env:
@@ -99,12 +101,14 @@ spec:
99101
- name: grpc
100102
containerPort: 16685
101103
protocol: TCP
102-
- name: admin
103-
containerPort: 16687
104+
- name: healthcheck
105+
containerPort: 13133
104106
protocol: TCP
105107
resources:
106108
{{- toYaml .Values.query.resources | nindent 10 }}
107109
volumeMounts:
110+
- name: user-config
111+
mountPath: /etc/jaeger
108112
{{- range .Values.query.extraSecretMounts }}
109113
- name: {{ .name }}
110114
mountPath: {{ .mountPath }}
@@ -143,12 +147,14 @@ spec:
143147
{{- end }}
144148
livenessProbe:
145149
httpGet:
146-
path: /
147-
port: admin
150+
path: /status
151+
port: healthcheck
152+
scheme: HTTP
148153
readinessProbe:
149154
httpGet:
150-
path: /
151-
port: admin
155+
path: /status
156+
port: healthcheck
157+
scheme: HTTP
152158
{{- if .Values.query.oAuthSidecar.enabled }}
153159
- name: {{ template "jaeger.agent.name" . }}-oauth2-sidecar
154160
securityContext:
@@ -247,6 +253,9 @@ spec:
247253
dnsPolicy: {{ .Values.query.dnsPolicy }}
248254
restartPolicy: Always
249255
volumes:
256+
- name: user-config
257+
configMap:
258+
name: user-config
250259
{{- range .Values.query.extraConfigmapMounts }}
251260
- name: {{ .name }}
252261
configMap:

charts/jaeger/templates/query-svc.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ spec:
2323
port: 16685
2424
protocol: TCP
2525
targetPort: grpc
26-
- name: {{ .Values.query.service.admin.name }}
27-
port: 16687
26+
- name: {{ .Values.query.service.healthCheck.name }}
27+
port: 13133
2828
protocol: TCP
29-
targetPort: {{ .Values.query.service.admin.targetPort }}
29+
targetPort: {{ .Values.query.service.healthCheck.targetPort }}
3030
selector:
3131
{{- include "jaeger.selectorLabels" . | nindent 4 }}
3232
app.kubernetes.io/component: query

charts/jaeger/templates/user-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Generates a config map from a file provided by user via `--set-file userconfig=`
12
{{ if .Values.userconfig }}
23
apiVersion: v1
34
kind: ConfigMap

0 commit comments

Comments
 (0)