apps(sirius-growth): sgs-leadgen weekly CronJob (ET) + monthly NCDA job + state PVC
Runs the published amd64 image forgejo.../sgs-leadgen:eef9358 with DATABASE_URL from sirius-growth-portal-app and the contact bot's Telegram pair; /data on a local-path PVC pins to siriussec, /tmp on an emptyDir so the root fs stays RO.
This commit is contained in:
parent
d5193c2525
commit
45c3b8533b
4 changed files with 185 additions and 0 deletions
85
apps/base/sirius-growth/cronjob-leadgen-ncda.yaml
Normal file
85
apps/base/sirius-growth/cronjob-leadgen-ncda.yaml
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: sgs-leadgen-ncda
|
||||
namespace: sirius-growth
|
||||
spec:
|
||||
# 10:00, not 08:00: on a Monday-the-1st the weekly job owns the RWO volume at
|
||||
# 08:00 and concurrencyPolicy is per-CronJob, so a 2h gap keeps them apart.
|
||||
schedule: "0 10 1 * *"
|
||||
timeZone: America/New_York
|
||||
concurrencyPolicy: Forbid
|
||||
startingDeadlineSeconds: 3600
|
||||
suspend: false
|
||||
successfulJobsHistoryLimit: 3
|
||||
failedJobsHistoryLimit: 3
|
||||
jobTemplate:
|
||||
spec:
|
||||
backoffLimit: 1
|
||||
activeDeadlineSeconds: 1800
|
||||
ttlSecondsAfterFinished: 604800
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: sgs-leadgen-ncda
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
nodeSelector:
|
||||
kubernetes.io/hostname: siriussec
|
||||
tolerations:
|
||||
- key: dedicated
|
||||
operator: Exists
|
||||
effect: PreferNoSchedule
|
||||
securityContext:
|
||||
fsGroup: 10001
|
||||
containers:
|
||||
- name: leadgen
|
||||
image: forgejo.siriusdevops.com/sirius/sgs-leadgen:eef935874bb19b6cee73bd93d7fd9ab4001ec184
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: sirius-growth-portal-app
|
||||
key: database-url
|
||||
- name: TELEGRAM_BOT_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: sirius-growth-contact
|
||||
key: TG_TOKEN
|
||||
- name: TELEGRAM_CHAT_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: sirius-growth-contact
|
||||
key: TG_CHAT
|
||||
- name: SGS_DATA_DIR
|
||||
value: /data
|
||||
- name: SGS_STATE_PATH
|
||||
value: /data/state.json
|
||||
- name: SGS_CSV
|
||||
value: /data/leads.csv
|
||||
# Monthly-only source: the NCDA&CS licensed-nursery register.
|
||||
- name: SGS_NCDA
|
||||
value: "1"
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
- name: tmp
|
||||
mountPath: /tmp
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: true
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
memory: 1Gi
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: sgs-leadgen-data
|
||||
- name: tmp
|
||||
emptyDir:
|
||||
sizeLimit: 256Mi
|
||||
Loading…
Reference in a new issue