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 with v1 #613

Merged
merged 18 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
3 changes: 2 additions & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ jobs:
cmctl check api --wait=5m

- name: Run chart-testing (install)
run: ct install --config ct.yaml
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"
Copy link
Member

Choose a reason for hiding this comment

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

this line is hard to read, please use the same formatting as in the deleted sections, one flag per line

4 changes: 2 additions & 2 deletions charts/jaeger/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v2
appVersion: 1.53.0
appVersion: 2.0.0-rc2
description: A Jaeger Helm chart for Kubernetes
name: jaeger
type: application
version: 3.3.1
version: 4.0.0
# CronJobs require v1.21
kubeVersion: ">= 1.21-0"
keywords:
Expand Down
79 changes: 77 additions & 2 deletions charts/jaeger/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,14 @@ If not tag is provided, it defaults to .Chart.AppVersion.
{{- end -}}

{{/*
Create image name for all in one image
Create image name for all-in-one image
*/}}
{{- define "allInOne.image" -}}
{{- include "renderImage" ( dict "imageRoot" .Values.allInOne.image "context" $ ) -}}
{{- end -}}

{{/*
Create pull secrets for all in one image
Create pull secrets for all-in-one image
*/}}
{{- define "allInOne.imagePullSecrets" -}}
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.allInOne.image) "context" $) -}}
Expand Down Expand Up @@ -719,3 +719,78 @@ Create pull secrets for hotrod image
{{- define "hotrod.imagePullSecrets" -}}
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.hotrod.image) "context" $) -}}
{{- end }}


{{- define "jaeger.extensionsConfig" -}}
{{- if .Values.extensions }}
{{ toYaml .Values.extensions | nindent 6 }}
{{- else }}
{{ toYaml .Values.config.extensions | nindent 6 }}
{{- end }}
{{- end }}

{{- define "jaeger.receiversConfig" -}}
{{- if .Values.receivers }}
{{ toYaml .Values.receivers | nindent 6 }}
{{- else }}
{{ toYaml .Values.config.receivers | nindent 6 }}
{{- end }}
{{- end }}

{{- define "jaeger.processorsConfig" -}}
{{- if .Values.processors }}
{{ toYaml .Values.processors | nindent 6 }}
{{- else }}
{{ toYaml .Values.config.processors | nindent 6 }}
{{- end }}
{{- end }}

{{- define "jaeger.exportersConfig" -}}
{{- if .Values.exporters }}
{{ toYaml .Values.exporters | nindent 6 }}
{{- else }}
{{ toYaml .Values.config.exporters | nindent 6 }}
{{- end }}
{{- end }}



{{- define "jaeger.serviceExtensions" -}}
{{- if and .Values.service .Values.service.extensions -}}
[{{ join ", " .Values.service.extensions }}]
{{- else -}}
[{{ join ", " .Values.config.service.extensions }}]
{{- end -}}
{{- end }}

{{- define "jaeger.serviceReceivers" -}}
{{- if and .Values.service .Values.service.pipelines .Values.service.pipelines.traces .Values.service.pipelines.traces.receivers -}}
[{{ join ", " .Values.service.pipelines.traces.receivers }}]
{{- else -}}
[{{ join ", " .Values.config.service.pipelines.traces.receivers }}]
{{- end -}}
{{- end }}

{{- define "jaeger.serviceProcessors" -}}
{{- if and .Values.service .Values.service.pipelines .Values.service.pipelines.traces .Values.service.pipelines.traces.processors -}}
[{{ join ", " .Values.service.pipelines.traces.processors }}]
{{- else -}}
[{{ join ", " .Values.config.service.pipelines.traces.processors }}]
{{- end -}}
{{- end }}

{{- define "jaeger.serviceExporters" -}}
{{- if and .Values.service .Values.service.pipelines .Values.service.pipelines.traces .Values.service.pipelines.traces.exporters -}}
[{{ join ", " .Values.service.pipelines.traces.exporters }}]
{{- else -}}
[{{ join ", " .Values.config.service.pipelines.traces.exporters }}]
{{- end -}}
{{- end }}

{{- define "jaeger.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}
12 changes: 12 additions & 0 deletions charts/jaeger/templates/allInOne-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ if .Values.userconfig }}
Copy link
Member

Choose a reason for hiding this comment

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

I think this file should be called user-config.yaml, it's not specific to all-in-one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i used that only in the start but I got this error
Error: INSTALLATION FAILED: parse error at (jaeger/templates/allInOne-config.yaml:1): bad character U+002D '-'
the problem is helm chart don't allow '-' there is workaround we can use
{{index .Values.user-config }}
but with if or any other condition statements it throw this error
Error: INSTALLATION FAILED: parse error at (jaeger/templates/allInOne-config.yaml:1): unexpected <if> in operand

Copy link
Member

Choose a reason for hiding this comment

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

I made this change to the template

diff --git a/charts/jaeger/templates/allInOne-config.yaml b/charts/jaeger/templates/allInOne-config.yaml
index eca21f2..e473618 100644
--- a/charts/jaeger/templates/allInOne-config.yaml
+++ b/charts/jaeger/templates/allInOne-config.yaml
@@ -8,5 +8,5 @@ metadata:
     {{- include "jaeger.labels" . | nindent 4 }}
 data:
   config.yaml: |
-        {{ .Values.userconfig | nindent 8 }}
+        {{- .Values.userconfig | nindent 4 }}
 {{- end }}

created mock config file

$ cat myconfig.yaml
hello:
  world: true

and ran a test

$ helm template --set-file userconfig=myconfig.yaml charts/jaeger > test-output.txt

which resulted in reasonably looking resource file:

# Source: jaeger/templates/allInOne-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: jaeger-configmap
  namespace: default
  labels:
    helm.sh/chart: jaeger-4.0.0
    app.kubernetes.io/name: jaeger
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/version: "2.0.0-rc2"
    app.kubernetes.io/managed-by: Helm
data:
  config.yaml: |
    hello:
      world: true

apiVersion: v1
kind: ConfigMap
metadata:
name: jaeger-configmap
namespace: {{ include "jaeger.namespace" . }}
labels:
{{- include "jaeger.labels" . | nindent 4 }}
data:
config.yaml: |
{{ .Values.userconfig | nindent 8 }}
{{- end }}
23 changes: 19 additions & 4 deletions charts/jaeger/templates/allinone-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ spec:
imagePullPolicy: {{ .Values.allInOne.image.pullPolicy }}
name: jaeger
args:
{{ if .Values.userconfig }}
- "--config"
- "/etc/jaeger/config.yaml"
{{- end }}
{{- range $arg := .Values.allInOne.args }}
- "{{ tpl $arg $ }}"
{{- end }}
Expand All @@ -80,11 +84,13 @@ spec:
protocol: TCP
- containerPort: 4318
protocol: TCP
- containerPort: 13133
protocol: TCP
livenessProbe:
failureThreshold: 5
httpGet:
path: /
port: 14269
path: /status
port: 13133
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 15
Expand All @@ -93,8 +99,8 @@ spec:
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 14269
path: /status
port: 13133
scheme: HTTP
initialDelaySeconds: 1
periodSeconds: 10
Expand All @@ -105,6 +111,10 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
{{ if .Values.userconfig }}
- name: jaeger-config
mountPath: /etc/jaeger
{{- end }}
{{- if not .Values.storage.badger.ephemeral }}
- name: badger-data
mountPath: {{ .Values.storage.badger.persistence.mountPath }}
Expand All @@ -123,6 +133,11 @@ spec:
{{- toYaml .Values.allInOne.podSecurityContext | nindent 8 }}
serviceAccountName: {{ template "jaeger.fullname" . }}
volumes:
{{ if .Values.userconfig }}
- name: jaeger-config
configMap:
name: jaeger-configmap
Copy link
Member

Choose a reason for hiding this comment

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

please clean-up all the naming. Not jaeger-config, not jaeger-configmap, not allInOne-config.yaml, not config.yaml - everything should be using a single name user-config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done should i convert it to PR

{{- end }}
{{- if not .Values.storage.badger.ephemeral }}
- name: badger-data
persistentVolumeClaim:
Expand Down
57 changes: 56 additions & 1 deletion charts/jaeger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,61 @@
# This is a YAML-formatted file.
# Jaeger values are grouped by component. Cassandra values override subchart values

# Will use for user provided config
userconfig:

config:
service:
extensions: [jaeger_storage, jaeger_query, healthcheckv2]
pipelines:
traces:
receivers: [otlp, jaeger, zipkin]
processors: [batch]
exporters: [jaeger_storage_exporter]

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

# pprof:
# endpoint: 0.0.0.0:1777
# zpages:
# endpoint: 0.0.0.0:55679

jaeger_query:
storage:
traces: primary_store
traces_archive: archive_store

jaeger_storage:
backends:
primary_store:
memory:
max_traces: 100000
archive_store:
memory:
max_traces: 100000

receivers:
otlp:
protocols:
grpc:
http:
jaeger:
protocols:
grpc:
zipkin:

processors:
batch:

exporters:
jaeger_storage_exporter:
trace_storage: primary_store
# The following settings apply to Jaeger v1 and partially to Jaeger v2

global:
imageRegistry:

Expand All @@ -24,7 +79,7 @@ allInOne:
replicas: 1
image:
registry: ""
repository: jaegertracing/all-in-one
repository: jaegertracing/jaeger
tag: ""
digest: ""
pullPolicy: IfNotPresent
Expand Down
44 changes: 44 additions & 0 deletions config-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
service:
extensions: [jaeger_storage, jaeger_query, healthcheckv2]
pipelines:
traces:
receivers: [otlp, jaeger, zipkin]
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:
memory:
max_traces: 100000
archive_store:
memory:
max_traces: 100000

receivers:
otlp:
protocols:
grpc:
http:
jaeger:
protocols:
grpc:
zipkin:

processors:
batch:

exporters:
jaeger_storage_exporter:
trace_storage: primary_store
Empty file added es.txt
Empty file.
Loading