From 74d5905ea98b53ad898d33e51e889e217cd66c9b Mon Sep 17 00:00:00 2001 From: "m.eveno" Date: Thu, 1 Feb 2024 16:39:27 +0100 Subject: [PATCH 1/2] feature: add supports for zipkin-dependencies job as a k8s cronjob --- charts/zipkin/templates/cronJob.yaml | 39 ++++++++++++++++++++++++++++ charts/zipkin/values.yaml | 10 +++++++ 2 files changed, 49 insertions(+) create mode 100644 charts/zipkin/templates/cronJob.yaml diff --git a/charts/zipkin/templates/cronJob.yaml b/charts/zipkin/templates/cronJob.yaml new file mode 100644 index 0000000..2286fa5 --- /dev/null +++ b/charts/zipkin/templates/cronJob.yaml @@ -0,0 +1,39 @@ + +{{- if eq .Values.zipkin.storage.type "elasticsearch" }} +{{- if .Values.zipkin.dependencyJob.enabled }} +apiVersion: batch/v1 +kind: CronJob +metadata: + name: {{ .Values.zipkin.dependencyJob.jobName }}-job + namespace: {{ include "zipkin.namespace" . }} +spec: + schedule: "{{ .Values.zipkin.dependencyJob.schedule }}" + concurrencyPolicy: Forbid + successfulJobsHistoryLimit: "{{ .Values.zipkin.dependencyJob.successfulJobsHistoryLimit }}" + failedJobsHistoryLimit: "{{ .Values.zipkin.dependencyJob.failedJobsHistoryLimit }}" + jobTemplate: + spec: + template: + spec: + containers: + - name: job + image: "{{ .Values.zipkin.dependencyJob.image.repository }}:{{ .Values.zipkin.dependencyJob.image.tag }}" + imagePullPolicy: {{ .Values.zipkin.dependencyJob.image.pullPolicy }} + env: + - name: STORAGE_TYPE + value: {{ .Values.zipkin.storage.type }} + {{- if eq .Values.zipkin.storage.type "elasticsearch" }} + + {{- if .Values.zipkin.storage.elasticsearch.hosts }} + - name: ES_HOSTS + value: {{ .Values.zipkin.storage.elasticsearch.hosts }} + {{- end }} + {{- if .Values.zipkin.storage.elasticsearch.hosts }} + - name: ES_INDEX + value: {{ .Values.zipkin.storage.elasticsearch.index }} + {{- end }} + + {{- end }} + restartPolicy: Never +{{- end }} +{{- end }} diff --git a/charts/zipkin/values.yaml b/charts/zipkin/values.yaml index 4c2166e..eae36b5 100644 --- a/charts/zipkin/values.yaml +++ b/charts/zipkin/values.yaml @@ -109,3 +109,13 @@ zipkin: # index: fooIndex extraEnv: {} # JAVA_OPTS: "-Xms128m -Xmx512m -XX:+ExitOnOutOfMemoryError" + + dependencyJob: + enabled: false + jobName: zipkin-dependencies-job + schedule: "0 * * * *" + successfulJobsHistoryLimit: 1 + failedJobsHistoryLimit: 1 + image: + repository: openzipkin/zipkin-dependencies + pullPolicy: "IfNotPresent" From aabf57677a79ed20e13e2c32acddc1e7548656e4 Mon Sep 17 00:00:00 2001 From: "m.eveno" Date: Thu, 1 Feb 2024 16:45:14 +0100 Subject: [PATCH 2/2] Readme updates --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index ce256a1..fc250d6 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,9 @@ You can then run `helm search repo zipkin` to see the charts. | zipkin.storage.elasticsearch.hosts | string | `"hostA hostB"` | | | zipkin.storage.elasticsearch.index | string | `"fooIndex"` | | | zipkin.storage.type | string | `"elasticsearch"` | | +| zipkin.dependencyJob.enabled | boolean | `false` | | +| zipkin.dependencyJob.schedule | string | `"0 * * * *"` (defaults: every hour) | | +| zipkin.dependencyJob.image.tag | string | `""` | | The values are validated using a JSON schema, which contains logic to enforce either: