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

feature: add supports for zipkin-dependencies job as a k8s cronjob #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
39 changes: 39 additions & 0 deletions charts/zipkin/templates/cronJob.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
10 changes: 10 additions & 0 deletions charts/zipkin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading