diff --git a/cronjob/Chart.yaml b/cronjob/Chart.yaml index d2e8690..80a1ec6 100644 --- a/cronjob/Chart.yaml +++ b/cronjob/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 description: Helm chart with simple cronjob template name: cronjob -version: 0.7.5 +version: 0.8.0 appVersion: 1.0.0 tillerVersion: ">=2.14.3" diff --git a/cronjob/templates/_argo_cron_workflow.tpl b/cronjob/templates/_argo_cron_workflow.tpl index 0ba0ff5..6fad4e4 100644 --- a/cronjob/templates/_argo_cron_workflow.tpl +++ b/cronjob/templates/_argo_cron_workflow.tpl @@ -3,6 +3,7 @@ podMetadata: labels: name: {{ .Values.name }} + businessid: {{ .Values.businessid | quote }} annotations: {{- range $key, $value := .Values.annotations }} {{ $key | quote }} : {{ $value | quote }} @@ -10,6 +11,7 @@ workflowMetadata: labels: name: {{ .Values.name }} + businessid: {{ .Values.businessid | quote }} annotations: {{- range $key, $value := .Values.annotations }} {{ $key | quote }} : {{ $value | quote }} diff --git a/cronjob/templates/_k8s_cronjob.tpl b/cronjob/templates/_k8s_cronjob.tpl index 6418d55..5d77a2a 100644 --- a/cronjob/templates/_k8s_cronjob.tpl +++ b/cronjob/templates/_k8s_cronjob.tpl @@ -1,6 +1,8 @@ {{- define "cronjob.k8s_cronjob" -}} jobTemplate: metadata: + labels: + businessid: {{ .Values.businessid | quote }} annotations: cronjob_name: {{ .Values.name }} spec: @@ -8,6 +10,8 @@ activeDeadlineSeconds: {{ .Values.job.timeout }} template: metadata: + labels: + businessid: {{ .Values.businessid | quote }} annotations: cronjob_name: {{ .Values.name }} {{- range $key, $value := .Values.annotations }} diff --git a/cronjob/templates/cronjob.yaml b/cronjob/templates/cronjob.yaml index d835bab..da9a8a7 100644 --- a/cronjob/templates/cronjob.yaml +++ b/cronjob/templates/cronjob.yaml @@ -10,6 +10,8 @@ kind: CronJob metadata: name: {{ .Values.name }} namespace: {{ .Release.Namespace }} + labels: + businessid: {{ $.Values.businessid | quote}} spec: schedule: {{ .Values.schedule | quote }} # If "kind" eq to "CronWorkflow", timezone can be set. If "kind" eq to "CronWorkflow" and timezone are not set, "Asia/Taipei" will be used diff --git a/cronjob/values.yaml b/cronjob/values.yaml index 833d9e3..8267e3a 100644 --- a/cronjob/values.yaml +++ b/cronjob/values.yaml @@ -17,6 +17,11 @@ kind: "CronJob" # Starting Deadline Seconds of cron job. Will be assign to spec.startingDeadlineSeconds. startingDeadlineSeconds: {} +# counting cost by team +businessid: "" +# example +# businessid: "000000042462041525" + job: # Number of retries if error occurred retries: 1