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 #609

Closed
Closed
Show file tree
Hide file tree
Changes from 6 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
11 changes: 10 additions & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on: pull_request
jobs:
lint-test:
runs-on: ubuntu-latest
strategy:
matrix:
version: [v1, v2] # Define the matrix with v1 and v2 versions

steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -69,4 +73,9 @@ jobs:
cmctl check api --wait=5m

- name: Run chart-testing (install)
run: ct install --config ct.yaml
run: |
if [ "${{ matrix.version }}" == "v1" ]; then
ct install --config ct.yaml
elif [ "${{ matrix.version }}" == "v2" ]; then
ct install --config ct.yaml --helm-extra-set-args "--set v2.enabled=true --set provisionDataStore.cassandra=false --set storage.type=memory --set allInOne.enabled=true --set agent.enabled=false --set collector.enabled=false --set query.enabled=false"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that the chart can have a breaking version and from this PR one we can support only V2. You shouldn't try to support both of them in the same code branch. V1 can be in a separate branch we can only update it in case of critical bugs or security issues but it will not be maintained in the long run. People should at some point switch to V2.

Copy link
Member

Choose a reason for hiding this comment

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

@pavelnikolov can you please propose a more concrete plan as far as organizing the repo? How will helm know about different branches?

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
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a major chart version as per the above comment, IMHO.

# CronJobs require v1.21
kubeVersion: ">= 1.21-0"
keywords:
Expand Down
106 changes: 106 additions & 0 deletions charts/jaeger/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,20 @@ Create pull secrets for all in one image
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.allInOne.image) "context" $) -}}
{{- end }}

{{/*
Create image name for v2 image
*/}}
{{- define "v2.image" -}}
Copy link
Contributor

Choose a reason for hiding this comment

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

again, there shouldn't be any v2 prefixes. There should be only major chart version bump.

{{- include "renderImage" ( dict "imageRoot" .Values.v2.image "context" $ ) -}}
{{- end -}}

{{/*
Create pull secrets for all in one image
*/}}
{{- define "v2.imagePullSecrets" -}}
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.v2.image) "context" $) -}}
{{- end }}

{{/*
Create image name for schema image
*/}}
Expand Down Expand Up @@ -719,3 +733,95 @@ Create pull secrets for hotrod image
{{- define "hotrod.imagePullSecrets" -}}
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.hotrod.image) "context" $) -}}
{{- end }}



{{- define "jaeger-v2.name" -}}
Copy link
Member

Choose a reason for hiding this comment

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

Why any of these changes below necessary? Doesn't the chart already have them all for v1? Can we not reuse the same variables?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes that is what i planed to do once i was sure that i was going in the right direction with v-2 deployment and config part

{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "jaeger-v2.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "jaeger-v2.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "jaeger-v2.labels" -}}
helm.sh/chart: {{ include "jaeger-v2.chart" . }}
{{ include "jaeger-v2.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "jaeger-v2.selectorLabels" -}}
app.kubernetes.io/name: {{ include "jaeger-v2.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "jaeger-v2.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "jaeger-v2.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "jaeger-v2.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}

{{- define "jaeger-v2.extensionsConfig" -}}
{{ toYaml .Values.extensions | nindent 6 }}
{{- end }}

{{- define "jaeger-v2.receiversConfig" -}}
{{ toYaml .Values.receivers | nindent 6 }}
{{- end }}

{{- define "jaeger-v2.processorsConfig" -}}
{{ toYaml .Values.processors | nindent 6 }}
{{- end }}

{{- define "jaeger-v2.exportersConfig" -}}
{{ toYaml .Values.exporters | nindent 6 }}
{{- end }}

{{- define "jaeger-v2.podLabels" -}}
{{- if .Values.podLabels }}
{{- tpl (.Values.podLabels | toYaml) . }}
{{- end }}
{{- end }}
27 changes: 27 additions & 0 deletions charts/jaeger/templates/allinone-configmap-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.v2.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: jaeger-v2-configmap
namespace: {{ include "jaeger-v2.namespace" . }}
labels:
{{- include "jaeger-v2.labels" . | nindent 4 }}
data:
config.yaml: |
service:
extensions: [{{ join ", " .Values.service.extensions }}]
pipelines:
traces:
receivers: [{{ join ", " .Values.service.pipelines.traces.receivers }}]
processors: [{{ join ", " .Values.service.pipelines.traces.processors }}]
exporters: [{{ join ", " .Values.service.pipelines.traces.exporters }}]

extensions:
{{- include "jaeger-v2.extensionsConfig" . | nindent 6 }}
Copy link
Member

Choose a reason for hiding this comment

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

I recommend not using templates here - all they do is resolve to a single line, it's better for readability to just inline that line here.

receivers:
{{- include "jaeger-v2.receiversConfig" . | nindent 6 }}
processors:
{{- include "jaeger-v2.processorsConfig" . | nindent 6 }}
exporters:
{{- include "jaeger-v2.exportersConfig" . | nindent 6 }}
{{- end }}
32 changes: 30 additions & 2 deletions charts/jaeger/templates/allinone-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,22 @@ spec:
{{- end }}
securityContext:
{{- toYaml .Values.allInOne.securityContext | nindent 12 }}
{{- if .Values.v2.enabled }}
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
image: {{ include "v2.image" . }}
{{- else }}
image: {{ include "allInOne.image" . }}
{{- end }}
imagePullPolicy: {{ .Values.allInOne.image.pullPolicy }}
name: jaeger
args:
{{- if .Values.v2.enabled }}
- "--config"
- "/etc/jaeger/config.yaml"
{{- else }}
{{- range $arg := .Values.allInOne.args }}
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
- "{{ tpl $arg $ }}"
{{- end }}
{{- end }}
ports:
- containerPort: 5775
protocol: UDP
Expand All @@ -83,19 +92,29 @@ spec:
livenessProbe:
failureThreshold: 5
httpGet:
scheme: HTTP
{{- if .Values.v2.enabled }}
path: /status
port: 13133
{{- else }}
path: /
port: 14269
scheme: HTTP
{{- end }}
initialDelaySeconds: 5
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
failureThreshold: 3
httpGet:
scheme: HTTP
{{- if .Values.v2.enabled }}
path: /status
port: 13133
{{- else }}
path: /
port: 14269
scheme: HTTP
{{- end }}
initialDelaySeconds: 1
periodSeconds: 10
successThreshold: 1
Expand All @@ -105,6 +124,10 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
{{- if .Values.v2.enabled }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we should assume that v2 is always enabled and the only one we support from now on in the main branch. Then there can be v1 branch respectively.

- name: jaeger-v2-config
mountPath: /etc/jaeger
{{- end }}
{{- if not .Values.storage.badger.ephemeral }}
- name: badger-data
mountPath: {{ .Values.storage.badger.persistence.mountPath }}
Expand All @@ -123,6 +146,11 @@ spec:
{{- toYaml .Values.allInOne.podSecurityContext | nindent 8 }}
serviceAccountName: {{ template "jaeger.fullname" . }}
volumes:
{{- if .Values.v2.enabled }}
- name: jaeger-v2-config
configMap:
name: jaeger-v2-configmap
{{- end }}
{{- if not .Values.storage.badger.ephemeral }}
- name: badger-data
persistentVolumeClaim:
Expand Down
60 changes: 60 additions & 0 deletions charts/jaeger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,66 @@
# This is a YAML-formatted file.
# Jaeger values are grouped by component. Cassandra values override subchart values

v2:
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not try to make this branch support both v1 and v2. We already have a chart which support v1, let's focus 100% on v2 from now on.

enabled: false
image:
registry: ""
repository: jaegertracing/jaeger
tag: "2.0.0-rc2"
digest: ""
pullPolicy: IfNotPresent
pullSecrets: []
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

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

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

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# The following settings apply to Jaeger v1 and partially to Jaeger v2

global:
imageRegistry:

Expand Down
10 changes: 10 additions & 0 deletions ct-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See https://github.com/helm/chart-testing#configuration
remote: origin
chart-dirs:
- charts
chart-repos:
- incubator=https://charts.helm.sh/incubator
- elastic=https://helm.elastic.co
- bitnami=https://charts.bitnami.com/bitnami
helm-extra-args: --timeout=600s --debug
target-branch: main
Loading