Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jaeger] Fix hostname for Elasticsearch service and add CI test #616

Merged
merged 3 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,43 @@ jobs:

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

- name: Run chart-testing (install)
- name: Run cassandra-chart-testing (install)
run: ct install --config ct.yaml
test-with-allInOne:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

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

- name: Run allInOne-chart-testing (install)
run: |
ct install --config ct.yaml --helm-extra-set-args "
--set provisionDataStore.cassandra=false
--set storage.type=memory
--set allInOne.enabled=true
--set agent.enabled=false
--set collector.enabled=false
--set query.enabled=false"
test-with-elasticsearch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

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

- name: Run elasticsearch-chart-testing (install)
run: |
ct install --config ct.yaml --helm-extra-set-args "
--set provisionDataStore.cassandra=false
--set provisionDataStore.elasticsearch=true
--set storage.type=elasticsearch
--set elasticsearch.master.masterOnly=false
--set elasticsearch.master.replicaCount=1
--set elasticsearch.data.replicaCount=0
--set elasticsearch.coordinating.replicaCount=0
--set elasticsearch.ingest.replicaCount=0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) add empty line at the end

2 changes: 1 addition & 1 deletion charts/jaeger/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: 1.53.0
description: A Jaeger Helm chart for Kubernetes
name: jaeger
type: application
version: 3.3.1
version: 3.3.2
# CronJobs require v1.21
kubeVersion: ">= 1.21-0"
keywords:
Expand Down
6 changes: 5 additions & 1 deletion charts/jaeger/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
*/}}
{{- define "elasticsearch.client.url" -}}
{{- $port := .Values.storage.elasticsearch.port | toString -}}
{{- printf "%s://%s:%s" .Values.storage.elasticsearch.scheme .Values.storage.elasticsearch.host $port }}
{{- $host := .Values.storage.elasticsearch.host }}
{{- if .Values.provisionDataStore.elasticsearch }}
{{- $host = printf "%s-elasticsearch" .Release.Name }}
{{- end }}
{{- printf "%s://%s:%s" .Values.storage.elasticsearch.scheme $host $port }}
{{- end -}}

{{- define "jaeger.hotrod.tracing.host" -}}
Expand Down
14 changes: 14 additions & 0 deletions charts/jaeger/templates/collector-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ spec:
{{- toYaml .Values.collector.podLabels | nindent 8 }}
{{- end }}
spec:
{{- if .Values.provisionDataStore.elasticsearch }}
initContainers:
- name: elasticsearch-checker
image: curlimages/curl
command:
- sh
- "-c"
- |
url="{{ include "elasticsearch.client.url" . }}"
until [ "$(curl -s -o /dev/null -w '%{http_code}' "$url/_cluster/health")" = "200" ]; do
echo "Waiting for Elasticsearch at $url"
sleep 5
done
{{- end}}
{{- with .Values.collector.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
Expand Down
21 changes: 18 additions & 3 deletions charts/jaeger/templates/query-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,25 @@ spec:
{{- toYaml .Values.query.podSecurityContext | nindent 8 }}
serviceAccountName: {{ template "jaeger.query.serviceAccountName" . }}
{{- include "query.imagePullSecrets" . | nindent 6 }}
{{- if .Values.query.initContainers }}
{{- if or .Values.query.initContainers .Values.provisionDataStore.elasticsearch }}
initContainers:
{{- toYaml .Values.query.initContainers | nindent 8 }}
{{- end}}
{{- if .Values.query.initContainers }}
{{- toYaml .Values.query.initContainers | nindent 8 }}
{{- end }}
{{- if .Values.provisionDataStore.elasticsearch }}
- name: elasticsearch-checker
image: curlimages/curl
command:
- sh
- "-c"
- |
url="{{ include "elasticsearch.client.url" . }}"
until [ "$(curl -s -o /dev/null -w '%{http_code}' "$url/_cluster/health")" = "200" ]; do
echo "waiting for Elasticsearch at $url"
sleep 5
done
{{- end }}
{{- end }}
containers:
- name: {{ template "jaeger.query.name" . }}
securityContext:
Expand Down
Loading