aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common/postgres-init
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2025-02-24 10:55:57 +0000
committerGerrit Code Review <gerrit@onap.org>2025-02-24 10:55:57 +0000
commit45df5ccf387520728ef69cead882333696ed3a90 (patch)
treed5f43d73cf78a619873f118ea3ddc2bb845bddc4 /kubernetes/common/postgres-init
parente77ed7cd5b8a5d2d096eb8d8bb7721efe67b449b (diff)
parentd9c3cc6c8dc375df464fd0cdf009572d7bc3831b (diff)
Merge "[COMMON] Add label template and make jobs GitOps ready"
Diffstat (limited to 'kubernetes/common/postgres-init')
-rw-r--r--kubernetes/common/postgres-init/Chart.yaml2
-rw-r--r--kubernetes/common/postgres-init/templates/configmap.yaml6
-rw-r--r--kubernetes/common/postgres-init/templates/job.yaml22
-rw-r--r--kubernetes/common/postgres-init/values.yaml12
4 files changed, 22 insertions, 20 deletions
diff --git a/kubernetes/common/postgres-init/Chart.yaml b/kubernetes/common/postgres-init/Chart.yaml
index 4951ed6359..8cf9707157 100644
--- a/kubernetes/common/postgres-init/Chart.yaml
+++ b/kubernetes/common/postgres-init/Chart.yaml
@@ -17,7 +17,7 @@
apiVersion: v2
description: Chart for Postgres init job
name: postgres-init
-version: 13.0.3
+version: 13.0.5
dependencies:
diff --git a/kubernetes/common/postgres-init/templates/configmap.yaml b/kubernetes/common/postgres-init/templates/configmap.yaml
index 66c28a0c69..e6a67448c7 100644
--- a/kubernetes/common/postgres-init/templates/configmap.yaml
+++ b/kubernetes/common/postgres-init/templates/configmap.yaml
@@ -20,10 +20,6 @@ kind: ConfigMap
metadata:
name: {{ include "common.fullname" . }}
namespace: {{ include "common.namespace" . }}
- labels:
- app: {{ include "common.name" . }}
- chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ include "common.release" . }}
- heritage: {{ .Release.Service }}
+ labels: {{- include "common.labels" . | nindent 4 }}
data:
{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }}
diff --git a/kubernetes/common/postgres-init/templates/job.yaml b/kubernetes/common/postgres-init/templates/job.yaml
index a2f7e12274..c7b1cb2052 100644
--- a/kubernetes/common/postgres-init/templates/job.yaml
+++ b/kubernetes/common/postgres-init/templates/job.yaml
@@ -19,24 +19,18 @@ kind: Job
metadata:
name: {{ include "common.fullname" . }}-config-job
namespace: {{ include "common.namespace" . }}
- labels:
- app: {{ include "common.name" . }}
- chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ include "common.release" . }}
- heritage: {{ .Release.Service }}
+ labels: {{- include "common.labels" . | nindent 4 }}
+ {{- if .Values.jobAnnotations }}
+ annotations: {{- include "common.tplValue" (dict "value" .Values.jobAnnotations "context" $) | nindent 4 }}
+ {{- end }}
spec:
backoffLimit: 20
template:
metadata:
- annotations:
- # Workarround to exclude K8S API from istio communication
- # as init-container (readinessCheck) does not work with the
- # Istio CNI plugin, see:
- # (https://istio.io/latest/docs/setup/additional-setup/cni/#compatibility-with-application-init-containers)
- traffic.sidecar.istio.io/excludeOutboundPorts: "443"
- labels:
- app: {{ include "common.name" . }}
- release: {{ include "common.release" . }}
+ {{- if .Values.jobPodAnnotations }}
+ annotations: {{- include "common.tplValue" (dict "value" .Values.jobPodAnnotations "context" $) | nindent 8 }}
+ {{- end }}
+ labels: {{- include "common.labels" . | nindent 8 }}
name: {{ include "common.name" . }}
spec:
{{ include "common.podSecurityContext" . | indent 6 | trim }}
diff --git a/kubernetes/common/postgres-init/values.yaml b/kubernetes/common/postgres-init/values.yaml
index 99be8354be..dbe28754f6 100644
--- a/kubernetes/common/postgres-init/values.yaml
+++ b/kubernetes/common/postgres-init/values.yaml
@@ -109,3 +109,15 @@ readinessCheck:
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"
+
+jobPodAnnotations:
+ # Workarround to exclude K8S API from istio communication
+ # as init-container (readinessCheck) does not work with the
+ # Istio CNI plugin, see:
+ # (https://istio.io/latest/docs/setup/additional-setup/cni/#compatibility-with-application-init-containers)
+ traffic.sidecar.istio.io/excludeOutboundPorts: "443"