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 7 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 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"
Copy link
Member

Choose a reason for hiding this comment

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

--set v2.enabled=true left over?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh i changes v2 to jaeger will fix it now

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: 3.3.2
Copy link
Member

Choose a reason for hiding this comment

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

maybe go to 4.x? It's not backwards compatible with chart-3.x which only works with jaeger-v1

# CronJobs require v1.21
kubeVersion: ">= 1.21-0"
keywords:
Expand Down
104 changes: 98 additions & 6 deletions charts/jaeger/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -559,17 +559,17 @@ If not tag is provided, it defaults to .Chart.AppVersion.
{{- end -}}

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

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

{{/*
Expand Down Expand Up @@ -719,3 +719,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.

we already discussed this - all these settings are already present in the chart without the v2 name, so please use the existing ones. I don't think there should be any properties / templates that have v2 in the name

{{- 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 }}
Copy link
Member

Choose a reason for hiding this comment

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

these can be inlined directly in the template, they provide no value


{{- define "jaeger-v2.podLabels" -}}
{{- if .Values.podLabels }}
{{- tpl (.Values.podLabels | toYaml) . }}
{{- end }}
{{- end }}
14 changes: 0 additions & 14 deletions charts/jaeger/templates/allinone-sa.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{{- if .Values.allInOne.enabled -}}
{{- if .Values.jaeger.storage.memory.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "jaeger.fullname" . }}
labels:
{{- include "jaeger.labels" . | nindent 4 }}
app.kubernetes.io/component: all-in-one
app.kubernetes.io/component: jaeger-v2
prometheus.io/port: "14269"
prometheus.io/scrape: "true"
spec:
{{- if hasKey .Values.allInOne "replicas" }}
replicas: {{ .Values.allInOne.replicas }}
{{- if hasKey .Values.jaeger "replicas" }}
replicas: {{ .Values.jaeger.replicas }}
{{- end }}
strategy:
type: Recreate
selector:
matchLabels:
{{- include "jaeger.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: all-in-one
app.kubernetes.io/component: jaeger-v2
template:
metadata:
labels:
{{- include "jaeger.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: all-in-one
{{- if .Values.allInOne.podLabels }}
{{- toYaml .Values.allInOne.podLabels | nindent 8 }}
app.kubernetes.io/component: jaeger-v2
{{- if .Values.jaeger.podLabels }}
{{- toYaml .Values.jaeger.podLabels | nindent 8 }}
{{- end }}
annotations:
prometheus.io/port: "14269"
prometheus.io/scrape: "true"
spec:
{{- include "allInOne.imagePullSecrets" . | nindent 6 }}
{{- include "jaeger.imagePullSecrets" . | nindent 6 }}
containers:
- env:
{{- if .Values.allInOne.extraEnv }}
{{- toYaml .Values.allInOne.extraEnv | nindent 12 }}
{{- if .Values.jaeger.extraEnv }}
{{- toYaml .Values.jaeger.extraEnv | nindent 12 }}
{{- end }}
- name: SPAN_STORAGE_TYPE
value: {{ .Values.storage.type }}
Expand All @@ -45,22 +45,21 @@ spec:
value: "false"
- name: COLLECTOR_OTLP_ENABLED
value: "true"
{{- if .Values.allInOne.samplingConfig }}
{{- if .Values.jaeger.samplingConfig }}
- name: SAMPLING_STRATEGIES_FILE
value: /etc/conf/strategies.json
{{- end }}
{{- with .Values.allInOne.envFrom }}
{{- with .Values.jaeger.envFrom }}
envFrom: {{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.allInOne.securityContext | nindent 12 }}
image: {{ include "allInOne.image" . }}
imagePullPolicy: {{ .Values.allInOne.image.pullPolicy }}
{{- toYaml .Values.jaeger.securityContext | nindent 12 }}
image: {{ include "jaeger.image" . }}
imagePullPolicy: {{ .Values.jaeger.image.pullPolicy }}
name: jaeger
args:
{{- range $arg := .Values.allInOne.args }}
- "{{ tpl $arg $ }}"
{{- end }}
- "--config"
- "/etc/jaeger/config.yaml"
ports:
- containerPort: 5775
protocol: UDP
Expand All @@ -83,74 +82,79 @@ spec:
livenessProbe:
failureThreshold: 5
httpGet:
path: /
port: 14269
scheme: HTTP
path: /status
port: 13133
initialDelaySeconds: 5
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 14269
scheme: HTTP
path: /status
port: 13133
initialDelaySeconds: 1
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
{{- with .Values.allInOne.resources }}
{{- with .Values.jaeger.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: jaeger-v2-config
mountPath: /etc/jaeger
{{- if not .Values.storage.badger.ephemeral }}
- name: badger-data
mountPath: {{ .Values.storage.badger.persistence.mountPath }}
{{- end }}
{{- if .Values.allInOne.samplingConfig}}
{{- if .Values.jaeger.samplingConfig}}
- name: strategies
mountPath: /etc/conf/
{{- end }}
{{- range .Values.allInOne.extraSecretMounts }}
{{- range .Values.jaeger.extraSecretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
securityContext:
{{- toYaml .Values.allInOne.podSecurityContext | nindent 8 }}
{{- toYaml .Values.jaeger.podSecurityContext | nindent 8 }}
serviceAccountName: {{ template "jaeger.fullname" . }}
volumes:
- name: jaeger-v2-config
configMap:
name: jaeger-v2-configmap
{{- if not .Values.storage.badger.ephemeral }}
- name: badger-data
persistentVolumeClaim:
claimName: {{ .Values.storage.badger.persistence.useExistingPvcName | required "Using badger persistence it is required to set an existing PVC" }}
{{- end }}
{{- if .Values.allInOne.samplingConfig}}
{{- if .Values.jaeger.samplingConfig}}
- name: strategies
configMap:
name: {{ include "jaeger.fullname" . }}-sampling-strategies
{{- end }}
{{- range .Values.allInOne.extraSecretMounts }}
{{- range .Values.jaeger.extraSecretMounts }}
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
{{- end }}
{{- with .Values.allInOne.affinity }}
{{- with .Values.jaeger.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.allInOne.topologySpreadConstraints }}
{{- with .Values.jaeger.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.allInOne.nodeSelector }}
{{- with .Values.jaeger.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.allInOne.tolerations }}
{{- with .Values.jaeger.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.allInOne.enabled -}}
{{- if .Values.jaeger.storage.memory.enabled -}}
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -26,5 +26,5 @@ spec:
targetPort: 0
selector:
{{- include "jaeger.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: all-in-one
app.kubernetes.io/component: jaeger-v2
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.allInOne.enabled -}}
{{- if .Values.jaeger.storage.memory.enabled -}}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -7,7 +7,7 @@ metadata:
{{- include "jaeger.labels" . | nindent 4 }}
app.kubernetes.io/component: service-collector
spec:
clusterIP: {{ .Values.allInOne.service.headless | ternary "None" "null" }}
clusterIP: {{ .Values.jaeger.service.headless | ternary "None" "null" }}
ports:
- name: http-zipkin
port: 9411
Expand All @@ -30,19 +30,19 @@ spec:
{{- if semverCompare ">=1.20" .Capabilities.KubeVersion.Version }}
appProtocol: http
{{- end }}
- name: {{ .Values.allInOne.service.collector.otlp.grpc.name }}
- name: {{ .Values.jaeger.service.collector.otlp.grpc.name }}
port: 4317
targetPort: 0
{{- if semverCompare ">=1.20" .Capabilities.KubeVersion.Version }}
appProtocol: grpc
{{- end }}
- name: {{ .Values.allInOne.service.collector.otlp.http.name }}
- name: {{ .Values.jaeger.service.collector.otlp.http.name }}
port: 4318
targetPort: 0
{{- if semverCompare ">=1.20" .Capabilities.KubeVersion.Version }}
appProtocol: http
{{- end }}
selector:
{{- include "jaeger.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: all-in-one
app.kubernetes.io/component: jaeger-v2
{{- end -}}
Loading
Loading