From 15a4f929c23156c289d3214c6b62411b63218596 Mon Sep 17 00:00:00 2001 From: deepkoluguri Date: Fri, 12 Jun 2026 10:02:00 -0400 Subject: [PATCH] feat: add news-scan deployment --- agents/k8s/kustomization.yaml | 1 + agents/k8s/news-scan-deployment.yaml | 126 +++++++++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 agents/k8s/news-scan-deployment.yaml diff --git a/agents/k8s/kustomization.yaml b/agents/k8s/kustomization.yaml index 2c14e0a..e9e75bf 100644 --- a/agents/k8s/kustomization.yaml +++ b/agents/k8s/kustomization.yaml @@ -3,6 +3,7 @@ kind: Kustomization resources: - gumbo-externalsecrets.yaml - static-demo.yaml + - news-scan-deployment.yaml - gumbo-schema-init.yaml - gumbo-worker-deployment.yaml - bernard-externalsecret.yaml diff --git a/agents/k8s/news-scan-deployment.yaml b/agents/k8s/news-scan-deployment.yaml new file mode 100644 index 0000000..047c92a --- /dev/null +++ b/agents/k8s/news-scan-deployment.yaml @@ -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