49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: healthsync-motivator-batch
|
|
namespace: team1tier-healthsync-motivator-ns
|
|
labels:
|
|
app: healthsync-motivator
|
|
type: batch
|
|
spec:
|
|
# 10분마다 실행
|
|
schedule: "0 */10 * * *"
|
|
timeZone: "Asia/Seoul"
|
|
concurrencyPolicy: Forbid
|
|
successfulJobsHistoryLimit: 3
|
|
failedJobsHistoryLimit: 3
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: healthsync-motivator-batch
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: acr-secret
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: motivator-batch
|
|
image: acrhealthsync01.azurecr.io/team1tier/motivator-service:1.1.1
|
|
imagePullPolicy: Always
|
|
command: ["python", "app/batch_runner.py"]
|
|
envFrom:
|
|
- configMapRef:
|
|
name: motivator-config
|
|
- secretRef:
|
|
name: motivator-secret
|
|
resources:
|
|
requests:
|
|
cpu: 256m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: 1024m
|
|
memory: 1024Mi
|
|
# 배치 실행 타임아웃 설정
|
|
env:
|
|
- name: PYTHONPATH
|
|
value: "/app"
|
|
- name: PYTHONUNBUFFERED
|
|
value: "1"
|