KubeKanvas Logo
  • Features
  • Pricing
  • Templates
    • How KubeKanvas works
    • Docs
    • Downloads
    • Blog
    • E-Book
    • Tutorials
  • FAQs
  • Contact
  • Features
  • Pricing
  • Templates
    • How KubeKanvas works
    • Docs
    • Downloads
    • Blog
    • E-Book
    • Tutorials
  • FAQs
  • Contact
Back to Templates

Deploy DeepSeek R2 + Ollama on Kubernetes: Local AI Stack

Deploy DeepSeek R2 + Ollama on Kubernetes: Local AI Stack

Running a local LLM requires a model server, persistent weight storage, and a browser interface behind an ingress. This template deploys DeepSeek R2 via Ollama with Open WebUI on Kubernetes, producing an offline-capable AI stack accessible at a local domain.

What's Included

ComponentTypePortRole
NamespaceNamespace-Isolates all resources under deepseek
ollama-ds-pvPersistentVolume-30 GB hostPath volume for model weights
ollama-ds-pvcPersistentVolumeClaim-Binds Ollama to model storage
webui-ds-pvPersistentVolume-5 GB hostPath volume for WebUI data
webui-ds-pvcPersistentVolumeClaim-Binds WebUI to its data storage
ollama-ds-configConfigMap-Ollama runtime env vars
webui-ds-configConfigMap-Open WebUI env vars
ollamaDeployment11434Ollama inference server running DeepSeek R2
ollama-ds-serviceService (NodePort)11434 / 30112Exposes Ollama internally and via NodePort
open-webuiDeployment8080Browser chat interface
open-webui-serviceService (NodePort)8080 / 30081Exposes WebUI internally and via NodePort
nginxIngressClass-Declares NGINX as default ingress class
deepseek-ingressIngress80Routes deepseek.local to WebUI, ollama-ds.local to API
open-webui-hpaHorizontalPodAutoscaler-Scales WebUI on CPU or memory pressure
deepseek-quotaResourceQuota-Caps CPU, memory, and pod count in namespace
deepseek-limitsLimitRange-Sets per-container resource defaults and ceilings
ollama-network-policyNetworkPolicy11434Restricts Ollama to WebUI pods and ingress controller

Architecture Overview

Ollama runs as a single replica with a 30 GB PersistentVolume for model weights. An init container pulls DeepSeek R2 on first boot using the Ollama CLI directly. Open WebUI reaches Ollama via internal ClusterIP DNS. NGINX Ingress routes deepseek.local to the WebUI and ollama-ds.local to the raw API, with buffering off for token streaming. A NetworkPolicy restricts Ollama to WebUI pods and the ingress controller only.

Prerequisites

  • Docker Desktop with Kubernetes enabled and WSL2 configured with at least 12 GB memory via .wslconfig
  • NGINX Ingress Controller deployed in the ingress-nginx namespace
  • 127.0.0.1 deepseek.local ollama-ds.local added to C:\Windows\System32\drivers\etc\hosts
  • KubeKanvas CLI installed and running on your computer (Optional, if you want to use one-click deployment)

How to Deploy

  1. Confirm the NGINX Ingress Controller pod is running in ingress-nginx before applying.
  2. Verify .wslconfig sets memory=12GB and restart Docker Desktop if you changed it.
  3. Update the hostPath.path values in both PersistentVolume specs to match your storage path. Kubernetes creates the directories automatically on first mount.
  4. Deploy the template to your cluster via the Play button in the top right bar. If you prefer to deploy manually, download the YAML and apply it with kubectl apply -f deepseek-k8s-final.yaml.
  5. Wait for all pods to reach Running status. You can monitor progress in the Release Monitor screen.

How to Test

  1. Run kubectl logs -n deepseek -l app=ollama -c model-puller -f and confirm Pull complete and Init done appear before the main container starts.
  2. Open http://deepseek.local and confirm the Open WebUI interface loads.
  3. Send a message and confirm DeepSeek R2 responds with streamed tokens.
  4. Hit http://ollama-ds.local/api/tags and confirm the JSON response lists deepseek-r2.

Use Cases

  • Offline LLM development: Test prompts against DeepSeek R2 with no internet or API token after the initial pull.
  • Private code assistance: Point Continue.dev or any OpenAI-compatible client at http://ollama-ds.local for local inference with no data leaving the machine.
  • Kubernetes learning: Study a realistic manifest covering PVs, init containers, Ingress, HPA, NetworkPolicy, ResourceQuota, and LimitRange in one deployable file.
  • Air-gapped environments: Pre-pull weights to the hostPath volume and deploy on a machine with no outbound internet.
  • Multi-user setups: Enable Open WebUI signup so multiple developers share one inference server with isolated chat history.

Summary

This template configures a 17-resource Kubernetes stack that runs DeepSeek R2 via Ollama, exposes it through a streaming-optimized NGINX Ingress, and enforces namespace-level resource and network controls.

Tags:
DeepSeekkuberneteskubekanvasLLMAI
Created by:
Siddiqui
Deploy DeepSeek R2 + Ollama on Kubernetes: Local AI Stack template preview
0 uses
KubeKanvas Logo
Visual Kubernetes cluster design tool that helps you create, manage, and deploy your applications with ease.
Product
  • Features
  • Pricing
  • Templates
Resources
  • Blog
  • Tutorials
Company
  • About Us
  • Contact
  • Terms of Service
  • Privacy Policy
  • Impressum
XGitHubLinkedIn
© 2026 KubeKanvas. All rights reserved.