From 9fba5b95cb79d32b5ff6c0da924d5c75577bff9d Mon Sep 17 00:00:00 2001 From: Kevin Neufeld Date: Wed, 28 Feb 2024 15:26:20 -0800 Subject: [PATCH] Added job-init.yaml --- .../charts/form-recognizer-3.0/deploy-acs.bat | 2 +- .../{deployment-init.yaml => job-init.yaml} | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) rename gitops/charts/form-recognizer-3.0/templates/{deployment-init.yaml => job-init.yaml} (69%) diff --git a/gitops/charts/form-recognizer-3.0/deploy-acs.bat b/gitops/charts/form-recognizer-3.0/deploy-acs.bat index 08ca3c27a..78b51d25a 100644 --- a/gitops/charts/form-recognizer-3.0/deploy-acs.bat +++ b/gitops/charts/form-recognizer-3.0/deploy-acs.bat @@ -24,7 +24,7 @@ helm template . --show-only templates/pvc-logs.yaml | oc -n %server% apply -f - helm template . --show-only templates/pvc-shared.yaml | oc -n %server% apply -f - pause -helm template . --show-only templates/deployment-init.yaml | oc -n %server% apply -f - +helm template . --show-only templates/job-init.yaml | oc -n %server% apply -f - pause ::helm template . --show-only templates/configmap-proxy-config.yaml | oc -n %server% apply -f - diff --git a/gitops/charts/form-recognizer-3.0/templates/deployment-init.yaml b/gitops/charts/form-recognizer-3.0/templates/job-init.yaml similarity index 69% rename from gitops/charts/form-recognizer-3.0/templates/deployment-init.yaml rename to gitops/charts/form-recognizer-3.0/templates/job-init.yaml index f2ddd172b..21b450e79 100644 --- a/gitops/charts/form-recognizer-3.0/templates/deployment-init.yaml +++ b/gitops/charts/form-recognizer-3.0/templates/job-init.yaml @@ -1,20 +1,19 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ include "form-recognizer.fullname" . }}-init labels: {{- include "form-recognizer.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-1" + "helm.sh/hook-delete-policy": hook-succeeded spec: - selector: - matchLabels: - app.kubernetes.io/instance: {{ include "form-recognizer.fullname" . }}-init - app.kubernetes.io/name: {{ include "form-recognizer.fullname" . }}-init template: metadata: - labels: - app.kubernetes.io/instance: {{ include "form-recognizer.fullname" . }}-init - app.kubernetes.io/name: {{ include "form-recognizer.fullname" . }}-init + name: {{ include "form-recognizer.fullname" . }}-init spec: + restartPolicy: Never containers: - name: {{ include "form-recognizer.fullname" . }}-init image: "{{ .Values.init.image.repository }}:{{ .Values.init.image.tag }}"