From bdec55c98b40211734ff76549ae7caef339be757 Mon Sep 17 00:00:00 2001 From: Vit Holasek Date: Fri, 7 Jun 2024 11:20:21 +0200 Subject: [PATCH] Add possibility to customize image used for pod-deletion-cost annotation patching Signed-off-by: Vit Holasek --- deployment/helm/ditto/Chart.yaml | 2 +- .../ditto/templates/hooks/pod-deletion-cost-cron-job.yaml | 7 ++++++- deployment/helm/ditto/templates/hooks/pre-upgrade-job.yaml | 7 ++++++- deployment/helm/ditto/values.yaml | 7 +++++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/deployment/helm/ditto/Chart.yaml b/deployment/helm/ditto/Chart.yaml index def3c91c0c..fc975f04da 100644 --- a/deployment/helm/ditto/Chart.yaml +++ b/deployment/helm/ditto/Chart.yaml @@ -16,7 +16,7 @@ description: | A digital twin is a virtual, cloud based, representation of his real world counterpart (real world “Things”, e.g. devices like sensors, smart heating, connected cars, smart grids, EV charging stations etc). type: application -version: 3.5.7 # chart version is effectively set by release-job +version: 3.5.8 # chart version is effectively set by release-job appVersion: 3.5.6 keywords: - iot-chart diff --git a/deployment/helm/ditto/templates/hooks/pod-deletion-cost-cron-job.yaml b/deployment/helm/ditto/templates/hooks/pod-deletion-cost-cron-job.yaml index 77436b0b6b..044dc5190e 100644 --- a/deployment/helm/ditto/templates/hooks/pod-deletion-cost-cron-job.yaml +++ b/deployment/helm/ditto/templates/hooks/pod-deletion-cost-cron-job.yaml @@ -38,10 +38,15 @@ spec: {{- if .Values.rbac.enabled }} serviceAccountName: {{ template "ditto.serviceAccountName" . }} {{- end }} + {{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 12 }} + {{- end }} restartPolicy: Never containers: - name: {{ .Chart.Name }}-pod-deletion-cost-cronjob - image: "public.ecr.aws/h0h9t7p1/alpine-bash-curl-jq:latest" + image: {{ printf "%s:%s" .Values.global.podDeletionCostPatching.image.repository ( default .Values.global.podDeletionCostPatching.image.tag "latest" ) }} + imagePullPolicy: {{ .Values.global.podDeletionCostPatching.image.pullPolicy }} command: - /bin/sh - -c diff --git a/deployment/helm/ditto/templates/hooks/pre-upgrade-job.yaml b/deployment/helm/ditto/templates/hooks/pre-upgrade-job.yaml index fe27a51b27..f4c2bed282 100644 --- a/deployment/helm/ditto/templates/hooks/pre-upgrade-job.yaml +++ b/deployment/helm/ditto/templates/hooks/pre-upgrade-job.yaml @@ -39,10 +39,15 @@ spec: {{- if .Values.rbac.enabled }} serviceAccountName: {{ template "ditto.serviceAccountName" . }} {{- end }} + {{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} restartPolicy: Never containers: - name: {{ .Chart.Name }}-pod-deletion-cost-pre-upgrade-hook - image: "public.ecr.aws/h0h9t7p1/alpine-bash-curl-jq:latest" + image: {{ printf "%s:%s" .Values.global.podDeletionCostPatching.image.repository ( default .Values.global.podDeletionCostPatching.image.tag "latest" ) }} + imagePullPolicy: {{ .Values.global.podDeletionCostPatching.image.pullPolicy }} command: - /bin/sh - -c diff --git a/deployment/helm/ditto/values.yaml b/deployment/helm/ditto/values.yaml index 91d9a31cbf..6dbc724ad2 100644 --- a/deployment/helm/ditto/values.yaml +++ b/deployment/helm/ditto/values.yaml @@ -181,6 +181,13 @@ global: enabled: true # annotations defines k8s annotations to add to corresponding jobs annotations: {} + image: + # repository for the pod-deletion-cost annotation patching job docker image + repository: public.ecr.aws/h0h9t7p1/alpine-bash-curl-jq + # tag for the pod-deletion-cost annotation patching job docker image + tag: latest + # pullPolicy for the pod-deletion-cost annotation patching job docker image + pullPolicy: IfNotPresent ## ----------------------------------------------------------------------------