diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index f111cd29..47a67c22 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -49,12 +49,29 @@ jobs: - name: Run chart-testing (install) 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 " + ct install --config ct.yaml + 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.elasticsearch=true \ + --set allInOne.enabled=false \ + --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 agent.enabled=true \ + --set collector.enabled=true \ + --set query.enabled=true" diff --git a/charts/jaeger/Chart.yaml b/charts/jaeger/Chart.yaml index 6aba9d2c..73b2f65c 100644 --- a/charts/jaeger/Chart.yaml +++ b/charts/jaeger/Chart.yaml @@ -4,6 +4,8 @@ description: A Jaeger Helm chart for Kubernetes name: jaeger type: application version: 4.0.0 +annotations: + Jaegerv1Version: "1.62.0" # CronJobs require v1.21 kubeVersion: ">= 1.21-0" keywords: @@ -16,8 +18,6 @@ icon: https://www.jaegertracing.io/img/jaeger-icon-reverse-color.svg sources: - https://hub.docker.com/u/jaegertracing/ maintainers: - - name: dvonthenen - email: david.vonthenen@dell.com - name: mehta-ankit email: ankit.mehta@appian.com - name: mikelorant diff --git a/charts/jaeger/README-v2.md b/charts/jaeger/README-v2.md new file mode 100644 index 00000000..f4407b4f --- /dev/null +++ b/charts/jaeger/README-v2.md @@ -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 charts/jaeger \ + --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 charts/jaeger \ + --set provisionDataStore.elasticsearch=true \ + --set allInOne.enabled=false \ + --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 agent.enabled=true \ + --set collector.enabled=true \ + --set query.enabled=true + --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 charts/jaeger \ + --set provisionDataStore.elasticsearch=true \ + --set allInOne.enabled=false \ + --set storage.type=elasticsearch \ + --set agent.enabled=true \ + --set collector.enabled=true \ + --set query.enabled=true + --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` + +--- diff --git a/charts/jaeger/templates/_helpers.tpl b/charts/jaeger/templates/_helpers.tpl index e1b77802..b7490b19 100644 --- a/charts/jaeger/templates/_helpers.tpl +++ b/charts/jaeger/templates/_helpers.tpl @@ -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 -}} {{/* diff --git a/charts/jaeger/templates/collector-deploy.yaml b/charts/jaeger/templates/collector-deploy.yaml index 86e15ed8..b2c911ff 100644 --- a/charts/jaeger/templates/collector-deploy.yaml +++ b/charts/jaeger/templates/collector-deploy.yaml @@ -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}} @@ -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 }} @@ -123,8 +126,8 @@ spec: - containerPort: {{ .Values.collector.service.http.port }} name: http protocol: TCP - - containerPort: 14269 - name: admin + - containerPort: 13133 + name: healthcheck protocol: TCP {{- if .Values.collector.service.zipkin }} - containerPort: {{ .Values.collector.service.zipkin.port }} @@ -141,15 +144,19 @@ spec: {{- end }} readinessProbe: httpGet: - path: / - port: admin + path: /status + port: healthcheck + scheme: HTTP livenessProbe: httpGet: - path: / - port: admin + path: /status + port: healthcheck + scheme: HTTP resources: {{- toYaml .Values.collector.resources | nindent 10 }} volumeMounts: + - name: user-config + mountPath: /etc/jaeger {{- range .Values.collector.extraConfigmapMounts }} - name: {{ .name }} mountPath: {{ .mountPath }} @@ -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: diff --git a/charts/jaeger/templates/collector-servicemonitor.yaml b/charts/jaeger/templates/collector-servicemonitor.yaml index fbd94fe5..8ddc3c9c 100644 --- a/charts/jaeger/templates/collector-servicemonitor.yaml +++ b/charts/jaeger/templates/collector-servicemonitor.yaml @@ -18,7 +18,7 @@ metadata: {{- end }} spec: endpoints: - - port: admin + - port: healthcheck path: /metrics {{- if .Values.collector.serviceMonitor.interval }} interval: {{ .Values.collector.serviceMonitor.interval }} diff --git a/charts/jaeger/templates/collector-svc.yaml b/charts/jaeger/templates/collector-svc.yaml index efa820d1..9b2c56e7 100644 --- a/charts/jaeger/templates/collector-svc.yaml +++ b/charts/jaeger/templates/collector-svc.yaml @@ -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 diff --git a/charts/jaeger/templates/es-configmap.yaml b/charts/jaeger/templates/es-configmap.yaml new file mode 100644 index 00000000..a9ab40fb --- /dev/null +++ b/charts/jaeger/templates/es-configmap.yaml @@ -0,0 +1,64 @@ +{{ 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: + 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.username | 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.username | 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: + endpoint:{{ .Values.config.receivers.otlp.protocols.grpc.endpoint | indent 1 }} + http: + endpoint:{{ .Values.config.receivers.otlp.protocols.http.endpoint | indent 1 }} + + processors: + batch: + + exporters: + jaeger_storage_exporter: + trace_storage: primary_store +{{- end }} diff --git a/charts/jaeger/templates/query-deploy.yaml b/charts/jaeger/templates/query-deploy.yaml index dc6ece41..dd4f3eaf 100644 --- a/charts/jaeger/templates/query-deploy.yaml +++ b/charts/jaeger/templates/query-deploy.yaml @@ -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: @@ -99,12 +101,14 @@ spec: - name: grpc containerPort: 16685 protocol: TCP - - name: admin - containerPort: 16687 + - name: healthcheck + 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 }} @@ -143,12 +147,14 @@ spec: {{- end }} livenessProbe: httpGet: - path: / - port: admin + path: /status + port: healthcheck + scheme: HTTP readinessProbe: httpGet: - path: / - port: admin + path: /status + port: healthcheck + scheme: HTTP {{- if .Values.query.oAuthSidecar.enabled }} - name: {{ template "jaeger.agent.name" . }}-oauth2-sidecar securityContext: @@ -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: diff --git a/charts/jaeger/templates/query-svc.yaml b/charts/jaeger/templates/query-svc.yaml index 37f7d160..75b8b3ee 100644 --- a/charts/jaeger/templates/query-svc.yaml +++ b/charts/jaeger/templates/query-svc.yaml @@ -23,10 +23,10 @@ spec: port: 16685 protocol: TCP targetPort: grpc - - name: {{ .Values.query.service.admin.name }} - port: 16687 + - name: {{ .Values.query.service.healthCheck.name }} + port: 13133 protocol: TCP - targetPort: {{ .Values.query.service.admin.targetPort }} + targetPort: {{ .Values.query.service.healthCheck.targetPort }} selector: {{- include "jaeger.selectorLabels" . | nindent 4 }} app.kubernetes.io/component: query diff --git a/charts/jaeger/templates/user-config.yaml b/charts/jaeger/templates/user-config.yaml index 2e33f33b..2fa9842b 100644 --- a/charts/jaeger/templates/user-config.yaml +++ b/charts/jaeger/templates/user-config.yaml @@ -1,3 +1,4 @@ +# Generates a config map from a file provided by user via `--set-file userconfig=` {{ if .Values.userconfig }} apiVersion: v1 kind: ConfigMap diff --git a/charts/jaeger/values.yaml b/charts/jaeger/values.yaml index 8bc4296b..43791ec7 100644 --- a/charts/jaeger/values.yaml +++ b/charts/jaeger/values.yaml @@ -33,9 +33,19 @@ config: jaeger_storage: backends: primary_store: + elasticsearch: + index_prefix: jaeger + server_urls: ["http://elasticsearch-master:9200"] + username: elastic + password: changeme memory: max_traces: 100000 archive_store: + elasticsearch: + index_prefix: jaeger-archive + server_urls: ["http://elasticsearch-master:9200"] + username: elastic + password: changeme memory: max_traces: 100000 @@ -43,7 +53,9 @@ config: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 jaeger: protocols: grpc: @@ -61,7 +73,7 @@ global: imageRegistry: provisionDataStore: - cassandra: true + cassandra: false elasticsearch: false kafka: false @@ -75,7 +87,7 @@ nameOverride: "" fullnameOverride: "" allInOne: - enabled: false + enabled: true replicas: 1 image: registry: "" @@ -153,7 +165,7 @@ allInOne: storage: # allowed values (cassandra, elasticsearch, grpc-plugin, badger, memory) - type: cassandra + type: memory cassandra: host: cassandra port: 9042 @@ -430,7 +442,7 @@ ingester: agent: podSecurityContext: {} securityContext: {} - enabled: true + enabled: false annotations: {} image: registry: "" @@ -512,11 +524,11 @@ agent: collector: podSecurityContext: {} securityContext: {} - enabled: true + enabled: false annotations: {} image: registry: "" - repository: jaegertracing/jaeger-collector + repository: jaegertracing/jaeger tag: "" digest: "" pullPolicy: IfNotPresent @@ -566,9 +578,9 @@ collector: # name: otlp-http # port: 4318 # nodePort: - admin: - name: admin - targetPort: admin + healthCheck: + name: healthcheck + targetPort: healthcheck ingress: enabled: false # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName @@ -681,7 +693,7 @@ collector: # customRules: [] query: - enabled: true + enabled: false basePath: / initContainers: [] oAuthSidecar: @@ -732,7 +744,7 @@ query: annotations: {} image: registry: "" - repository: jaegertracing/jaeger-query + repository: jaegertracing/jaeger tag: "" digest: "" pullPolicy: IfNotPresent @@ -752,9 +764,9 @@ query: # targetPort: 8080 # Specify a specific node port when type is NodePort # nodePort: 32500 - admin: - name: admin - targetPort: admin + healthCheck: + name: healthcheck + targetPort: healthcheck ingress: enabled: false # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName