feat(ollama): add internal Ollama service with gemma3:270m in nxtgauge-ai namespace

- Add namespace, PVC, deployment, service, and kustomization for Ollama
- ClusterIP only (internal), no ingress
- 10Gi PVC mounted at /root/.ollama
- Resource limits: 700Mi-1500Mi memory, 500m-1000m CPU
- Add ArgoCD Application CR for ollama
- Update backend configmap with OLLAMA_BASE_URL and OLLAMA_CHAT_MODEL
This commit is contained in:
Ashwin Kumar Sivakumar 2026-04-15 23:21:05 +05:30
parent 16aaaa7f45
commit 9ddc57c2e2
7 changed files with 99 additions and 0 deletions

View file

@ -25,3 +25,5 @@ data:
CATERING_SERVICES_SERVICE_URL: "http://nxtgauge-rust-catering-services:9115" CATERING_SERVICES_SERVICE_URL: "http://nxtgauge-rust-catering-services:9115"
PAYMENTS_SERVICE_URL: "http://nxtgauge-rust-payments:9116" PAYMENTS_SERVICE_URL: "http://nxtgauge-rust-payments:9116"
UGC_CONTENT_CREATORS_SERVICE_URL: "http://nxtgauge-rust-ugc-content-creators:9117" UGC_CONTENT_CREATORS_SERVICE_URL: "http://nxtgauge-rust-ugc-content-creators:9117"
OLLAMA_BASE_URL: "http://ollama.nxtgauge-ai.svc.cluster.local:11434"
OLLAMA_CHAT_MODEL: "gemma3:270m"

View file

@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ollama
namespace: nxtgauge-ai
labels:
app: ollama
spec:
replicas: 1
selector:
matchLabels:
app: ollama
template:
metadata:
labels:
app: ollama
spec:
containers:
- name: ollama
image: ollama/ollama:latest
ports:
- containerPort: 11434
name: http
env:
- name: OLLAMA_HOST
value: "0.0.0.0:11434"
volumeMounts:
- name: ollama-models
mountPath: /root/.ollama
resources:
requests:
cpu: 500m
memory: 700Mi
limits:
cpu: 1000m
memory: 1500Mi
volumes:
- name: ollama-models
persistentVolumeClaim:
claimName: ollama-models

View file

@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- pvc.yaml
- deployment.yaml
- service.yaml

View file

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: nxtgauge-ai

11
apps/ollama/base/pvc.yaml Normal file
View file

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ollama-models
namespace: nxtgauge-ai
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

View file

@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: ollama
namespace: nxtgauge-ai
labels:
app: ollama
spec:
type: ClusterIP
ports:
- port: 11434
targetPort: 11434
name: http
selector:
app: ollama

View file

@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ollama
namespace: argocd
spec:
destination:
namespace: nxtgauge-ai
server: https://kubernetes.default.svc
project: default
source:
path: apps/ollama/base
repoURL: https://github.com/Traceworks2023/nxtgauge-gitops.git
targetRevision: main
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true