diff --git a/.github/workflows/production-deploy.yml b/.github/workflows/production-deploy.yml index 32aea6c..ff7948b 100644 --- a/.github/workflows/production-deploy.yml +++ b/.github/workflows/production-deploy.yml @@ -87,3 +87,7 @@ jobs: --values chart/values.yaml \ profile-history-service-production \ common-helm-charts/microservice-base/ + + - name: Deploy cronjob to production cluster + run: | + kubectl apply -f k8s/cronjob.yaml diff --git a/k8s/cronjob.yaml b/k8s/cronjob.yaml new file mode 100644 index 0000000..3146173 --- /dev/null +++ b/k8s/cronjob.yaml @@ -0,0 +1,39 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: profile-history-service-cron-production +spec: + schedule: "0 22 * * *" + concurrencyPolicy: Forbid + jobTemplate: + spec: + template: + spec: + containers: + - name: profile-history-service-cron-production + image: osuakatsuki/profile-history-service:latest + imagePullPolicy: Always + command: + - ./scripts/bootstrap.sh + env: + - name: KUBERNETES + value: 'true' + - name: PULL_SECRETS_FROM_VAULT + value: '1' + - name: VAULT_ADDR + valueFrom: + secretKeyRef: + name: vault + key: address + - name: VAULT_TOKEN + valueFrom: + secretKeyRef: + name: vault + key: token + - name: APP_ENV + value: production # TODO + - name: APP_COMPONENT + value: crawler-cronjob + restartPolicy: OnFailure + imagePullSecrets: + - name: osuakatsuki-registry-secret