Skip to content
Merged
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
2 changes: 1 addition & 1 deletion charts/cron-job/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
description: EcoVadis Helm chart for K8s Cron Job
name: charts-cron-job
type: application
version: 2.9.1
version: 2.10.0
dependencies:
- name: charts-core
version: 2.4.2
Expand Down
14 changes: 14 additions & 0 deletions charts/cron-job/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,23 @@
{{- $nodeSelector := $cronjob.nodeSelector | default $global.nodeSelector }}
{{- $affinity := $cronjob.affinity | default $global.affinity }}
{{- $tolerations := $cronjob.tolerations | default $global.tolerations }}

{{- /* Annotations configuration */ -}}
{{- $annotationsEnabled := $cronjob.annotationsEnabled | default $global.annotationsEnabled }}
{{- $annotations := $cronjob.annotations | default $global.annotations }}
{{- $podAnnotationsEnabled := $cronjob.podAnnotationsEnabled | default $global.podAnnotationsEnabled }}
{{- $podAnnotations := $cronjob.podAnnotations | default $global.podAnnotations }}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "charts-cron-job.fullname" (dict "root" $ "cronjob" $cronjob "index" $index) }}
labels:
{{- include "charts-cron-job.labels" (dict "root" $ "cronjob" $cronjob) | nindent 4 }}
{{- if $annotationsEnabled }}
annotations:
{{- toYaml $annotations | nindent 4 }}
{{- end }}
spec:
schedule: "{{ $schedule }}"
concurrencyPolicy: "{{ $concurrencyPolicy }}"
Expand All @@ -61,6 +71,10 @@ spec:
metadata:
labels:
{{- include "charts-cron-job.labels" (dict "root" $ "cronjob" $cronjob) | nindent 12 }}
{{- if $podAnnotationsEnabled }}
annotations:
{{- toYaml $podAnnotations | nindent 12 }}
{{- end }}
spec:
{{- if $imagePullSecret }}
imagePullSecrets:
Expand Down
18 changes: 17 additions & 1 deletion charts/cron-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Define cronjobs array when you need multiple jobs with different configurations.
#cronjobs:
# - schedule: ""
# nameOverride:
# nameOverride:
# fullnameOverride:
# image:
# name: # app name
Expand All @@ -17,6 +17,12 @@
# additionalLabelsEnabled: true
# additionalLabels:
# team: #{team}#
# annotationsEnabled: true
# annotations:
# example.com/annotation: value
# podAnnotationsEnabled: true
# podAnnotations:
# example.com/pod-annotation: value

global:
schedule: ""
Expand Down Expand Up @@ -62,6 +68,16 @@ global:
additionalLabelsEnabled: false
additionalLabels: {}

# Annotations added to the CronJob resource metadata
annotationsEnabled: false
annotations: {}
#example.com/annotation: value

# Annotations added to the pod template metadata
podAnnotationsEnabled: false
podAnnotations: {}
#example.com/pod-annotation: value

securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
Loading