mirror of
https://github.com/wahyd4/home-docker.git
synced 2026-08-08 20:15:03 +10:00
81 lines
1.5 KiB
YAML
81 lines
1.5 KiB
YAML
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: ollama-pvc
|
|
namespace: ai
|
|
labels:
|
|
app: ollama
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: local-path
|
|
resources:
|
|
requests:
|
|
storage: 50Gi # 增加容量以支持更多模型
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ollama
|
|
namespace: ai
|
|
labels:
|
|
app: ollama
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: ollama
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ollama
|
|
spec:
|
|
containers:
|
|
- name: ollama
|
|
image: ollama/ollama:latest
|
|
ports:
|
|
- containerPort: 11434
|
|
name: ollama-port
|
|
env:
|
|
- name: OLLAMA_MODELS
|
|
value: /root/.ollama/models
|
|
resources:
|
|
requests:
|
|
cpu: "500m"
|
|
memory: "2Gi"
|
|
limits:
|
|
cpu: "2"
|
|
memory: "4Gi"
|
|
volumeMounts:
|
|
- name: ollama-data
|
|
mountPath: /root/.ollama
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 11434
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 11434
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
volumes:
|
|
- name: ollama-data
|
|
persistentVolumeClaim:
|
|
claimName: ollama-pvc
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ollama-service
|
|
namespace: ai
|
|
spec:
|
|
selector:
|
|
app: ollama
|
|
ports:
|
|
- protocol: TCP
|
|
port: 11434
|
|
targetPort: 11434
|