Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 0 additions & 86 deletions apps/gcp/cost-insight/cronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,92 +114,6 @@ spec:
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: cost-insight-sync-gcp-gke-allocations
namespace: apps
labels:
app.kubernetes.io/name: cost-insight-sync-gcp-gke-allocations
app.kubernetes.io/part-of: cost-insight
spec:
# Interpreted with timeZone below: daily 00:10 Asia/Shanghai, after the prior
# evening's billing and unmatched-resource jobs have settled.
schedule: "10 0 * * *"
timeZone: Asia/Shanghai
suspend: false
concurrencyPolicy: Forbid
startingDeadlineSeconds: 1800
successfulJobsHistoryLimit: 5
failedJobsHistoryLimit: 5
jobTemplate:
spec:
backoffLimit: 4
activeDeadlineSeconds: 7200
template:
metadata:
labels:
app.kubernetes.io/name: cost-insight-sync-gcp-gke-allocations
app.kubernetes.io/part-of: cost-insight
spec:
# The bound GSA needs BigQuery jobUser plus read access to both the
# billing export and the GKE workload metering table.
serviceAccountName: ci-dashboard
restartPolicy: Never
containers:
- name: sync-gcp-gke-allocations
image: ghcr.io/pingcap-qe/ee-apps/cost-insight-jobs:v2026.8.16-12-g5e2f016
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -ec
args:
- |
dates="$(python - <<'PY'
from datetime import datetime, timedelta, timezone
import os

lag_days = int(os.environ["COST_INSIGHT_GCP_GKE_ALLOCATION_LAG_DAYS"])
overlap_days = int(os.environ["COST_INSIGHT_GCP_GKE_ALLOCATION_OVERLAP_DAYS"])
end_date = datetime.now(timezone.utc).date() - timedelta(days=lag_days)
start_date = end_date - timedelta(days=overlap_days)
print(start_date.isoformat(), end_date.isoformat())
PY
)"
set -- ${dates}
cost-insight sync-gcp-kubernetes-workload-allocations \
--usage-start-date "$1" \
--usage-end-date "$2"
envFrom:
- secretRef:
name: ci-dashboard-eq-prd-insight-db
env:
- name: PYTHONUNBUFFERED
value: "1"
- name: COST_INSIGHT_LOG_LEVEL
value: INFO
- name: GOOGLE_CLOUD_PROJECT
value: pingcap-testing-account
- name: COST_INSIGHT_GCP_ACCOUNT_ID
value: pingcap-testing-account
- name: COST_INSIGHT_GCP_BILLING_TABLE
value: gcp-digital-bi.gcp_billing_detailed.gcp_billing_export_resource_v1_01D088_8F9CF2_8AF1C6
- name: COST_INSIGHT_GCP_GKE_USAGE_TABLE
value: pingcap-testing-account.pingcap_ee_data.gke_cluster_resource_usage
- name: COST_INSIGHT_GCP_GKE_ALLOCATION_LAG_DAYS
value: "5"
- name: COST_INSIGHT_GCP_GKE_ALLOCATION_OVERLAP_DAYS
value: "2"
- name: COST_INSIGHT_SYNC_PAGE_SIZE
value: "5000"
resources:
requests:
cpu: "500m"
memory: 1Gi
limits:
cpu: "2"
memory: 4Gi
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: cost-insight-sync-gcs-cache-last-seen
namespace: apps
Expand Down