Skip to content

Commit 05e6fa3

Browse files
hellspawn679mehul
andauthored
[jaeger] Fix hostname for Elasticsearch service and add CI test (#616)
* Fix hostname for Elasticsearch and add CI test Signed-off-by: mehul <[email protected]> * fixed the ci Signed-off-by: mehul <[email protected]> * fixed es Signed-off-by: mehul <[email protected]> --------- Signed-off-by: mehul <[email protected]> Co-authored-by: mehul <[email protected]>
1 parent 1db9b63 commit 05e6fa3

File tree

5 files changed

+77
-6
lines changed

5 files changed

+77
-6
lines changed

.github/workflows/lint-test.yaml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,43 @@ jobs:
4747

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

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

charts/jaeger/Chart.yaml

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

charts/jaeger/templates/_helpers.tpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
268268
*/}}
269269
{{- define "elasticsearch.client.url" -}}
270270
{{- $port := .Values.storage.elasticsearch.port | toString -}}
271-
{{- printf "%s://%s:%s" .Values.storage.elasticsearch.scheme .Values.storage.elasticsearch.host $port }}
271+
{{- $host := .Values.storage.elasticsearch.host }}
272+
{{- if .Values.provisionDataStore.elasticsearch }}
273+
{{- $host = printf "%s-elasticsearch" .Release.Name }}
274+
{{- end }}
275+
{{- printf "%s://%s:%s" .Values.storage.elasticsearch.scheme $host $port }}
272276
{{- end -}}
273277

274278
{{- define "jaeger.hotrod.tracing.host" -}}

charts/jaeger/templates/collector-deploy.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ spec:
3232
{{- toYaml .Values.collector.podLabels | nindent 8 }}
3333
{{- end }}
3434
spec:
35+
{{- if .Values.provisionDataStore.elasticsearch }}
36+
initContainers:
37+
- name: elasticsearch-checker
38+
image: curlimages/curl
39+
command:
40+
- sh
41+
- "-c"
42+
- |
43+
url="{{ include "elasticsearch.client.url" . }}"
44+
until [ "$(curl -s -o /dev/null -w '%{http_code}' "$url/_cluster/health")" = "200" ]; do
45+
echo "Waiting for Elasticsearch at $url"
46+
sleep 5
47+
done
48+
{{- end}}
3549
{{- with .Values.collector.priorityClassName }}
3650
priorityClassName: {{ . }}
3751
{{- end }}

charts/jaeger/templates/query-deploy.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,25 @@ spec:
4444
{{- toYaml .Values.query.podSecurityContext | nindent 8 }}
4545
serviceAccountName: {{ template "jaeger.query.serviceAccountName" . }}
4646
{{- include "query.imagePullSecrets" . | nindent 6 }}
47-
{{- if .Values.query.initContainers }}
47+
{{- if or .Values.query.initContainers .Values.provisionDataStore.elasticsearch }}
4848
initContainers:
49-
{{- toYaml .Values.query.initContainers | nindent 8 }}
50-
{{- end}}
49+
{{- if .Values.query.initContainers }}
50+
{{- toYaml .Values.query.initContainers | nindent 8 }}
51+
{{- end }}
52+
{{- if .Values.provisionDataStore.elasticsearch }}
53+
- name: elasticsearch-checker
54+
image: curlimages/curl
55+
command:
56+
- sh
57+
- "-c"
58+
- |
59+
url="{{ include "elasticsearch.client.url" . }}"
60+
until [ "$(curl -s -o /dev/null -w '%{http_code}' "$url/_cluster/health")" = "200" ]; do
61+
echo "waiting for Elasticsearch at $url"
62+
sleep 5
63+
done
64+
{{- end }}
65+
{{- end }}
5166
containers:
5267
- name: {{ template "jaeger.query.name" . }}
5368
securityContext:

0 commit comments

Comments
 (0)