apiVersion: batch/v1
kind: CronJob
metadata:
name: finops-daily-pipeline
namespace: devops-finops
labels:
app: finops-batch
component: pipeline-engine
spec:
schedule: "0 3 * * *"
timeZone: "Asia/Seoul"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 5
jobTemplate:
spec:
template:
metadata:
labels:
app: finops-batch
spec:
restartPolicy: OnFailure
containers:
- name: pipeline-runner
image: harbor.internal.zone/devops/finops-pipeline:v2
imagePullPolicy: IfNotPresent
command: ["/bin/sh", "-c"]
args:
- |
echo "⏳ [1단계] Thanos 메트릭 수집 및 파티셔닝 시작..." && \
python3 step1_prom_fetch.py --step 5m && \
echo "⏳ [2단계] AIStor Tables 마감 정산 연산 시작..." && \
python3 step2_pipeline.py --cluster ALL
resources:
requests:
cpu: "4"
memory: "16Gi"
limits:
cpu: "8"
memory: "32Gi"
env:
- name: THANOS_QUERY_URL
value: "http://thanos-query.monitoring.svc.cluster.local:80"
- name: MINIO_ENDPOINT
value: "http://minio-service.internal.zone:9000"
- name: MINIO_ACCESS_KEY
value: "admin"
- name: MINIO_SECRET_KEY
value: "password"
- name: MINIO_RAW_BUCKET
value: "devops-test"
- name: MINIO_REPORT_BUCKET
value: "devops-test"
- name: no_proxy
value: ".cluster.local,.svc,localhost,127.0.0.1,10.96.0.0/12,10.244.0.0/16"