11# Chatbot GitOps: OpenWebUI + Ollama on MicroK8s
22
3- ## What it is
4- A GitOps deployment repository for running the chatbot stack on Kubernetes (OpenWebUI + Ollama).
3+ GitOps deployment repo for the in-cluster chatbot stack managed by Argo CD.
54
6- ## What it does
7- - Stores Kubernetes manifests and overlays for chatbot infrastructure.
8- - Enables declarative delivery through Argo CD.
9- - Separates deploy/runtime configuration from application source code.
5+ ## What this repo controls
106
11- ## Why it matters
12- It enforces repeatable, reviewable operations and makes chatbot environment changes auditable through Git history.
7+ - Kubernetes manifests for Ollama and Open WebUI.
8+ - ` chatbot ` namespace runtime for local LLM chat.
9+ - Argo CD reconciliation from ` main ` .
1310
14- This repository contains Kubernetes manifests for deploying a local LLM stack with Argo CD and Kustomize on a MicroK8s-style cluster.
11+ ## Current architecture (as of 2026-02-22)
1512
16- ## Current deployed architecture
13+ Runtime components in ` chatbot ` namespace:
1714
18- The active deployment includes only:
15+ - ` Deployment/ollama `
16+ - ` Deployment/openwebui `
17+ - ` Service/ollama ` (` 11434/TCP ` )
18+ - ` Service/openwebui ` (` 80/TCP ` )
19+ - ` Ingress/openwebui ` host: ` webui.172.17.93.185.nip.io `
1920
20- - ** Ollama** : in-cluster LLM runtime + HTTP API at ` http://ollama:11434 `
21- - ** OpenWebUI** : the only user-facing web UI; it calls Ollama via in-cluster DNS
21+ Active traffic path:
2222
23- Runtime flow:
23+ 1 . Browser -> ` webui.172.17.93.185.nip.io `
24+ 2 . Open WebUI -> ` http://finops-api.llm-finops.svc.cluster.local/proxy `
25+ 3 . FinOps proxy -> ` http://ollama.chatbot.svc.cluster.local:11434 `
2426
25- 1 . User opens OpenWebUI through ingress.
26- 2 . OpenWebUI sends model requests to ` http://ollama:11434 ` .
27- 3 . Argo CD reconciles manifests from this repo.
27+ This path is required for FinOps token/cost attribution.
2828
29- ## Repo layout
30-
31- - ` overlays/dev-ollama/ ` : deploys only Ollama + OpenWebUI (PVCs, Services, and OpenWebUI Ingress).
32- - ` base/ ` : deprecated legacy manifests; not used by ` overlays/dev-ollama ` .
33-
34- ## Ingress exposure (dev)
35-
36- Ingress exposes ** only OpenWebUI** (no chatbot ingress).
37-
38- Use this hostname pattern:
29+ ## Important cleanup state
3930
40- - ` webui.<WSLIP>.nip.io `
31+ - Duplicate Open WebUI stack in ` default ` namespace was removed.
32+ - Host collision on ` webui.172.17.93.185.nip.io ` resolved.
33+ - One-shot ` ollama-model-pull ` Job was removed from desired state (` kustomization.yaml ` ) to avoid persistent completed zombie jobs.
4134
42- Get ` WSLIP ` in WSL:
35+ ## Repo layout
4336
44- ``` bash
45- hostname -I | awk ' {print $1}'
46- ```
37+ - ` overlays/dev-ollama/ ` : active overlay used by Argo.
38+ - ` base/ ` : legacy/deprecated; not used by active app path.
4739
4840## Deploy with Argo CD
4941
50- Create an Argo CD ` Application ` pointing at the dev overlay :
42+ Use :
5143
52- - ** Repo URL ** : your fork/remote for this repository
53- - ** Path** : ` overlays/dev-ollama `
54- - ** Destination namespace ** : ` chatbot `
55- - ** Target revision ** : ` main ` (or your branch)
44+ - Repo: ` https://github.com/dwetmore/chatbot-gitops.git `
45+ - Path: ` overlays/dev-ollama `
46+ - Namespace : ` chatbot `
47+ - Revision : ` main `
5648
57- Example:
49+ Example ` Application ` :
5850
5951``` yaml
6052apiVersion : argoproj.io/v1alpha1
6153kind : Application
6254metadata :
63- name : chatbot-gitops
55+ name : chatbot
6456 namespace : argocd
6557spec :
6658 project : default
@@ -75,52 +67,55 @@ spec:
7567 automated :
7668 prune : true
7769 selfHeal : true
70+ syncOptions :
71+ - CreateNamespace=true
7872` ` `
7973
80- Apply and sync:
74+ ## Validate deployment
8175
8276` ` ` bash
83- kubectl apply -f application.yaml
84- argocd app sync chatbot-gitops
77+ microk8s kubectl get deploy,svc,ingress -n chatbot
78+ microk8s kubectl get pods -n chatbot
79+ microk8s kubectl -n chatbot get deploy openwebui -o yaml | rg 'OLLAMA_BASE_URL|value:'
8580```
8681
87- ## Pre-pull Ollama models with a Job
88-
89- The dev overlay includes:
90-
91- - ` ConfigMap/ollama-models ` with a ` models.txt ` list of models to pull.
92- - ` Job/ollama-model-pull ` that reads ` models.txt ` and runs ` ollama pull ` for each entry.
82+ Expected ` OLLAMA_BASE_URL ` :
9383
94- Update the model list by editing ` overlays/dev-ollama/ollama-models-configmap.yaml ` and changing ` data.models.txt ` .
84+ - ` http://finops-api.llm-finops.svc.cluster.local/proxy `
9585
96- Trigger the model-pull Job:
86+ ## Operations
9787
9888``` bash
99- kubectl delete job ollama-model-pull -n chatbot --ignore-not-found
100- kubectl apply -k overlays/dev-ollama
101- kubectl logs job/ollama-model-pull -n chatbot -f
89+ microk8s kubectl logs deploy/openwebui -n chatbot --tail=200 -f
90+ microk8s kubectl logs deploy/ollama -n chatbot --tail=200 -f
91+ microk8s kubectl rollout restart deploy/openwebui -n chatbot
92+ microk8s kubectl rollout restart deploy/ollama -n chatbot
10293```
10394
104- Check completion:
95+ ## Optional one-off model pre-pull
10596
106- ``` bash
107- kubectl get job ollama-model-pull -n chatbot
108- ```
97+ ` overlays/dev-ollama/ollama-model-pull-job.yaml ` is intentionally not in ` kustomization.yaml ` .
98+ Use it only as an ad-hoc action.
10999
110- ## Validate
100+ Run manually when needed:
111101
112102``` bash
113- kubectl get pods -n chatbot
114- kubectl get svc -n chatbot
115- kubectl get ingress -n chatbot
116- kubectl describe ingress openwebui -n chatbot
103+ microk8s kubectl -n chatbot apply -f overlays/dev-ollama/ollama-model-pull-job.yaml
104+ microk8s kubectl -n chatbot logs job/ollama-model-pull -f
105+ microk8s kubectl -n chatbot delete job ollama-model-pull
117106```
118107
119- ## Operations
108+ Edit model list in:
120109
121- ``` bash
122- kubectl logs deploy/openwebui -n chatbot --tail=100 -f
123- kubectl logs deploy/ollama -n chatbot --tail=100 -f
124- kubectl rollout restart deploy/openwebui -n chatbot
125- kubectl rollout restart deploy/ollama -n chatbot
126- ```
110+ - ` overlays/dev-ollama/models.txt `
111+
112+ ## Troubleshooting
113+
114+ If Open WebUI responds but FinOps dashboard shows no new cost:
115+
116+ 1 . Confirm Open WebUI is routing to FinOps proxy (env var above).
117+ 2 . Confirm FinOps upstream points to chatbot Ollama service.
118+ 3 . Confirm pricing rules exist for emitted model/provider.
119+ 4 . Run FinOps metering for the period you are viewing.
120+
121+ If Argo keeps reverting a manual change, commit to Git and sync; do not patch live-only.
0 commit comments