Add new infra architecture
This commit is contained in:
68
infrastructure/services/microservices/external/cronjobs/external-data-rotation-cronjob.yaml
vendored
Normal file
68
infrastructure/services/microservices/external/cronjobs/external-data-rotation-cronjob.yaml
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
# infrastructure/kubernetes/base/cronjobs/external-data-rotation-cronjob.yaml
|
||||
# Monthly CronJob to rotate 24-month sliding window (runs 1st of month at 2am UTC)
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: external-data-rotation
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app: external-service
|
||||
component: data-rotation
|
||||
spec:
|
||||
schedule: "0 2 1 * *"
|
||||
|
||||
successfulJobsHistoryLimit: 3
|
||||
failedJobsHistoryLimit: 3
|
||||
|
||||
concurrencyPolicy: Forbid
|
||||
|
||||
jobTemplate:
|
||||
metadata:
|
||||
labels:
|
||||
app: external-service
|
||||
job: data-rotation
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: dockerhub-creds
|
||||
ttlSecondsAfterFinished: 172800
|
||||
backoffLimit: 2
|
||||
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: external-service
|
||||
cronjob: data-rotation
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
||||
containers:
|
||||
- name: data-rotator
|
||||
image: bakery/external-service:latest
|
||||
imagePullPolicy: Always
|
||||
|
||||
command:
|
||||
- python
|
||||
- -m
|
||||
- app.jobs.rotate_data
|
||||
|
||||
args:
|
||||
- "--log-level=INFO"
|
||||
- "--notify-slack=true"
|
||||
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: bakery-config
|
||||
- secretRef:
|
||||
name: database-secrets
|
||||
- secretRef:
|
||||
name: external-api-secrets
|
||||
- secretRef:
|
||||
name: monitoring-secrets
|
||||
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "1Gi"
|
||||
cpu: "500m"
|
||||
Reference in New Issue
Block a user