| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: ollama-service | |
| spec: | |
| selector: | |
| app: ollama | |
| ports: | |
| - protocol: TCP | |
| port: 7860 | |
| targetPort: 7860 | |
| nodePort: 30786 | |
| type: NodePort | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: ollama-deployment | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: ollama | |
| template: | |
| metadata: | |
| labels: | |
| app: ollama | |
| spec: | |
| containers: | |
| - name: ollama | |
| image: docker.io/library/ollama-local:latest | |
| # Never forces K8s to use the local image or fail immediately (no network pull) | |
| imagePullPolicy: Never | |
| ports: | |
| - containerPort: 7860 | |
| resources: | |
| requests: | |
| memory: "4Gi" | |
| cpu: "2" | |
| limits: | |
| memory: "8Gi" | |
| cpu: "4" | |