74 lines
2.0 KiB
YAML
74 lines
2.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ollama
|
|
namespace: ollama
|
|
labels:
|
|
app: ollama
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: ollama
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ollama
|
|
spec:
|
|
# CPU-only Ollama running on Hetzner nodes. No GPU available.
|
|
containers:
|
|
- name: ollama
|
|
image: ollama/ollama:0.32.4
|
|
imagePullPolicy: IfNotPresent
|
|
env:
|
|
- name: OLLAMA_HOST
|
|
value: "0.0.0.0:11434"
|
|
# Optional: keep models loaded for N minutes after last use (e.g. 15m).
|
|
# - name: OLLAMA_KEEP_ALIVE
|
|
# value: "15m"
|
|
# Ollama Cloud API key for cloud models. Create the ollama-cloud Secret
|
|
# from ollama_secret_example.yaml, or sign in with `ollama signin`.
|
|
- name: OLLAMA_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ollama-cloud
|
|
key: OLLAMA_API_KEY
|
|
optional: true
|
|
ports:
|
|
- containerPort: 11434
|
|
name: http
|
|
protocol: TCP
|
|
# OllamaCloud-only: no local model execution, so CPU/RAM needs are minimal.
|
|
resources:
|
|
requests:
|
|
cpu: "100m"
|
|
memory: 512Mi
|
|
limits:
|
|
cpu: "1"
|
|
memory: 1Gi
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 11434
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 30
|
|
timeoutSeconds: 5
|
|
failureThreshold: 6
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 11434
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 6
|
|
volumeMounts:
|
|
- name: ollama-state
|
|
mountPath: /root/.ollama
|
|
volumes:
|
|
- name: ollama-state
|
|
persistentVolumeClaim:
|
|
claimName: ollama-state
|