Skip to content

Commit

Permalink
add k8s cronjob for crawler (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsunyoku authored Jun 2, 2024
1 parent 13840ac commit 5566f96
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/production-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
39 changes: 39 additions & 0 deletions k8s/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5566f96

Please sign in to comment.