Review: Scale down k8s Ollama to free GPU

review-1650-2026-06-28 Review

review needs-refinement

Verdict: NEEDS_REFINEMENT

Template Completeness

  • [x] Type -- Feature
  • [x] Lineage
  • [x] Repo
  • [x] User Story
  • [x] Context
  • [ ] File Targets -- present but vague, no specific file path
  • [x] Feature Flag -- "none"
  • [x] Acceptance Criteria -- 3 items
  • [x] Test Expectations -- 2 items
  • [x] Constraints
  • [ ] Checklist -- missing "Tests pass" item from template
  • [x] Related

Traceability

  • [x] story:gpu-freedom label -- GPU Freedom story
  • [ ] story note on project page -- story note story-pal-e-world-gpu-freedom EXISTS in pal-e-docs but is NOT listed in the project-pal-e-world user-stories table. [SCOPE] Add gpu-freedom entry to project-pal-e-world user-stories section.
  • [x] arch:k3s label -- k3s infrastructure
  • [ ] arch note MISSING -- no arch-k3s note found in pal-e-docs. [SCOPE] Create architecture note arch-k3s for k3s component. Alternatively, consider whether arch:ollama is a more accurate label (prior review review-1552-2026-06-22-r2 used arch:ollama for similar Ollama work).
  • [x] Forgejo issue -- ldraney/pal-e-platform#486, open

File Targets

  • [ ] "K8s Ollama deployment manifest" -- ISSUE: Not a specific file path. The actual Ollama deployment is a Terraform Helm release at terraform/modules/ops/main.tf (resource helm_release.ollama). The file target must specify this path.
  • [x] "pal-e-docs code -- separate Groq migration issue" -- correctly scoped out

Repo Placement

OK. The Ollama Helm release is managed in ldraney/pal-e-platform at terraform/modules/ops/main.tf. Repo assignment is correct. Single repo -- no cross-repo issues needed.

Dependencies

  • Board item #1653 ("Groq API migration for pal-e-docs embeddings", story:gpu-freedom) depends on THIS ticket completing first. The issue Context section acknowledges this: "Groq API replaces Ollama for LLM inference." Sequencing is correct.
  • No items currently in in_progress that block this work.
  • Dependencies are implicitly documented in Context but not explicitly listed.

Acceptance Criteria

ISSUE: The AC reference kubectl scale deployment -n ollama --replicas=0 as the mechanism. However, the Ollama deployment is Terraform-managed via helm_release.ollama. A manual kubectl scale would be reverted on the next tofu apply. The AC should describe the Terraform-based approach:
  • Option A: Set replicas = 0 in the Helm values within helm_release.ollama
  • Option B: Add an ollama_enabled variable that conditionally includes the Helm release
  • Option C: Add a count = 0 on the helm_release.ollama resource
The AC for nvidia-smi and graceful degradation are verifiable.

Blast Radius

  • pal-e-docs semantic search -- acknowledged in the issue. Degrades to keyword-only. The project-pal-e-docs page confirms semantic search depends on Ollama (qwen3-embedding:4b). Graceful degradation claim should be verified.
  • NVIDIA device plugin -- separate Helm release in same module, not affected by Ollama scale-down.
  • Salt services state -- salt/states/services/init.sls already has ollama-service: service.dead (host systemd Ollama disabled). No conflict.
  • Embedding worker -- if an embedding worker pod exists that connects to Ollama, it would fail on embedding requests. Issue does not address this -- needs AC for embedding worker behavior.

Decomposition Assessment

1 file target, 3 acceptance criteria, estimated agent work under 5 minutes. No decomposition needed.

Recommendation

  • [BODY] Fix file target: replace "K8s Ollama deployment manifest" with terraform/modules/ops/main.tf (resource helm_release.ollama). Specify the approach: set replicas = 0 in Helm values or add count = var.ollama_enabled ? 1 : 0.
  • [BODY] Fix AC #1: replace kubectl scale with Terraform-based verification (e.g., "tofu apply succeeds with Ollama scaled to 0" or "kubectl get deployment -n ollama shows 0/0 replicas after apply").
  • [BODY] Add "Tests pass" to Checklist section per template.
  • [SCOPE] Add gpu-freedom story entry to project-pal-e-world user-stories table (story note exists but is not registered on the project page).
  • [SCOPE] Create architecture note arch-k3s for k3s component. Or relabel to arch:ollama if preferred (consistent with prior review review-1552-2026-06-22-r2).