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-v2] Add support for Elasticsearch #617

Merged
merged 33 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
22c8ade
Jaeger allInOne allow different storage types (#603)
rgaduput Sep 20, 2024
7212b86
Merge branch 'main' into jaeger-v2-with-v1
hellspawn679 Oct 20, 2024
9e73b35
minor changes
Oct 22, 2024
0dd3924
Merge branch 'jaeger-v2-with-v1' of https://github.com/hellspawn679/h…
Oct 22, 2024
f7db758
added image changes
Oct 22, 2024
b980560
fix lint
Oct 22, 2024
d9aa942
removed v1 allInOne and added jaeger-v2
Oct 26, 2024
01d341b
removed v2 references
Oct 28, 2024
ee12ee4
added allInOne again
Oct 29, 2024
3012649
minor fix
Oct 29, 2024
1ea257d
fixed how the config is being passed
Oct 30, 2024
42c30a0
fixed mirror template change
Oct 30, 2024
f247a95
use --set-file for user config
Nov 1, 2024
647f7fa
removed config-test and updated configmap template
Nov 2, 2024
8069914
fixed
Nov 2, 2024
742febb
Merge branch 'v2' into jaeger-v2-with-v1
hellspawn679 Nov 2, 2024
b6bbc4b
fixed minor naming
hellspawn679 Nov 3, 2024
7a24558
indentation
yurishkuro Nov 3, 2024
5c0e7ba
v2-elasticsearch
hellspawn679 Nov 8, 2024
69455e7
fix ci
hellspawn679 Nov 8, 2024
44c7298
fix ci
hellspawn679 Nov 8, 2024
bf68edc
Merge branch 'v2' into jaeger-v2-with-v1
hellspawn679 Nov 8, 2024
6fdf55a
fixed
hellspawn679 Nov 11, 2024
c3a7493
Merge branch 'jaeger-v2-with-v1' of https://github.com/hellspawn679/h…
hellspawn679 Nov 11, 2024
912de03
fixed and added docs
hellspawn679 Nov 12, 2024
d82e1cb
fixed
hellspawn679 Nov 18, 2024
e70863b
added port
hellspawn679 Nov 18, 2024
b2a3977
fixed
hellspawn679 Nov 18, 2024
7eabf48
fixed
hellspawn679 Nov 19, 2024
0ad61d2
fixed typo
hellspawn679 Nov 19, 2024
c07f325
fixed
hellspawn679 Nov 19, 2024
8700626
removed test config
hellspawn679 Nov 19, 2024
37eb6ec
updated docs
hellspawn679 Nov 19, 2024
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
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 \
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
--set storage.type=memory \
--set allInOne.enabled=true \
--set agent.enabled=false \
--set collector.enabled=false \
--set query.enabled=false "
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
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 \
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
--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.62.0"
Copy link
Member

Choose a reason for hiding this comment

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

Can you elaborate why this variable is defined in annotations instead of values.yaml? What is the significance of having it here?

# CronJobs require v1.21
kubeVersion: ">= 1.21-0"
keywords:
Expand Down
109 changes: 109 additions & 0 deletions charts/jaeger/README-v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@

---

# Jaeger Helm-chart Documentation

## Overview
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.

---

### 1. Jaeger All-in-One Mode

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.

#### **Command to Run All-in-One**

```bash
helm install <chart_name> charts/jaeger \
--set provisionDataStore.cassandra=false \
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
--set storage.type=memory \
--set allInOne.enabled=true \
--set agent.enabled=false \
--set collector.enabled=false \
--set query.enabled=false \
--set-file userconfig=path/to/configfile.yaml # Optional: user-specific config
```

- **Flags Explained**:
- `provisionDataStore.cassandra=false`: Disable Cassandra provision.
- `storage.type=memory`: Use in-memory storage (non-persistent).
- `allInOne.enabled=true`: Enable the all-in-one Jaeger setup.
- `agent.enabled=false`, `collector.enabled=false`, `query.enabled=false`: Disable separate components since they’re embedded in all-in-one.
- `userconfig`: Optional file for additional configuration.


---

### 2. Elasticsearch Mode with Provisioned Data Store

This mode configures Jaeger to store trace data in an Elasticsearch backend, suitable for production-level usage.

#### **Command to Run with Elasticsearch**

1. **Single Master Node Configuration**
For a basic setup with only one Elasticsearch master node, use this command:

```bash
helm install <chart_name> charts/jaeger \
--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 \
--set-file userconfig=path/to/configfile.yaml # Optional: user-specific config
```

2. **Default Configuration**
For a more straightforward setup with default Elasticsearch configuration, use:

```bash
helm install <chart_name> charts/jaeger \
--set provisionDataStore.cassandra=false \
--set provisionDataStore.elasticsearch=true \
--set storage.type=elasticsearch \
--set-file userconfig=path/to/configfile.yaml # Optional: user-specific config
```

- **Flags Explained**:
- `provisionDataStore.cassandra=false`: Disable Cassandra provision.
- `provisionDataStore.elasticsearch=true`: Enable Elasticsearch as the storage.
- `storage.type=elasticsearch`: Use Elasticsearch for storage.
- **Single Master Node Settings** (optional for simplified configuration):
- `elasticsearch.master.masterOnly=false`
- `elasticsearch.master.replicaCount=1`
- `elasticsearch.data.replicaCount=0`
- `elasticsearch.coordinating.replicaCount=0`
- `elasticsearch.ingest.replicaCount=0`
- `userconfig`: Optional file for additional configuration.

---


### 3. Additional `--set` Configuration Options

For custom configurations, the following flags are commonly used. These cover primary Elasticsearch storage settings and additional archive configurations.

#### **Primary Storage Settings**
- `.Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.index_prefix`: Set the prefix for Elasticsearch indices.
- `.Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.host`: Specify the Elasticsearch host.
- `.Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.user`: Username for Elasticsearch authentication.
- `.Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.password`: Password for Elasticsearch authentication.

Here’s the updated documentation with the archive storage settings referenced and with similar flags specified for archive configurations.


#### **Archive Storage Settings**
- Similar flags for archive configurations can be used to manage archived trace data.

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:

- `.Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.index_prefix`
- `.Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.server_urls`
- `.Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.username`
- `.Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.password`

---
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
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
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
6 changes: 3 additions & 3 deletions charts/jaeger/templates/collector-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ spec:
protocol: TCP
targetPort: {{ .Values.collector.service.otlp.http.name }}
{{- end }}
- name: {{ .Values.collector.service.admin.name }}
port: 14269
targetPort: {{ .Values.collector.service.admin.targetPort }}
- name: {{ .Values.collector.service.healthCheck.name }}
port: 13133
targetPort: {{ .Values.collector.service.healthCheck.targetPort }}
selector:
{{- include "jaeger.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: collector
Expand Down
62 changes: 62 additions & 0 deletions charts/jaeger/templates/es-configmap.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: primary_store
traces_archive: archive_store


jaeger_storage:
backends:
primary_store:
elasticsearch:
hellspawn679 marked this conversation as resolved.
Show resolved Hide resolved
index_prefix: {{- .Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.index_prefix | quote | indent 2 }}
server_urls: ["{{ include "elasticsearch.client.url" . }}"]
username: {{- .Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.user | quote | indent 2 }}
{{- if .Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.password }}
password: {{- .Values.config.extensions.jaeger_storage.backends.primary_store.elasticsearch.password | quote | indent 2 }}
{{- end }}
archive_store:
elasticsearch:
index_prefix: {{- .Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.index_prefix | quote | indent 2 }}
server_urls: ["{{ include "elasticsearch.client.url" . }}"]
username: {{- .Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.user | quote | indent 2 }}
{{- if .Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.password }}
password: {{- .Values.config.extensions.jaeger_storage.backends.archive_store.elasticsearch.password | quote | indent 2 }}
{{- end }}

receivers:
otlp:
protocols:
grpc:
http:
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved

processors:
batch:

exporters:
jaeger_storage_exporter:
trace_storage: primary_store
{{- 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 }}
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
port: 16687
port: 13133
protocol: TCP
targetPort: {{ .Values.query.service.admin.targetPort }}
selector:
Expand Down
Loading
Loading