Skip to content

Commit

Permalink
feat(monitoring): label k8s CronJobs to facilitate monitoring
Browse files Browse the repository at this point in the history
This commit adds `cronLastSuccessfulTimeMins` labels to each CronJob
with 3x the scheduled interval.
  • Loading branch information
andrewpollock committed Feb 5, 2025
1 parent eb29faa commit d6a9b4b
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: alias-computation
labels:
cronLastSuccessfulTimeMins: 45
spec:
schedule: "10/15 * * * *"
concurrencyPolicy: Forbid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: alpine-cve-convert
labels:
cronLastSuccessfulTimeMins: 180
spec:
schedule: "0 */1 * * *"
concurrencyPolicy: Forbid
Expand Down
2 changes: 2 additions & 0 deletions deployment/clouddeploy/gke-workers/base/backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: backup
labels:
cronLastSuccessfulTimeMins: 2880
spec:
schedule: "0 18 * * *"
concurrencyPolicy: Forbid
Expand Down
2 changes: 2 additions & 0 deletions deployment/clouddeploy/gke-workers/base/combine-to-osv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: combine-to-osv
labels:
cronLastSuccessfulTimeMins: 90
spec:
schedule: "30 */1 * * *"
concurrencyPolicy: Forbid
Expand Down
2 changes: 2 additions & 0 deletions deployment/clouddeploy/gke-workers/base/cpe-repo-gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: cpe-repo-gen
labels:
cronLastSuccessfulTimeMins: 2880
spec:
schedule: "0 6 */1 * *"
concurrencyPolicy: Forbid
Expand Down
2 changes: 2 additions & 0 deletions deployment/clouddeploy/gke-workers/base/debian-convert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: debian-convert
labels:
cronLastSuccessfulTimeMins: 180
spec:
schedule: "0 */1 * * *"
concurrencyPolicy: Forbid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: debian-copyright-mirror
labels:
cronLastSuccessfulTimeMins: 2880
spec:
schedule: "0 6 */1 * *"
concurrencyPolicy: Forbid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: debian-cve-convert
labels:
cronLastSuccessfulTimeMins: 120
spec:
schedule: "0 */1 * * *"
concurrencyPolicy: Forbid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: debian-first-version
labels:
cronLastSuccessfulTimeMins: 120
spec:
schedule: "0 1 * * *"
concurrencyPolicy: Forbid
Expand Down
2 changes: 2 additions & 0 deletions deployment/clouddeploy/gke-workers/base/exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: exporter
labels:
cronLastSuccessfulTimeMins: 90
spec:
schedule: "*/30 * * * *"
concurrencyPolicy: Forbid
Expand Down
2 changes: 2 additions & 0 deletions deployment/clouddeploy/gke-workers/base/generate-sitemap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: generate-sitemap
labels:
cronLastSuccessfulTimeMins: 2880
spec:
schedule: "30 8 * * *"
concurrencyPolicy: Forbid
Expand Down
2 changes: 2 additions & 0 deletions deployment/clouddeploy/gke-workers/base/importer-deleter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: importer-deleter
labels:
cronLastSuccessfulTimeMins: 360
spec:
schedule: "* */3 * * *"
concurrencyPolicy: Forbid
Expand Down
2 changes: 2 additions & 0 deletions deployment/clouddeploy/gke-workers/base/importer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: importer
labels:
cronLastSuccessfulTimeMins: 90
spec:
schedule: "*/15 * * * *"
concurrencyPolicy: Forbid
Expand Down
2 changes: 2 additions & 0 deletions deployment/clouddeploy/gke-workers/base/nvd-cve-osv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: nvd-cve-osv
labels:
cronLastSuccessfulTimeMins: 86400
spec:
timeZone: Australia/Sydney
schedule: "0 6,13 * * *"
Expand Down
2 changes: 2 additions & 0 deletions deployment/clouddeploy/gke-workers/base/nvd-mirror.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: nvd-mirror
labels:
cronLastSuccessfulTimeMins: 240
spec:
schedule: "0 */2 * * *"
concurrencyPolicy: Forbid
Expand Down

0 comments on commit d6a9b4b

Please sign in to comment.