From 22c8ade4fc78c0ab26288f939b2069fa1a482f02 Mon Sep 17 00:00:00 2001 From: Reddysekhar Gaduputi Date: Fri, 20 Sep 2024 10:19:51 +0530 Subject: [PATCH] Jaeger allInOne allow different storage types (#603) Signed-off-by: Reddysekhar Gaduputi upgrade jaeger-operator to latest 1.61.0 (#605) Signed-off-by: Blair Bowden added all-in-one deployment and configmap for jaeger-v2 Signed-off-by: Mehul lint fix Signed-off-by: Mehul fixed Signed-off-by: Mehul lint fix Signed-off-by: Mehul lint fix Signed-off-by: Mehul fixed using pre-hook Signed-off-by: Mehul fixed --config flag is not been passed Signed-off-by: mehul release ns for config-map.yaml Signed-off-by: mehul testing ci Signed-off-by: mehul testing ci Signed-off-by: mehul fixed ns Signed-off-by: mehul fixed ns Signed-off-by: mehul fixed template Signed-off-by: mehul removed sampling Signed-off-by: mehul removed adaptive sampling from processors Signed-off-by: mehul Revert "Jaeger v2 test2" Signed-off-by: mehul attempt to create v2 chart in v1 Signed-off-by: mehul enabled collector query and agent Signed-off-by: mehul version bump Signed-off-by: mehul testing-v2-ci Signed-off-by: mehul testing-v2-ci Signed-off-by: mehul added --helm-extra-set-args flag Signed-off-by: mehul fixed healthcheck port-v2 Signed-off-by: mehul Fix health check path Signed-off-by: Yuri Shkuro minor changes Signed-off-by: mehul --- .github/workflows/lint-test-v2.yaml | 72 +++++++++++++ charts/jaeger-operator/COMPATIBILITY.md | 1 + charts/jaeger-operator/Chart.yaml | 4 +- charts/jaeger-operator/README.md | 2 +- charts/jaeger-operator/values.yaml | 2 +- charts/jaeger/Chart.yaml | 2 +- charts/jaeger/templates/_helpers.tpl | 102 ++++++++++++++++-- .../templates/allinone-configmap-v2.yaml | 27 +++++ charts/jaeger/templates/allinone-deploy.yaml | 34 +++++- charts/jaeger/values.yaml | 56 ++++++++++ ct-v2.yaml | 10 ++ 11 files changed, 294 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/lint-test-v2.yaml create mode 100644 charts/jaeger/templates/allinone-configmap-v2.yaml create mode 100644 ct-v2.yaml diff --git a/.github/workflows/lint-test-v2.yaml b/.github/workflows/lint-test-v2.yaml new file mode 100644 index 00000000..e0692419 --- /dev/null +++ b/.github/workflows/lint-test-v2.yaml @@ -0,0 +1,72 @@ +name: Lint and Test Charts v2 + +on: pull_request + +jobs: + lint-test-v2: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v4 + with: + version: v3.14.4 + + # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and + # yamllint (https://github.com/adrienverge/yamllint) which require Python + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + with: + version: v3.10.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --config ct.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Run chart-testing (lint) + run: ct lint --config ct.yaml + + - name: Create kind cluster + uses: helm/kind-action@v1.9.0 + if: steps.list-changed.outputs.changed == 'true' + + - name: Install kubectl + uses: azure/setup-kubectl@v4.0.0 + with: + version: 'v1.28.8' + id: install + + - name: Set up cert-manager + run: | + kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml --namespace ingress-nginx + kubectl label node --all ingress-ready=true + kubectl describe pod --selector=app.kubernetes.io/component=controller -n ingress-nginx + kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=5m + kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml + + - name: Set up cmctl + run: | + curl -sSL -o cmctl.tar.gz https://github.com/cert-manager/cert-manager/releases/download/v1.6.1/cmctl-linux-amd64.tar.gz + tar xzf cmctl.tar.gz + sudo mv cmctl /usr/local/bin + cmctl version + + - name: Check if cert-manager is up + run: | + cmctl check api --wait=5m + + - name: Run chart-testing (install) + run: ct install --debug --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" --helm-extra-args "--debug" diff --git a/charts/jaeger-operator/COMPATIBILITY.md b/charts/jaeger-operator/COMPATIBILITY.md index 84a7d434..0e9bcedd 100644 --- a/charts/jaeger-operator/COMPATIBILITY.md +++ b/charts/jaeger-operator/COMPATIBILITY.md @@ -2,6 +2,7 @@ The following table shows the compatibility of `Jaeger Operator helm chart` with | Chart version | Jaeger Operator | Kubernetes | Strimzi Operator | Cert-Manager | |---------------------------|-----------------|-----------------|--------------------|--------------| +| 2.57.0 | v1.61.x | v1.19 to v1.29 | v0.32 | v1.6.1+ | | 2.54.0 | v1.57.x | v1.19 to v1.29 | v0.32 | v1.6.1+ | | 2.50.0 | v1.52.x | v1.19 to v1.28 | v0.32 | v1.6.1+ | | 2.49.0 | v1.49.x | v1.19 to v1.28 | v0.32 | v1.6.1+ | diff --git a/charts/jaeger-operator/Chart.yaml b/charts/jaeger-operator/Chart.yaml index 07c6d549..215b889c 100644 --- a/charts/jaeger-operator/Chart.yaml +++ b/charts/jaeger-operator/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: jaeger-operator Helm chart for Kubernetes name: jaeger-operator -version: 2.56.0 -appVersion: 1.57.0 +version: 2.57.0 +appVersion: 1.61.0 home: https://www.jaegertracing.io/ icon: https://www.jaegertracing.io/img/jaeger-icon-reverse-color.svg sources: diff --git a/charts/jaeger-operator/README.md b/charts/jaeger-operator/README.md index ed3b98aa..b6883412 100644 --- a/charts/jaeger-operator/README.md +++ b/charts/jaeger-operator/README.md @@ -59,7 +59,7 @@ The following table lists the configurable parameters of the jaeger-operator cha | `serviceExtraLabels` | Additional labels to jaeger-operator service | `{}` | | `extraLabels` | Additional labels to jaeger-operator deployment | `{}` | | `image.repository` | Controller container image repository | `jaegertracing/jaeger-operator` | -| `image.tag` | Controller container image tag | `1.57.0` | +| `image.tag` | Controller container image tag | `1.61.0` | | `image.pullPolicy` | Controller container image pull policy | `IfNotPresent` | | `jaeger.create` | Jaeger instance will be created | `false` | | `jaeger.spec` | Jaeger instance specification | `{}` | diff --git a/charts/jaeger-operator/values.yaml b/charts/jaeger-operator/values.yaml index 587c6f97..ce72640a 100644 --- a/charts/jaeger-operator/values.yaml +++ b/charts/jaeger-operator/values.yaml @@ -4,7 +4,7 @@ image: repository: jaegertracing/jaeger-operator - tag: 1.57.0 + tag: 1.61.0 pullPolicy: IfNotPresent imagePullSecrets: [] diff --git a/charts/jaeger/Chart.yaml b/charts/jaeger/Chart.yaml index 33530522..be86e1c2 100644 --- a/charts/jaeger/Chart.yaml +++ b/charts/jaeger/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 1.53.0 description: A Jaeger Helm chart for Kubernetes name: jaeger type: application -version: 3.3.0 +version: 3.3.2 # CronJobs require v1.21 kubeVersion: ">= 1.21-0" keywords: diff --git a/charts/jaeger/templates/_helpers.tpl b/charts/jaeger/templates/_helpers.tpl index 3bb14071..9f90423a 100644 --- a/charts/jaeger/templates/_helpers.tpl +++ b/charts/jaeger/templates/_helpers.tpl @@ -408,16 +408,6 @@ memory related environment variables {{- end }} {{- end -}} -{{/* -allInOne currently only supports memory/badger storage type. -*/}} -{{- define "allInOne.storage.type" -}} -{{ $type := .Values.storage.type }} -{{- if or (eq $type "memory") (eq $type "badger") -}} -{{ .Values.storage.type }} -{{- end -}} -{{- end -}} - {{/* Cassandra, Elasticsearch, or grpc-plugin, badger, memory related environment variables depending on which is used @@ -729,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" -}} +{{- 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 }} diff --git a/charts/jaeger/templates/allinone-configmap-v2.yaml b/charts/jaeger/templates/allinone-configmap-v2.yaml new file mode 100644 index 00000000..3f4324a4 --- /dev/null +++ b/charts/jaeger/templates/allinone-configmap-v2.yaml @@ -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 }} + receivers: + {{- include "jaeger-v2.receiversConfig" . | nindent 6 }} + processors: + {{- include "jaeger-v2.processorsConfig" . | nindent 6 }} + exporters: + {{- include "jaeger-v2.exportersConfig" . | nindent 6 }} +{{- end }} \ No newline at end of file diff --git a/charts/jaeger/templates/allinone-deploy.yaml b/charts/jaeger/templates/allinone-deploy.yaml index 91e27943..f60d078a 100644 --- a/charts/jaeger/templates/allinone-deploy.yaml +++ b/charts/jaeger/templates/allinone-deploy.yaml @@ -37,7 +37,7 @@ spec: {{- toYaml .Values.allInOne.extraEnv | nindent 12 }} {{- end }} - name: SPAN_STORAGE_TYPE - value: {{ include "allInOne.storage.type" . | required "Invalid storage type provided. Use either badger or memory for allInOne" }} + value: {{ .Values.storage.type }} {{- include "storage.env" . | nindent 12 }} - name: COLLECTOR_ZIPKIN_HOST_PORT value: :9411 @@ -54,13 +54,22 @@ spec: {{- end }} securityContext: {{- toYaml .Values.allInOne.securityContext | nindent 12 }} + {{- if .Values.v2.enabled }} + image: {{ .Values.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 }} - "{{ tpl $arg $ }}" {{- end }} + {{- end }} ports: - containerPort: 5775 protocol: UDP @@ -83,9 +92,14 @@ 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 @@ -93,9 +107,14 @@ spec: 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 @@ -105,6 +124,10 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} volumeMounts: + {{- if .Values.v2.enabled }} + - name: jaeger-v2-config + mountPath: /etc/jaeger + {{- end }} {{- if not .Values.storage.badger.ephemeral }} - name: badger-data mountPath: {{ .Values.storage.badger.persistence.mountPath }} @@ -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: diff --git a/charts/jaeger/values.yaml b/charts/jaeger/values.yaml index e7715b21..1fd5d694 100644 --- a/charts/jaeger/values.yaml +++ b/charts/jaeger/values.yaml @@ -2,6 +2,62 @@ # This is a YAML-formatted file. # Jaeger values are grouped by component. Cassandra values override subchart values +v2: + enabled: false + image: jaegertracing/jaeger:2.0.0-rc2 +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 + + global: imageRegistry: diff --git a/ct-v2.yaml b/ct-v2.yaml new file mode 100644 index 00000000..3447e9a6 --- /dev/null +++ b/ct-v2.yaml @@ -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