gcloud-lab/apps/base/customer1/news_bot/analyst-cronjob.yaml

63 lines
1.8 KiB
YAML
Raw Normal View History

2026-01-13 04:27:16 +00:00
apiVersion: batch/v1
2026-02-03 01:56:09 +00:00
kind: CronJob
2026-01-13 04:27:16 +00:00
metadata:
2026-02-03 01:56:09 +00:00
name: analyst-gemma
namespace: customer1
2026-01-13 04:27:16 +00:00
spec:
2026-02-03 01:56:09 +00:00
schedule: "15 * * * *"
2026-01-13 04:27:16 +00:00
jobTemplate:
spec:
template:
2026-02-03 01:56:09 +00:00
spec:
2026-01-16 20:33:37 +00:00
volumes:
- name: ollama-storage
persistentVolumeClaim:
claimName: ollama-storage
2026-01-16 20:33:37 +00:00
initContainers:
- name: model-puller
image: ollama/ollama:latest
volumeMounts:
2026-02-03 01:56:09 +00:00
- name: ollama-storage
2026-01-16 20:33:37 +00:00
mountPath: /root/.ollama
command: ["/bin/sh", "-c"]
args: ["ollama serve & sleep 5 && ollama pull qwen3:30b"]
2026-01-13 04:27:16 +00:00
2026-02-03 01:56:09 +00:00
- name: ollama-sidecar
image: ollama/ollama:latest
restartPolicy: Always # This is the magic
2026-02-03 15:05:21 +00:00
env:
- name: OLLAMA_DEBUG
value: "2"
- name: OLLAMA_LOG_LEVEL
value: "DEBUG"
2026-02-03 01:56:09 +00:00
ports:
- containerPort: 11434
volumeMounts:
- name: ollama-storage
mountPath: /root/.ollama
resources:
limits:
nvidia.com/gpu: 1
2026-01-16 20:33:37 +00:00
containers:
2026-02-03 01:56:09 +00:00
- name: analyst
2026-02-06 02:41:40 +00:00
image: siriussec/summarizerlocal:2.2
2026-02-03 15:05:21 +00:00
imagePullPolicy: Always
2026-02-03 01:56:09 +00:00
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: news-user-password
key: password
envFrom:
- configMapRef:
2026-02-03 15:05:21 +00:00
name: gemma-config
2026-02-03 01:56:09 +00:00
# Make sure your summarizer script talks to http://localhost:11434
# (or http://127.0.0.1:11434)
restartPolicy: OnFailure