From fbe820e5867462b9eb438f992c876754a53b9fce Mon Sep 17 00:00:00 2001 From: EarthlingDavey <15802017+EarthlingDavey@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:57:33 +0100 Subject: [PATCH] CDPT-2186 Fix job template and add it to to deploy (#749) --- .github/workflows/deploy.yml | 1 + deploy/development/job.tpl.yml | 36 ++++++++++++++++++---------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a87f7af79..c21110f81 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -139,6 +139,7 @@ jobs: < "$TPL_PATH"/ingress.tpl.yml envsubst '${MODSEC_CONFIG}' > "$TPL_PATH"/ingress.yaml < "$TPL_PATH"/secret.tpl.yml envsubst > "$TPL_PATH"/secret.yaml < "$TPL_PATH"/deployment.tpl.yml envsubst > "$TPL_PATH"/deployment.yaml + < "$TPL_PATH"/job.tpl.yml envsubst > "$TPL_PATH"/job.yaml ## Remove template files before apply rm "$TPL_PATH"/*.tpl.yml diff --git a/deploy/development/job.tpl.yml b/deploy/development/job.tpl.yml index b7d97dcaa..a0011b651 100644 --- a/deploy/development/job.tpl.yml +++ b/deploy/development/job.tpl.yml @@ -1,25 +1,27 @@ # A one time job to run the s3-push container once. # It will already be built and available at: ${ECR_URL}:${IMAGE_TAG_S3_PUSHER} -apiVersion: apps/v1 +apiVersion: batch/v1 kind: Job metadata: - name: ${KUBE_NAMESPACE}-s3-pusher + name: ${IMAGE_TAG_S3_PUSH} namespace: ${KUBE_NAMESPACE} labels: app: ${KUBE_NAMESPACE} - spec: - template: - metadata: - labels: - app: ${KUBE_NAMESPACE} - spec: - containers: - - name: s3-push - image: ${ECR_URL}:${IMAGE_TAG_S3_PUSH} - env: - - name: AWS_S3_BUCKET - valueFrom: - secretKeyRef: - name: s3-bucket-output - key: bucket_name +spec: + template: + metadata: + labels: + app: ${KUBE_NAMESPACE} + spec: + serviceAccountName: ${KUBE_NAMESPACE}-service + restartPolicy: Never + containers: + - name: s3-push + image: ${ECR_URL}:${IMAGE_TAG_S3_PUSH} + env: + - name: AWS_S3_BUCKET + valueFrom: + secretKeyRef: + name: s3-bucket-output + key: bucket_name