diff --git a/charts/cron-job/Chart.yaml b/charts/cron-job/Chart.yaml index 8ce7e53..13369c1 100644 --- a/charts/cron-job/Chart.yaml +++ b/charts/cron-job/Chart.yaml @@ -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 diff --git a/charts/cron-job/templates/cronjob.yaml b/charts/cron-job/templates/cronjob.yaml index b3ec19b..921fe95 100644 --- a/charts/cron-job/templates/cronjob.yaml +++ b/charts/cron-job/templates/cronjob.yaml @@ -36,6 +36,12 @@ {{- $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 @@ -43,6 +49,10 @@ 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 }}" @@ -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: diff --git a/charts/cron-job/values.yaml b/charts/cron-job/values.yaml index 418af74..846d632 100644 --- a/charts/cron-job/values.yaml +++ b/charts/cron-job/values.yaml @@ -6,7 +6,7 @@ # Define cronjobs array when you need multiple jobs with different configurations. #cronjobs: # - schedule: "" -# nameOverride: +# nameOverride: # fullnameOverride: # image: # name: # app name @@ -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: "" @@ -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: