Skip to content

Commit

Permalink
v2-elasticsearch
Browse files Browse the repository at this point in the history
Signed-off-by: mehul <mehulsharma4786@gmail.com>
  • Loading branch information
hellspawn679 committed Nov 8, 2024
1 parent 7a24558 commit 5c0e7ba
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 12 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,32 @@ jobs:
- name: Run chart-testing (install)
run: |
ct install --config ct.yaml \
--helm-extra-set-args "
--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 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"
2 changes: 2 additions & 0 deletions charts/jaeger/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ description: A Jaeger Helm chart for Kubernetes
name: jaeger
type: application
version: 4.0.0
annotations:
Jaegerv1Version: "1.53.0"
# CronJobs require v1.21
kubeVersion: ">= 1.21-0"
keywords:
Expand Down
3 changes: 2 additions & 1 deletion charts/jaeger/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@ Create pull secrets for ingester image
Create image name for agent image
*/}}
{{- define "agent.image" -}}
{{- include "renderImage" ( dict "imageRoot" .Values.agent.image "context" $ ) -}}
{{- $image := merge .Values.agent.image (dict "tag" .Chart.Annotations.Jaegerv1Version) -}}
{{- include "renderImage" ( dict "imageRoot" $image "context" $ ) -}}
{{- end -}}

{{/*
Expand Down
16 changes: 13 additions & 3 deletions charts/jaeger/templates/collector-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec:
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"
echo "$(curl -s "$url/_cluster/health")"
sleep 5
done
{{- end}}
Expand All @@ -64,6 +65,8 @@ spec:
image: {{ include "collector.image" . }}
imagePullPolicy: {{ .Values.collector.image.pullPolicy }}
args:
- "--config"
- "/etc/jaeger/user-config.yaml"
{{ include "extra.cmdArgs" ( dict "cmdlineParams" .Values.collector.cmdlineParams ) | nindent 10 }}
{{- if not .Values.ingester.enabled -}}
{{- include "storage.cmdArgs" . | nindent 10 }}
Expand Down Expand Up @@ -123,7 +126,7 @@ spec:
- containerPort: {{ .Values.collector.service.http.port }}
name: http
protocol: TCP
- containerPort: 14269
- containerPort: 13133
name: admin
protocol: TCP
{{- if .Values.collector.service.zipkin }}
Expand All @@ -141,15 +144,19 @@ spec:
{{- end }}
readinessProbe:
httpGet:
path: /
path: /status
port: admin
scheme: HTTP
livenessProbe:
httpGet:
path: /
path: /status
port: admin
scheme: HTTP
resources:
{{- toYaml .Values.collector.resources | nindent 10 }}
volumeMounts:
- name: user-config
mountPath: /etc/jaeger
{{- range .Values.collector.extraConfigmapMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
Expand Down Expand Up @@ -189,6 +196,9 @@ spec:
dnsPolicy: {{ .Values.collector.dnsPolicy }}
restartPolicy: Always
volumes:
- name: user-config
configMap:
name: user-config
{{- range .Values.collector.extraConfigmapMounts }}
- name: {{ .name }}
configMap:
Expand Down
2 changes: 1 addition & 1 deletion charts/jaeger/templates/collector-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
targetPort: {{ .Values.collector.service.otlp.http.name }}
{{- end }}
- name: {{ .Values.collector.service.admin.name }}
port: 14269
port: 13133
targetPort: {{ .Values.collector.service.admin.targetPort }}
selector:
{{- include "jaeger.selectorLabels" . | nindent 4 }}
Expand Down
62 changes: 62 additions & 0 deletions charts/jaeger/templates/es-user-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{ if (and (not .Values.userconfig) .Values.provisionDataStore.elasticsearch) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: user-config
namespace: {{ include "jaeger.namespace" . }}
labels:
{{- include "jaeger.labels" . | nindent 4 }}
data:
user-config.yaml: |
service:
extensions: [jaeger_storage, jaeger_query, healthcheckv2]
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [jaeger_storage_exporter]
extensions:
healthcheckv2:
use_v2: true
http:
endpoint: 0.0.0.0:13133
jaeger_query:
storage:
traces: some_storage
traces_archive: another_storage
jaeger_storage:
backends:
some_storage:
elasticsearch:
index_prefix: {{- .Values.storage.elasticsearch.index_prefix | quote | indent 2 }}
server_urls: ["{{ include "elasticsearch.client.url" . }}"]
username: {{- .Values.storage.elasticsearch.user | quote | indent 2 }}
{{- if .Values.storage.elasticsearch.password }}
password: {{- .Values.storage.elasticsearch.password | quote | indent 2 }}
{{- end }}
another_storage:
elasticsearch:
index_prefix: {{- .Values.storage.elasticsearch.index_prefix_archive | quote | indent 2 }}
server_urls: ["{{ include "elasticsearch.client.url" . }}"]
username: {{- .Values.storage.elasticsearch.user | quote | indent 2 }}
{{- if .Values.storage.elasticsearch.password }}
password: {{- .Values.storage.elasticsearch.password | quote | indent 2 }}
{{- end }}
receivers:
otlp:
protocols:
grpc:
http:
processors:
batch:
exporters:
jaeger_storage_exporter:
trace_storage: some_storage
{{- end }}
15 changes: 12 additions & 3 deletions charts/jaeger/templates/query-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ spec:
image: {{ include "query.image" . }}
imagePullPolicy: {{ .Values.query.image.pullPolicy }}
args:
- "--config"
- "/etc/jaeger/user-config.yaml"
{{ include "extra.cmdArgs" ( dict "cmdlineParams" .Values.query.cmdlineParams ) | nindent 10 }}
{{- include "storage.cmdArgs" . | nindent 10 }}
env:
Expand Down Expand Up @@ -100,11 +102,13 @@ spec:
containerPort: 16685
protocol: TCP
- name: admin
containerPort: 16687
containerPort: 13133
protocol: TCP
resources:
{{- toYaml .Values.query.resources | nindent 10 }}
volumeMounts:
- name: user-config
mountPath: /etc/jaeger
{{- range .Values.query.extraSecretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
Expand Down Expand Up @@ -143,12 +147,14 @@ spec:
{{- end }}
livenessProbe:
httpGet:
path: /
path: /status
port: admin
scheme: HTTP
readinessProbe:
httpGet:
path: /
path: /status
port: admin
scheme: HTTP
{{- if .Values.query.oAuthSidecar.enabled }}
- name: {{ template "jaeger.agent.name" . }}-oauth2-sidecar
securityContext:
Expand Down Expand Up @@ -247,6 +253,9 @@ spec:
dnsPolicy: {{ .Values.query.dnsPolicy }}
restartPolicy: Always
volumes:
- name: user-config
configMap:
name: user-config
{{- range .Values.query.extraConfigmapMounts }}
- name: {{ .name }}
configMap:
Expand Down
2 changes: 1 addition & 1 deletion charts/jaeger/templates/query-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
protocol: TCP
targetPort: grpc
- name: {{ .Values.query.service.admin.name }}
port: 16687
port: 13133
protocol: TCP
targetPort: {{ .Values.query.service.admin.targetPort }}
selector:
Expand Down
6 changes: 4 additions & 2 deletions charts/jaeger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ storage:
user: elastic
usePassword: true
password: changeme
index_prefix: jaeger-main
index_prefix_archive: jaeger-archive
# indexPrefix: test
## Use existing secret (ignores previous password)
# existingSecret:
Expand Down Expand Up @@ -516,7 +518,7 @@ collector:
annotations: {}
image:
registry: ""
repository: jaegertracing/jaeger-collector
repository: jaegertracing/jaeger
tag: ""
digest: ""
pullPolicy: IfNotPresent
Expand Down Expand Up @@ -732,7 +734,7 @@ query:
annotations: {}
image:
registry: ""
repository: jaegertracing/jaeger-query
repository: jaegertracing/jaeger
tag: ""
digest: ""
pullPolicy: IfNotPresent
Expand Down
45 changes: 45 additions & 0 deletions user-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
service:
extensions: [jaeger_storage, jaeger_query, healthcheckv2]
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [jaeger_storage_exporter]

extensions:
healthcheckv2:
use_v2: true
http:
endpoint: 0.0.0.0:13133

jaeger_query:
storage:
traces: some_storage
traces_archive: another_storage


jaeger_storage:
backends:
some_storage:
elasticsearch:
index_prefix: "jaeger-main"
server_urls: ["http://es-elasticsearch:9200"]

another_storage:
elasticsearch:
index_prefix: "jaeger-archive"
server_urls: ["http://es-elasticsearch:9200"]
username: {{- .Values.storage.elasticsearch.username | quote }}

receivers:
otlp:
protocols:
grpc:
http:

processors:
batch:

exporters:
jaeger_storage_exporter:
trace_storage: some_storage

0 comments on commit 5c0e7ba

Please sign in to comment.