Skip to content

Instantly share code, notes, and snippets.

@rti
Last active September 27, 2024 21:31
Show Gist options
  • Select an option

  • Save rti/f189e7493523d1bbfabb869712301f2f to your computer and use it in GitHub Desktop.

Select an option

Save rti/f189e7493523d1bbfabb869712301f2f to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: ollama-rocm
spec:
replicas: 2
selector:
matchLabels:
app: ollama-rocm
template:
metadata:
labels:
app: ollama-rocm
spec:
containers:
- name: ollama1
image: ollama/ollama:rocm
env:
- name: OLLAMA_HOST
value: "0.0.0.0:11434"
ports:
- containerPort: 11434
name: ollama1
volumeMounts:
- name: ollama-data
mountPath: /root/.ollama
resources:
requests:
memory: "6Gi"
cpu: "2"
amd.com/gpu: 1
limits:
memory: "10Gi"
cpu: "4"
amd.com/gpu: 1
- name: ollama2
image: ollama/ollama:rocm
env:
- name: OLLAMA_HOST
value: "0.0.0.0:11435"
ports:
- containerPort: 11435
name: ollama2
volumeMounts:
- name: ollama-data
mountPath: /root/.ollama
resources:
requests:
memory: "6Gi"
cpu: "2"
amd.com/gpu: 1
limits:
memory: "10Gi"
cpu: "4"
amd.com/gpu: 1
volumes:
- name: ollama-data
hostPath:
path: /var/lib/ollama/.ollama
type: DirectoryOrCreate
---
apiVersion: v1
kind: Service
metadata:
name: ollama-service-rocm
spec:
selector:
app: ollama-rocm
ports:
- protocol: TCP
port: 11434
targetPort: 11434
name: ollama1
- protocol: TCP
port: 11435
targetPort: 11435
name: ollama2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment