[COMMON] Add jobAnnotations as optional variables 25/140325/6
authorAndreas Geissler <andreas-geissler@telekom.de>
Fri, 28 Feb 2025 12:44:27 +0000 (13:44 +0100)
committerAndreas Geissler <andreas-geissler@telekom.de>
Sat, 1 Mar 2025 10:18:53 +0000 (11:18 +0100)
- 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>
42 files changed:
kubernetes/authentication/values.yaml
kubernetes/common/etcd-init/Chart.yaml
kubernetes/common/etcd-init/templates/job.yaml
kubernetes/common/etcd-init/values.yaml
kubernetes/common/mariadb-init/Chart.yaml
kubernetes/common/mariadb-init/values.yaml
kubernetes/common/mongodb-init/Chart.yaml
kubernetes/common/mongodb-init/values.yaml
kubernetes/common/postgres-init/Chart.yaml
kubernetes/common/postgres-init/values.yaml
kubernetes/policy/Chart.yaml
kubernetes/policy/templates/job.yaml
kubernetes/policy/values.yaml
kubernetes/sdc/Chart.yaml
kubernetes/sdc/components/sdc-be/Chart.yaml
kubernetes/sdc/components/sdc-be/templates/job.yaml
kubernetes/sdc/components/sdc-be/values.yaml
kubernetes/sdc/components/sdc-cs/Chart.yaml
kubernetes/sdc/components/sdc-cs/templates/job.yaml
kubernetes/sdc/components/sdc-cs/values.yaml
kubernetes/sdc/components/sdc-onboarding-be/Chart.yaml
kubernetes/sdc/components/sdc-onboarding-be/templates/job.yaml
kubernetes/sdc/components/sdc-onboarding-be/values.yaml
kubernetes/sdc/components/sdc-wfd-be/Chart.yaml
kubernetes/sdc/components/sdc-wfd-be/templates/job.yaml
kubernetes/sdc/components/sdc-wfd-be/values.yaml
kubernetes/sdnc/Chart.yaml
kubernetes/sdnc/templates/job.yaml
kubernetes/sdnc/templates/sdnrdb-init-job.yaml
kubernetes/sdnc/values.yaml
kubernetes/so/Chart.yaml
kubernetes/so/components/so-mariadb/Chart.yaml
kubernetes/so/components/so-mariadb/templates/job.yaml
kubernetes/so/components/so-mariadb/values.yaml
kubernetes/uui/Chart.yaml
kubernetes/uui/components/uui-intent-analysis/templates/job.yaml
kubernetes/uui/components/uui-intent-analysis/values.yaml
kubernetes/uui/components/uui-llm-adaptation/templates/job.yaml
kubernetes/uui/components/uui-llm-adaptation/values.yaml
kubernetes/uui/components/uui-server/Chart.yaml
kubernetes/uui/components/uui-server/templates/job.yaml
kubernetes/uui/components/uui-server/values.yaml

index 32a11a5..79f2329 100644 (file)
@@ -45,14 +45,14 @@ onap-keycloak-config-cli:
     pullSecrets:
       - name: onap-docker-registry-key
 
-  annotations:
-    # This is what defines this resource as a hook. Without this line, the
-    # job is considered part of the release.
-    argocd.argoproj.io/hook: Sync
-    argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
-    helm.sh/hook: post-install,pre-upgrade,pre-rollback
-    helm.sh/hook-weight: "1"
-    helm.sh/hook-delete-policy: before-hook-creation
+#  annotations:
+#    # This is what defines this resource as a hook. Without this line, the
+#    # job is considered part of the release.
+#    argocd.argoproj.io/hook: Sync
+#    argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
+#    helm.sh/hook: post-install,pre-upgrade,pre-rollback
+#    helm.sh/hook-weight: "1"
+#    helm.sh/hook-delete-policy: before-hook-creation
 
   #existingSecret: "keycloak-keycloakx-admin-creds"
   env:
index 166b417..0ce9c4f 100644 (file)
@@ -17,7 +17,7 @@
 apiVersion: v2
 description: Chart for etcd init job
 name: etcd-init
-version: 13.0.0
+version: 13.0.1
 
 dependencies:
   - name: common
index 71f912e..30e37ea 100644 (file)
@@ -23,6 +23,9 @@ metadata:
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
     release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
+  {{- if .Values.jobAnnotations }}
+  annotations:  {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }}
+  {{- end }}
 spec:
   backoffLimit: {{ .Values.backoffLimit }}
   template:
index 33e34fd..2af39ed 100644 (file)
@@ -55,6 +55,21 @@ config:
   appRole: role
   keyPrefix: key
 
+# 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"
+
 flavor: small
 resources:
   small:
index 7053ad8..5c29010 100644 (file)
@@ -18,7 +18,7 @@
 apiVersion: v2
 description: Chart for MariaDB Galera init job
 name: mariadb-init
-version: 13.0.4
+version: 13.0.5
 
 dependencies:
   - name: common
index 897364f..f698321 100644 (file)
@@ -106,10 +106,20 @@ config:
   #     externalSecret: some-secret-name
   config_map: default
 
-jobAnnotations:
-  "helm.sh/hook": "pre-upgrade,pre-rollback,post-install"
-  "helm.sh/hook-delete-policy": "before-hook-creation"
-  "helm.sh/hook-weight": "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"
 
 securityContext:
   user_id: 100
index 7757e73..7fe47ca 100644 (file)
@@ -15,7 +15,7 @@
 apiVersion: v2
 description: Chart for MongoDB init job
 name: mongodb-init
-version: 13.0.4
+version: 13.0.5
 
 dependencies:
   - name: common
index e2df2ff..1ab74c6 100644 (file)
@@ -110,7 +110,17 @@ wait_for_job_container:
   containers:
     - '{{ include "common.name" . }}-setup-db'
 
-jobAnnotations:
-  "helm.sh/hook": "pre-upgrade,pre-rollback,post-install"
-  "helm.sh/hook-delete-policy": "before-hook-creation"
-  "helm.sh/hook-weight": "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"
index 8cf9707..2f1971c 100644 (file)
@@ -17,8 +17,7 @@
 apiVersion: v2
 description: Chart for Postgres init job
 name: postgres-init
-version: 13.0.5
-
+version: 13.0.6
 
 dependencies:
   - name: common
index dbe2875..103ef04 100644 (file)
@@ -110,10 +110,20 @@ wait_for_job_container:
   containers:
     - '{{ include "common.name" . }}-update-config'
 
-jobAnnotations:
-  "helm.sh/hook": "pre-upgrade,pre-rollback,post-install"
-  "helm.sh/hook-delete-policy": "before-hook-creation"
-  "helm.sh/hook-weight": "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"
 
 jobPodAnnotations:
   # Workarround to exclude K8S API from istio communication
index 65a4679..a49530b 100644 (file)
@@ -19,7 +19,7 @@
 apiVersion: v2
 description: ONAP Policy
 name: policy
-version: 16.0.0
+version: 16.0.1
 
 dependencies:
   - name: common
index 6fde506..a210772 100755 (executable)
@@ -26,6 +26,9 @@ metadata:
   labels:
     app: {{ include "common.name" . }}-pg-init
     release: {{ include "common.release" . }}
+  {{- if .Values.jobAnnotations }}
+  annotations:  {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }}
+  {{- end }}
 spec:
   template:
     metadata:
@@ -113,6 +116,9 @@ metadata:
   labels:
     app: {{ include "common.name" . }}-pg-migrator-config
     release: {{ include "common.release" . }}
+  {{- if .Values.jobAnnotations }}
+  annotations:  {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }}
+  {{- end }}
 spec:
   template:
     metadata:
index 407d990..6e81382 100644 (file)
@@ -279,3 +279,18 @@ serviceAccount:
   nameOverride: policy
   roles:
     - read
+
+# 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"
index 54b71b4..d2dc711 100644 (file)
@@ -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
index bb385a0..2bb7f3b 100644 (file)
@@ -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
index 02d0415..c9fb2e8 100644 (file)
 
 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:
index 3f82c98..c57b252 100644 (file)
@@ -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
index 8edbfbb..9fc41bb 100644 (file)
@@ -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
index c715342..8f56851 100644 (file)
 
 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:
index 0b564d4..d46c474 100644 (file)
@@ -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
index a41f386..30cced1 100644 (file)
@@ -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
index 8ceca38..6a6a978 100644 (file)
 
 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:
index 07e3bea..e2aeccb 100644 (file)
@@ -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"
index ea2d0f2..725104f 100644 (file)
@@ -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
index 5b6762b..32eb857 100644 (file)
 {{ 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:
index 4d39ce0..5e0b762 100644 (file)
@@ -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"
index 2e0aa6e..02a3681 100644 (file)
@@ -18,7 +18,7 @@
 apiVersion: v2
 description: SDN Controller
 name: sdnc
-version: 15.1.0
+version: 15.1.1
 
 dependencies:
   - name: common
index ffd578f..4a7ca8a 100755 (executable)
@@ -25,6 +25,9 @@ metadata:
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
     release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
+  {{- if .Values.jobAnnotations }}
+  annotations:  {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }}
+  {{- end }}
 spec:
   backoffLimit: 20
   template:
index 1845f6c..0b630e0 100755 (executable)
 {{ if .Values.config.sdnr.enabled -}}
 apiVersion: batch/v1
 kind: Job
-metadata: {{- include "common.resourceMetadata" (dict "suffix" "sdnrdb-init-job" "dot" . ) | nindent 2 }}
+metadata:
+  name: {{ include "common.fullname" . }}-sdnrdb-init-job
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ include "common.release" . }}
+    heritage: {{ .Release.Service }}
+  {{- if .Values.jobAnnotations }}
+  annotations:  {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }}
+  {{- end }}
 spec:
   backoffLimit: 20
   template:
index 7060cae..69c81f8 100644 (file)
@@ -412,6 +412,20 @@ config:
 # Strimzi KafkaUser/Topic config on top level
 kafkaUser: *kafkaUser
 
+# 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"
 
 # dependency / sub-chart configuration
 network-name-gen:
index 0c6b4a2..846b175 100755 (executable)
@@ -17,7 +17,7 @@
 apiVersion: v2
 description: ONAP Service Orchestrator
 name: so
-version: 15.0.0
+version: 15.0.1
 
 dependencies:
   - name: common
index f66f740..fb138b6 100755 (executable)
@@ -16,7 +16,7 @@
 apiVersion: v2
 description: MariaDB Service
 name: so-mariadb
-version: 13.0.0
+version: 13.0.1
 
 dependencies:
   - name: common
index 4164f7d..9366028 100644 (file)
@@ -25,12 +25,9 @@ metadata:
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
     release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
-  annotations:
-    argocd.argoproj.io/hook: Sync
-    argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
-    helm.sh/hook: post-install,pre-upgrade,post-rollback
-    helm.sh/hook-weight: "1"
-    helm.sh/hook-delete-policy: before-hook-creation
+  {{- if .Values.jobAnnotations }}
+  annotations:  {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }}
+  {{- end }}
 spec:
   backoffLimit: 20
   template:
index 86a6b06..dbbe03c 100755 (executable)
@@ -212,3 +212,18 @@ readinessCheck:
   wait_for:
     services:
       - '{{ include "common.mariadbService" . }}'
+
+# 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"
index 0d1d7f2..1b3ca07 100644 (file)
@@ -18,7 +18,7 @@
 apiVersion: v2
 description: ONAP uui
 name: uui
-version: 15.0.0
+version: 15.0.1
 
 dependencies:
   - name: common
index 9c49913..639cad1 100644 (file)
@@ -24,6 +24,9 @@ metadata:
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
     release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
+  {{- if .Values.jobAnnotations }}
+  annotations:  {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }}
+  {{- end }}
 spec:
   backoffLimit: 20
   template:
index a930e50..991c42a 100644 (file)
@@ -124,3 +124,17 @@ resources:
       memory: "1Gi"
   unlimited: {}
 
+# 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"
index 90d6d63..efbcce2 100644 (file)
@@ -24,6 +24,9 @@ metadata:
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
     release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
+  {{- if .Values.jobAnnotations }}
+  annotations:  {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }}
+  {{- end }}
 spec:
   backoffLimit: 20
   template:
index cda2216..27068ac 100644 (file)
@@ -124,3 +124,17 @@ resources:
       memory: "1Gi"
   unlimited: {}
 
+# 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"
index 0347682..e5677aa 100644 (file)
@@ -17,7 +17,7 @@
 apiVersion: v2
 description: ONAP uui server
 name: uui-server
-version: 15.0.0
+version: 15.0.1
 
 dependencies:
   - name: common
index e995c58..50cc024 100644 (file)
 #
 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:
index 15cce63..28da40a 100644 (file)
@@ -171,3 +171,18 @@ securityContext:
 wait_for_job_container:
   containers:
     - '{{ include "common.name" . }}-job'
+
+# 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"