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