diff options
author | 2025-02-28 13:44:27 +0100 | |
---|---|---|
committer | 2025-03-01 11:18:53 +0100 | |
commit | 4aeb83993fc3c78554ed53b5ffbf35552634e4a6 (patch) | |
tree | debbbf3cb8096c674754e01f431c6d54f8798375 /kubernetes/sdc | |
parent | 3efc75775a486e5116d73dd1180c461870edb51b (diff) |
[COMMON] Add jobAnnotations as optional variables
- add Annotations to all job template metadata
- make the jobAnnotations configurable via values.yaml
Issue-ID: OOM-3254
Change-Id: I84a3a7e9a89ea272a239e7a86e9c615103c2c7e4
Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
Diffstat (limited to 'kubernetes/sdc')
-rw-r--r-- | kubernetes/sdc/Chart.yaml | 2 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-be/Chart.yaml | 2 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-be/templates/job.yaml | 10 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-be/values.yaml | 16 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-cs/Chart.yaml | 2 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-cs/templates/job.yaml | 10 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-cs/values.yaml | 15 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-onboarding-be/Chart.yaml | 2 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-onboarding-be/templates/job.yaml | 10 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-onboarding-be/values.yaml | 15 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-wfd-be/Chart.yaml | 2 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-wfd-be/templates/job.yaml | 10 | ||||
-rw-r--r-- | kubernetes/sdc/components/sdc-wfd-be/values.yaml | 15 |
13 files changed, 102 insertions, 9 deletions
diff --git a/kubernetes/sdc/Chart.yaml b/kubernetes/sdc/Chart.yaml index 54b71b4794..d2dc711b00 100644 --- a/kubernetes/sdc/Chart.yaml +++ b/kubernetes/sdc/Chart.yaml @@ -18,7 +18,7 @@ apiVersion: v2 description: Service Design and Creation Umbrella Helm charts name: sdc -version: 13.0.4 +version: 13.0.5 dependencies: - name: common diff --git a/kubernetes/sdc/components/sdc-be/Chart.yaml b/kubernetes/sdc/components/sdc-be/Chart.yaml index bb385a058e..2bb7f3be8b 100644 --- a/kubernetes/sdc/components/sdc-be/Chart.yaml +++ b/kubernetes/sdc/components/sdc-be/Chart.yaml @@ -18,7 +18,7 @@ apiVersion: v2 description: ONAP Service Design and Creation Backend API name: sdc-be -version: 13.0.3 +version: 13.0.4 dependencies: - name: common diff --git a/kubernetes/sdc/components/sdc-be/templates/job.yaml b/kubernetes/sdc/components/sdc-be/templates/job.yaml index 02d04154e9..c9fb2e8337 100644 --- a/kubernetes/sdc/components/sdc-be/templates/job.yaml +++ b/kubernetes/sdc/components/sdc-be/templates/job.yaml @@ -17,7 +17,15 @@ apiVersion: batch/v1 kind: Job -metadata: {{- include "common.resourceMetadata" . | nindent 2 }} +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + release: {{ include "common.release" . }} + {{- if .Values.jobAnnotations }} + annotations: {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }} + {{- end }} spec: backoffLimit: 20 template: diff --git a/kubernetes/sdc/components/sdc-be/values.yaml b/kubernetes/sdc/components/sdc-be/values.yaml index 3f82c98c98..c57b252c7c 100644 --- a/kubernetes/sdc/components/sdc-be/values.yaml +++ b/kubernetes/sdc/components/sdc-be/values.yaml @@ -314,4 +314,20 @@ updateStrategy: maxUnavailable: 0 # The number of pods that can be created above the desired amount of pods during an update maxSurge: 1 + +# Annotations to control the execution and deletion of the job +# Can be used to delete a job before an Upgrade +# +# jobAnnotations: +# # In case of an ArgoCD deployment this Hook deletes the job before syncing +# argocd.argoproj.io/hook: Sync +# argocd.argoproj.io/hook-delete-policy: BeforeHookCreation +# +# # In case of an Helm/Flux deployment this Hook deletes the job +# # This is what defines this resource as a hook. Without this line, the +# # job is considered part of the release. +# "helm.sh/hook": "pre-upgrade,pre-rollback,post-install" +# "helm.sh/hook-delete-policy": "before-hook-creation" +# "helm.sh/hook-weight": "1" + #END diff --git a/kubernetes/sdc/components/sdc-cs/Chart.yaml b/kubernetes/sdc/components/sdc-cs/Chart.yaml index 8edbfbbb84..9fc41bb6da 100644 --- a/kubernetes/sdc/components/sdc-cs/Chart.yaml +++ b/kubernetes/sdc/components/sdc-cs/Chart.yaml @@ -18,7 +18,7 @@ apiVersion: v2 description: ONAP Service Design and Creation Cassandra name: sdc-cs -version: 13.0.2 +version: 13.0.3 dependencies: - name: common diff --git a/kubernetes/sdc/components/sdc-cs/templates/job.yaml b/kubernetes/sdc/components/sdc-cs/templates/job.yaml index c715342d5e..8f56851dcf 100644 --- a/kubernetes/sdc/components/sdc-cs/templates/job.yaml +++ b/kubernetes/sdc/components/sdc-cs/templates/job.yaml @@ -17,7 +17,15 @@ apiVersion: batch/v1 kind: Job -metadata: {{- include "common.resourceMetadata" . | nindent 2 }} +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + release: {{ include "common.release" . }} + {{- if .Values.jobAnnotations }} + annotations: {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }} + {{- end }} spec: backoffLimit: 20 template: diff --git a/kubernetes/sdc/components/sdc-cs/values.yaml b/kubernetes/sdc/components/sdc-cs/values.yaml index 0b564d4419..d46c474542 100644 --- a/kubernetes/sdc/components/sdc-cs/values.yaml +++ b/kubernetes/sdc/components/sdc-cs/values.yaml @@ -82,6 +82,21 @@ config: maxHeapSize: "1536M" heapNewSize: "512M" +# Annotations to control the execution and deletion of the job +# Can be used to delete a job before an Upgrade +# +# jobAnnotations: +# # In case of an ArgoCD deployment this Hook deletes the job before syncing +# argocd.argoproj.io/hook: Sync +# argocd.argoproj.io/hook-delete-policy: BeforeHookCreation +# +# # In case of an Helm/Flux deployment this Hook deletes the job +# # This is what defines this resource as a hook. Without this line, the +# # job is considered part of the release. +# "helm.sh/hook": "pre-upgrade,pre-rollback,post-install" +# "helm.sh/hook-delete-policy": "before-hook-creation" +# "helm.sh/hook-weight": "1" + #environment file env: name: AUTO diff --git a/kubernetes/sdc/components/sdc-onboarding-be/Chart.yaml b/kubernetes/sdc/components/sdc-onboarding-be/Chart.yaml index a41f386b8d..30cced108c 100644 --- a/kubernetes/sdc/components/sdc-onboarding-be/Chart.yaml +++ b/kubernetes/sdc/components/sdc-onboarding-be/Chart.yaml @@ -18,7 +18,7 @@ apiVersion: v2 description: ONAP Service Design and Creation Onboarding API name: sdc-onboarding-be -version: 13.0.3 +version: 13.0.4 dependencies: - name: repositoryGenerator diff --git a/kubernetes/sdc/components/sdc-onboarding-be/templates/job.yaml b/kubernetes/sdc/components/sdc-onboarding-be/templates/job.yaml index 8ceca385a4..6a6a9781d1 100644 --- a/kubernetes/sdc/components/sdc-onboarding-be/templates/job.yaml +++ b/kubernetes/sdc/components/sdc-onboarding-be/templates/job.yaml @@ -17,7 +17,15 @@ apiVersion: batch/v1 kind: Job -metadata: {{- include "common.resourceMetadata" . | nindent 2 }} +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + release: {{ include "common.release" . }} + {{- if .Values.jobAnnotations }} + annotations: {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }} + {{- end }} spec: backoffLimit: 20 template: diff --git a/kubernetes/sdc/components/sdc-onboarding-be/values.yaml b/kubernetes/sdc/components/sdc-onboarding-be/values.yaml index 07e3bead35..e2aeccbf27 100644 --- a/kubernetes/sdc/components/sdc-onboarding-be/values.yaml +++ b/kubernetes/sdc/components/sdc-onboarding-be/values.yaml @@ -235,3 +235,18 @@ metrics: path: /onboarding-api/v1.0/actuator/prometheus basicAuth: enabled: false + +# Annotations to control the execution and deletion of the job +# Can be used to delete a job before an Upgrade +# +# jobAnnotations: +# # In case of an ArgoCD deployment this Hook deletes the job before syncing +# argocd.argoproj.io/hook: Sync +# argocd.argoproj.io/hook-delete-policy: BeforeHookCreation +# +# # In case of an Helm/Flux deployment this Hook deletes the job +# # This is what defines this resource as a hook. Without this line, the +# # job is considered part of the release. +# "helm.sh/hook": "pre-upgrade,pre-rollback,post-install" +# "helm.sh/hook-delete-policy": "before-hook-creation" +# "helm.sh/hook-weight": "1" diff --git a/kubernetes/sdc/components/sdc-wfd-be/Chart.yaml b/kubernetes/sdc/components/sdc-wfd-be/Chart.yaml index ea2d0f2443..725104fc63 100644 --- a/kubernetes/sdc/components/sdc-wfd-be/Chart.yaml +++ b/kubernetes/sdc/components/sdc-wfd-be/Chart.yaml @@ -17,7 +17,7 @@ apiVersion: v2 description: ONAP Service Design and Creation Workflow Designer backend name: sdc-wfd-be -version: 13.0.1 +version: 13.0.2 dependencies: - name: repositoryGenerator diff --git a/kubernetes/sdc/components/sdc-wfd-be/templates/job.yaml b/kubernetes/sdc/components/sdc-wfd-be/templates/job.yaml index 5b6762b78f..32eb8572ab 100644 --- a/kubernetes/sdc/components/sdc-wfd-be/templates/job.yaml +++ b/kubernetes/sdc/components/sdc-wfd-be/templates/job.yaml @@ -18,7 +18,15 @@ {{ if .Values.initJob.enabled }} apiVersion: batch/v1 kind: Job -metadata: {{- include "common.resourceMetadata" . | nindent 2 }} +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + release: {{ include "common.release" . }} + {{- if .Values.jobAnnotations }} + annotations: {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }} + {{- end }} spec: backoffLimit: 20 template: diff --git a/kubernetes/sdc/components/sdc-wfd-be/values.yaml b/kubernetes/sdc/components/sdc-wfd-be/values.yaml index 4d39ce02d5..5e0b7623ae 100644 --- a/kubernetes/sdc/components/sdc-wfd-be/values.yaml +++ b/kubernetes/sdc/components/sdc-wfd-be/values.yaml @@ -171,3 +171,18 @@ updateStrategy: maxUnavailable: 0 # The number of pods that can be created above the desired amount of pods during an update maxSurge: 1 + +# Annotations to control the execution and deletion of the job +# Can be used to delete a job before an Upgrade +# +# jobAnnotations: +# # In case of an ArgoCD deployment this Hook deletes the job before syncing +# argocd.argoproj.io/hook: Sync +# argocd.argoproj.io/hook-delete-policy: BeforeHookCreation +# +# # In case of an Helm/Flux deployment this Hook deletes the job +# # This is what defines this resource as a hook. Without this line, the +# # job is considered part of the release. +# "helm.sh/hook": "pre-upgrade,pre-rollback,post-install" +# "helm.sh/hook-delete-policy": "before-hook-creation" +# "helm.sh/hook-weight": "1" |