From 985d638a33dfc09ce5a5cba9529ce01ed3e838fe Mon Sep 17 00:00:00 2001 From: vmaillot <74190001+vmaillot@users.noreply.github.com> Date: Fri, 22 Dec 2023 11:52:06 +0100 Subject: [PATCH] feat(cronjob): add annotations support in pod template (#1170) chore(cronjob): move annotations under pod template Signed-off-by: Valentin Maillot --- charts/openshift-etcd-backup/Chart.yaml | 7 ++----- charts/openshift-etcd-backup/README.md | 3 ++- charts/openshift-etcd-backup/templates/cronjob.yaml | 5 +++++ charts/openshift-etcd-backup/values.yaml | 2 ++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/charts/openshift-etcd-backup/Chart.yaml b/charts/openshift-etcd-backup/Chart.yaml index e73c889b6..e3e0fa5c9 100644 --- a/charts/openshift-etcd-backup/Chart.yaml +++ b/charts/openshift-etcd-backup/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: openshift-etcd-backup description: Chart for openshift-etcd-backup solution type: application -version: 1.7.1 +version: 1.7.2 appVersion: v1.7.1 keywords: - openshift-etcd-backup @@ -20,7 +20,4 @@ maintainers: annotations: artifacthub.io/changes: | - kind: changed - description: "bump openshift-etcd-backup image to v1.7.1" - links: - - name: openshift-etcd-backup release v1.7.1 - url: https://github.com/adfinis/openshift-etcd-backup/releases/tag/v1.7.1 + description: "add annotations support for jobTemplate" diff --git a/charts/openshift-etcd-backup/README.md b/charts/openshift-etcd-backup/README.md index 8998ca1d7..0827220d2 100644 --- a/charts/openshift-etcd-backup/README.md +++ b/charts/openshift-etcd-backup/README.md @@ -1,6 +1,6 @@ # openshift-etcd-backup -![Version: 1.7.1](https://img.shields.io/badge/Version-1.7.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.7.1](https://img.shields.io/badge/AppVersion-v1.7.1-informational?style=flat-square) +![Version: 1.7.2](https://img.shields.io/badge/Version-1.7.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.7.1](https://img.shields.io/badge/AppVersion-v1.7.1-informational?style=flat-square) Chart for openshift-etcd-backup solution @@ -19,6 +19,7 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | Key | Type | Default | Description | |-----|------|---------|-------------| | affinity | object | `{}` | | +| annotations | object | `{}` | | | backup.dirname | string | `"+etcd-backup-%FT%T%:z"` | Directory name of single backup | | backup.expiretype | string | `"days"` | expiretype could be days (keep backups newer than backup.keepdays, count (keep a number of backups with backup.keepcount), never (do not expire backups, keep all of them) | | backup.keepcount | string | `"10"` | Count retention if expiretype set to count | diff --git a/charts/openshift-etcd-backup/templates/cronjob.yaml b/charts/openshift-etcd-backup/templates/cronjob.yaml index 5ad99d621..cd8564fa1 100644 --- a/charts/openshift-etcd-backup/templates/cronjob.yaml +++ b/charts/openshift-etcd-backup/templates/cronjob.yaml @@ -15,6 +15,11 @@ spec: # job immediately if the first execution fails. backoffLimit: 0 template: + {{- with .Values.annotations }} + metadata: + annotations: + {{- toYaml . | nindent 12 }} + {{- end }} spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 12 }} diff --git a/charts/openshift-etcd-backup/values.yaml b/charts/openshift-etcd-backup/values.yaml index e8b6f0be2..51abe9859 100644 --- a/charts/openshift-etcd-backup/values.yaml +++ b/charts/openshift-etcd-backup/values.yaml @@ -96,6 +96,8 @@ tolerations: affinity: {} +annotations: {} + monitoring: # -- Deploy PrometheusRule to be alerted in case of backup fails as decribed [here](https://github.com/adfinis/openshift-etcd-backup/blob/main/etcd-backup-cronjob-monitor.PrometheusRule.yaml). # Be sure to to have monitoring for user defined projects enabled as [described in the upstream documentation](https://docs.openshift.com/container-platform/4.6/monitoring/enabling-monitoring-for-user-defined-projects.html).