Skip to content

Commit 07f7598

Browse files
committed
Fix various elasticsearch usage issues
Signed-off-by: Steven Erb <stevenpc3@live.com>
1 parent ff33317 commit 07f7598

17 files changed

Lines changed: 516 additions & 438 deletions

.github/workflows/lint-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646

4747
- uses: ./.github/actions/prepare-k8s
4848

49-
- run: make test-es
49+
- run: make test-jaeger-connect-elasticsearch

Makefile

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,39 @@ lint:
99
test:
1010
ct install --config ct.yaml
1111

12-
.PHONY: test-es
13-
test-es:
12+
# This test clears the extraEnvs for elasticsearch provision and then runs the elasticsearch builtin tests
13+
# jaeger comes up in memory storage mode
14+
# .PHONY: test-es
15+
# test-es:
16+
# ct install --config ct.yaml \
17+
# --charts charts/jaeger \
18+
# --helm-extra-set-args " \
19+
# --set provisionDataStore.elasticsearch=true \
20+
# --set storage.type=elasticsearch \
21+
# --set elasticsearch.clusterHealthCheckParams=wait_for_status=yellow&timeout=10s \
22+
# --set elasticsearch.readinessProbe.initialDelaySeconds=60 \
23+
# --set elasticsearch.readinessProbe.failureThreshold=10 \
24+
# --set elasticsearch.volumeClaimTemplate.resources.requests.storage=5Gi \
25+
# --set elasticsearch.protocol=https \
26+
# --set elasticsearch.extraEnvs=null \
27+
# --set 'elasticsearch.extraEnvs[0].name=hello' \
28+
# --set 'elasticsearch.extraEnvs[0].value=world'"
29+
30+
# This test will spin up the local provisioned elasticsearch and then connect jaeger to it not using memory store
31+
# it disables the built-in elasticsearch test since it just checks if it's up and jaeger connecting does the same
32+
# elasticsearch test also requires ssl and jaeger is configured to not require that for local connection
33+
.PHONY: test-jaeger-connect-elasticsearch
34+
test-jaeger-connect-elasticsearch:
1435
ct install --config ct.yaml \
1536
--charts charts/jaeger \
1637
--helm-extra-set-args " \
1738
--set provisionDataStore.elasticsearch=true \
1839
--set storage.type=elasticsearch \
19-
--set elasticsearch.master.masterOnly=false \
20-
--set elasticsearch.master.replicaCount=1 \
21-
--set elasticsearch.data.replicaCount=0 \
22-
--set elasticsearch.coordinating.replicaCount=0 \
23-
--set elasticsearch.ingest.replicaCount=0 \
24-
--set elasticsearch.clusterHealthCheckParams=wait_for_status=yellow&timeout=10s \
40+
--set elasticsearch.tests.enabled=false \
2541
--set elasticsearch.readinessProbe.initialDelaySeconds=60 \
2642
--set elasticsearch.readinessProbe.failureThreshold=10 \
27-
--set storage.elasticsearch.scheme=https \
28-
--set storage.elasticsearch.tls.insecure=true"
43+
--set elasticsearch.volumeClaimTemplate.resources.requests.storage=5Gi \
44+
--set elasticsearch.protocol=http \
45+
--set config.extensions.jaeger_query.storage.traces=primary_store_elasticsearch \
46+
--set config.extensions.jaeger_query.storage.traces_archive=archive_store_elasticsearch \
47+
--set config.exporters.jaeger_storage_exporter.trace_storage=primary_store_elasticsearch "

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To run the chart installation tests locally (simulating the CI environment), use
3333

3434
```bash
3535
make test # default install suite
36-
make test-es # Elasticsearch-provisioned suite
36+
make test-jaeger-connect-elasticsearch # Elasticsearch-provisioned suite
3737
```
3838

3939

charts/jaeger/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ appVersion: 2.14.1
33
description: A Jaeger Helm chart for Kubernetes
44
name: jaeger
55
type: application
6-
version: 4.3.4
6+
version: 4.3.5
77
# CronJobs require v1.21
88
kubeVersion: ">= 1.21-0"
99
keywords:

charts/jaeger/README.md

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ helm install jaeger jaegertracing/jaeger
5050

5151
## Configuration
5252

53+
There are several examples of how to configure you can reference at:
54+
55+
https://github.com/jaegertracing/jaeger/tree/main/cmd/jaeger
56+
5357
### 1. In-Memory (Default)
5458
Ideal for testing. No persistence.
5559
```bash
@@ -59,31 +63,71 @@ helm install jaeger jaegertracing/jaeger
5963
### 2. Elasticsearch (Production Recommended)
6064
Configure Jaeger to connect to Elasticsearch using the native config syntax.
6165

62-
**values.yaml Example:**
66+
You can either use the internal provisioned elasticsearch or point to an external elasticsearch.
67+
68+
The internal elasticsearch is configured to __NOT__ require a password or username by default.
69+
70+
#### Internal Provisioned Elasticsearch example:
71+
72+
**values.yaml**
6373
```yaml
6474
# Use the provisioned Elasticsearch subchart
6575
provisionDataStore:
6676
elasticsearch: true
6777

68-
# Or connect to an external Elasticsearch cluster by customizing the config:
6978
config:
7079
extensions:
80+
jaeger_query:
81+
storage:
82+
traces: primary_store_elasticsearch
83+
traces_archive: archive_store_elasticsearch
84+
exporters:
85+
jaeger_storage_exporter:
86+
trace_storage: primary_store_elasticsearch
87+
```
88+
89+
#### External Elasticsearch example:
90+
91+
**values.yaml**
92+
```yaml
93+
# External is very similar but you need to configure the urls
94+
config:
95+
extensions:
96+
jaeger_query:
97+
storage:
98+
traces: primary_store_elasticsearch
99+
traces_archive: archive_store_elasticsearch
71100
jaeger_storage:
72101
backends:
73-
primary_store:
102+
primary_store_elasticsearch:
103+
elasticsearch:
104+
server_urls: ["http://my-elasticsearch-master:9200"]
105+
auth:
106+
basic:
107+
username: elastic
108+
password: changeme
109+
archive_store_elasticsearch:
74110
elasticsearch:
75-
server_urls: ["http://elasticsearch:9200"]
76-
username: elastic
77-
password: changeme
111+
server_urls: ["http://my-elasticsearch-master:9200"]
112+
auth:
113+
basic:
114+
username: elastic
115+
password: changeme
116+
exporters:
117+
jaeger_storage_exporter:
118+
trace_storage: primary_store_elasticsearch
78119
```
79120
80121
**Running Maintenance Jobs:**
81-
To run Index Cleaner or Rollover jobs, enable them. They auto-configure when `provisionDataStore.elasticsearch` is enabled:
122+
To run Index Cleaner or Rollover jobs, enable them. They require configuration if using external by setting ```storage.type=elasticsearch``` and adjusting ```storage.elasticsearch``` values. See that section in values.yaml for more details.
123+
82124
```yaml
83125
esIndexCleaner:
84126
enabled: true
85127
```
86128

129+
* es-rollover __requires__ elasticsearch to be running __BEFORE__ install so the hook job can run.
130+
87131
### 3. Cassandra
88132
This chart does not provision a Cassandra cluster. To use Cassandra storage, you must provide your own Cassandra instance and configure Jaeger via the native config syntax:
89133

@@ -110,14 +154,16 @@ config:
110154

111155
### 4. Spark Dependencies
112156

113-
To run the Spark dependencies job (for dependency links graph):
157+
To run the Spark dependencies job (for dependency links graph) set ```spark.enabled=true```
158+
159+
Below is an example of how to set overrides. Please see the values.yaml for more examples:
160+
161+
The values are populated under ```storage.elasticsearch``` Please see comments in values.yaml for more details.
114162

115163
```yaml
116164
spark:
117165
enabled: true
118166
extraEnv:
119-
- name: ES_NODES
120-
value: http://elasticsearch:9200
121167
- name: ES_NODES_WAN_ONLY
122168
value: "true"
123169
```

charts/jaeger/templates/_helpers.tpl

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,24 +233,21 @@ Elasticsearch related environment variables
233233
{{- define "elasticsearch.env" -}}
234234
{{- if or .Values.provisionDataStore.elasticsearch (eq .Values.storage.type "elasticsearch") -}}
235235
{{- $es := .Values.storage.elasticsearch | default dict -}}
236-
{{- $scheme := $es.scheme | default "http" -}}
237-
{{- $port := $es.port | default 9200 -}}
238236
{{- $user := $es.user | default "elastic" -}}
239-
{{- $password := .Values.elasticsearch.secret.password | default "changeme" -}}
237+
{{- $password := $es.password | default "changeme" -}}
238+
{{- $url := $es.url | default "http://elasticsearch-master:9200" -}}
240239
- name: ES_SERVER_URLS
241-
value: "{{ $scheme }}://elasticsearch-master:{{ $port }}"
240+
value: {{ $url | quote }}
241+
- name: ES_NODES
242+
value: {{ $url | quote }}
242243
- name: ES_USERNAME
243244
value: {{ $user | quote }}
244245
- name: ES_PASSWORD
245246
value: {{ $password | quote }}
246247
{{- /* Handle TLS insecurity */ -}}
247-
{{- if or ( and $es.tls ( $es.tls.insecure ) ) ( eq $scheme "https" ) }}
248-
{{- if $es.tls }}
249-
{{- if $es.tls.insecure }}
248+
{{- if and (($es).tls).enabled (($es).tls).insecure }}
250249
- name: ES_TLS_SKIP_HOST_VERIFY
251250
value: "true"
252-
{{- end }}
253-
{{- end }}
254251
{{- end }}
255252
{{- end }}
256253
{{- end -}}

0 commit comments

Comments
 (0)