[GH-ISSUE #888] How to deploy on k8s #429

Closed
opened 2026-04-12 10:05:09 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @xinmans on GitHub (Oct 24, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/888

Originally assigned to: @mxyng on GitHub.

Anyone can share some deploymen.yaml ?

Originally created by @xinmans on GitHub (Oct 24, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/888 Originally assigned to: @mxyng on GitHub. Anyone can share some deploymen.yaml ?
GiteaMirror added the documentationfeature request labels 2026-04-12 10:05:09 -05:00
Author
Owner

@Syulin7 commented on GitHub (Oct 26, 2023):

@xinmans This is a example I used for testing.

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: llm
  name: ollama
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: llm
  template:
    metadata:
      labels:
        app.kubernetes.io/name: llm
    spec:
      containers:
        - image: ollama/ollama
          imagePullPolicy: IfNotPresent
          name: llm
          ports:
            - containerPort: 11434
              protocol: TCP
          resources:
            limits:
              nvidia.com/gpu: "1"
            requests:
              nvidia.com/gpu: "1"
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app.kubernetes.io/name: llm
  name: ollama
spec:
  ports:
    - name: "11434"
      port: 11434
      targetPort: 11434
  selector:
    app.kubernetes.io/name: llm
  type: ClusterIP
<!-- gh-comment-id:1780293721 --> @Syulin7 commented on GitHub (Oct 26, 2023): @xinmans This is a example I used for testing. ``` apiVersion: apps/v1 kind: Deployment metadata: labels: app.kubernetes.io/name: llm name: ollama spec: replicas: 1 selector: matchLabels: app.kubernetes.io/name: llm template: metadata: labels: app.kubernetes.io/name: llm spec: containers: - image: ollama/ollama imagePullPolicy: IfNotPresent name: llm ports: - containerPort: 11434 protocol: TCP resources: limits: nvidia.com/gpu: "1" requests: nvidia.com/gpu: "1" --- apiVersion: v1 kind: Service metadata: labels: app.kubernetes.io/name: llm name: ollama spec: ports: - name: "11434" port: 11434 targetPort: 11434 selector: app.kubernetes.io/name: llm type: ClusterIP ```
Author
Owner

@xinmans commented on GitHub (Oct 28, 2023):

@xinmans This is a example I used for testing.

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: llm
  name: ollama
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: llm
  template:
    metadata:
      labels:
        app.kubernetes.io/name: llm
    spec:
      containers:
        - image: ollama/ollama
          imagePullPolicy: IfNotPresent
          name: llm
          ports:
            - containerPort: 11434
              protocol: TCP
          resources:
            limits:
              nvidia.com/gpu: "1"
            requests:
              nvidia.com/gpu: "1"
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app.kubernetes.io/name: llm
  name: ollama
spec:
  ports:
    - name: "11434"
      port: 11434
      targetPort: 11434
  selector:
    app.kubernetes.io/name: llm
  type: ClusterIP

thanks very much, Warning: GPU support may not enabled, check you have installed install GPU drivers: nvidia-smi command failed

Couldn't find '/root/.ollama/id_ed25519'. Generating new private key.
2023-10-28T10:40:10.783453287+08:00 Your new public key is:
2023-10-28T10:40:10.783455847+08:00
2023-10-28T10:40:10.783457668+08:00 ssh-ed25519 xxx/xxx
2023-10-28T10:40:10.783458898+08:00
2023-10-28T10:40:10.783623603+08:00 2023/10/28 02:40:10 images.go:828: total blobs: 0
2023-10-28T10:40:10.783656858+08:00 2023/10/28 02:40:10 images.go:835: total unused blobs removed: 0
2023-10-28T10:40:10.783790279+08:00 2023/10/28 02:40:10 routes.go:662: Listening on [::]:11434 (version 0.1.6)
2023-10-28T10:40:10.784148934+08:00 2023/10/28 02:40:10 routes.go:682: Warning: GPU support may not enabled, check you have installed install GPU drivers: nvidia-smi command failed

<!-- gh-comment-id:1783672581 --> @xinmans commented on GitHub (Oct 28, 2023): > @xinmans This is a example I used for testing. > > ``` > apiVersion: apps/v1 > kind: Deployment > metadata: > labels: > app.kubernetes.io/name: llm > name: ollama > spec: > replicas: 1 > selector: > matchLabels: > app.kubernetes.io/name: llm > template: > metadata: > labels: > app.kubernetes.io/name: llm > spec: > containers: > - image: ollama/ollama > imagePullPolicy: IfNotPresent > name: llm > ports: > - containerPort: 11434 > protocol: TCP > resources: > limits: > nvidia.com/gpu: "1" > requests: > nvidia.com/gpu: "1" > --- > apiVersion: v1 > kind: Service > metadata: > labels: > app.kubernetes.io/name: llm > name: ollama > spec: > ports: > - name: "11434" > port: 11434 > targetPort: 11434 > selector: > app.kubernetes.io/name: llm > type: ClusterIP > ``` thanks very much, Warning: GPU support may not enabled, check you have installed install GPU drivers: nvidia-smi command failed Couldn't find '/root/.ollama/id_ed25519'. Generating new private key. 2023-10-28T10:40:10.783453287+08:00 Your new public key is: 2023-10-28T10:40:10.783455847+08:00 2023-10-28T10:40:10.783457668+08:00 ssh-ed25519 xxx/xxx 2023-10-28T10:40:10.783458898+08:00 2023-10-28T10:40:10.783623603+08:00 2023/10/28 02:40:10 images.go:828: total blobs: 0 2023-10-28T10:40:10.783656858+08:00 2023/10/28 02:40:10 images.go:835: total unused blobs removed: 0 2023-10-28T10:40:10.783790279+08:00 2023/10/28 02:40:10 routes.go:662: Listening on [::]:11434 (version 0.1.6) 2023-10-28T10:40:10.784148934+08:00 2023/10/28 02:40:10 routes.go:682: Warning: GPU support may not enabled, check you have installed install GPU drivers: nvidia-smi command failed
Author
Owner

@Syulin7 commented on GitHub (Nov 3, 2023):

@xinmans Following the issue https://github.com/jmorganca/ollama/issues/797

<!-- gh-comment-id:1791928544 --> @Syulin7 commented on GitHub (Nov 3, 2023): @xinmans Following the issue https://github.com/jmorganca/ollama/issues/797
Author
Owner

@mxyng commented on GitHub (Nov 3, 2023):

There's a basic Kubernetes example in #959 which also describes how to deploy with GPU

<!-- gh-comment-id:1792651098 --> @mxyng commented on GitHub (Nov 3, 2023): There's a basic Kubernetes example in #959 which also describes how to deploy with GPU
Author
Owner

@mxyng commented on GitHub (Nov 12, 2023):

It looks like your pod does not have DNS configured? Adding registry.ollama.ai only allows the registry to be resolved but the download is actually somewhere else (Cloudflare)

<!-- gh-comment-id:1806981165 --> @mxyng commented on GitHub (Nov 12, 2023): It looks like your pod does not have DNS configured? Adding `registry.ollama.ai` only allows the registry to be resolved but the download is actually somewhere else (Cloudflare)
Author
Owner

@xinmans commented on GitHub (Nov 12, 2023):

It looks like your pod does not have DNS configured? Adding registry.ollama.ai only allows the registry to be resolved but the download is actually somewhere else (Cloudflare)

network issue ,have fix. thanks.

<!-- gh-comment-id:1806981370 --> @xinmans commented on GitHub (Nov 12, 2023): > It looks like your pod does not have DNS configured? Adding `registry.ollama.ai` only allows the registry to be resolved but the download is actually somewhere else (Cloudflare) network issue ,have fix. thanks.
Author
Owner

@technovangelist commented on GitHub (Dec 4, 2023):

It looks like this issue is resolved. I will go ahead and close it now. If you think there is anything we left out, reopen and we can address. Thanks for being part of this great community.

<!-- gh-comment-id:1839637603 --> @technovangelist commented on GitHub (Dec 4, 2023): It looks like this issue is resolved. I will go ahead and close it now. If you think there is anything we left out, reopen and we can address. Thanks for being part of this great community.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#429