feat: add news-scan deployment

This commit is contained in:
deepkoluguri 2026-06-12 10:02:00 -04:00
parent f02e24c025
commit 15a4f929c2
2 changed files with 127 additions and 0 deletions

View File

@ -3,6 +3,7 @@ kind: Kustomization
resources: resources:
- gumbo-externalsecrets.yaml - gumbo-externalsecrets.yaml
- static-demo.yaml - static-demo.yaml
- news-scan-deployment.yaml
- gumbo-schema-init.yaml - gumbo-schema-init.yaml
- gumbo-worker-deployment.yaml - gumbo-worker-deployment.yaml
- bernard-externalsecret.yaml - bernard-externalsecret.yaml

View File

@ -0,0 +1,126 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: news-scan-pvc
namespace: ai-agents
spec:
accessModes: [ReadWriteOnce]
storageClassName: longhorn
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: news-scan
namespace: ai-agents
labels:
app: news-scan
spec:
replicas: 1
selector:
matchLabels:
app: news-scan
template:
metadata:
labels:
app: news-scan
spec:
initContainers:
- name: git-clone
image: alpine/git
command:
- git
- clone
- http://192.168.8.248:3000/deepkoluguri/sundeep-news-scan.git
- /app
volumeMounts:
- name: app-code
mountPath: /app
containers:
- name: news-scan
image: python:3.11-slim
workingDir: /app
command:
- sh
- -c
- |
apt-get update && apt-get install -y libgl1 libglib2.0-0 tesseract-ocr tesseract-ocr-tel
pip install -r requirements.txt gunicorn
# Create symlinks so app writes to PVC
rm -rf /app/uploads /app/output
ln -s /data/uploads /app/uploads
ln -s /data/output /app/output
# Run the web server
gunicorn --bind 0.0.0.0:5000 app:app --timeout 600
ports:
- containerPort: 5000
env:
- name: PYTHONUNBUFFERED
value: "1"
# --- Google Drive Sync Placeholders ---
- name: ENABLE_GDRIVE_SYNC
value: "false" # Set to "true" to enable
- name: GDRIVE_CREDENTIALS_JSON
value: "" # Placeholder for service account JSON
- name: GDRIVE_FOLDER_ID
value: "" # Placeholder for target Google Drive folder ID
volumeMounts:
- name: app-code
mountPath: /app
- name: data-volume
mountPath: /data
resources:
requests:
cpu: 500m
memory: 1Gi
limits:
cpu: 2000m
memory: 4Gi
volumes:
- name: app-code
emptyDir: {}
- name: data-volume
persistentVolumeClaim:
claimName: news-scan-pvc
---
apiVersion: v1
kind: Service
metadata:
name: news-scan
namespace: ai-agents
spec:
selector:
app: news-scan
ports:
- port: 5000
targetPort: 5000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: news-scan-ingress
namespace: ai-agents
annotations:
k8s.apisix.apache.org/proxy-timeout-connect: "300s"
k8s.apisix.apache.org/proxy-timeout-read: "300s"
k8s.apisix.apache.org/proxy-timeout-send: "300s"
spec:
ingressClassName: apisix
rules:
- host: newsupdate.applaude.net
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: news-scan
port:
number: 5000
tls:
- hosts:
- newsupdate.applaude.net
secretName: newsupdate-tls