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: 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"