ollama: cerrar exposición pública y activar la iGPU vía device plugin
- Ingress con forward-auth de Authentik (la API estaba abierta a internet) - generic-device-plugin entrega card0+renderD128 como squat.ai/gpu con el cgroup de dispositivos bien configurado — lo que el hostPath nunca dio - fuera los 3 hostPath de dispositivos (ya no hacen falta) - OLLAMA_NUM_CTX→OLLAMA_CONTEXT_LENGTH (la real); fuera OLLAMA_METRICS (no existe) Sonda temporal confirmó: con cgroup, Vulkan enumera la Radeon 780M (17 GiB). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
# generic-device-plugin (squat.ai) — da acceso REAL a la iGPU sin privileged.
|
||||
#
|
||||
# El porqué: montar /dev/dri por hostPath hace visible el dispositivo pero NO
|
||||
# concede acceso en el cgroup de dispositivos (open() = EPERM aunque seas root).
|
||||
# Un device plugin es el único camino sano: kubelet reserva el recurso
|
||||
# (squat.ai/gpu), monta los nodos de dispositivo Y configura el cgroup.
|
||||
# Diagnosticado el 2026-07-22; sonda privileged temporal confirmó que con
|
||||
# acceso al cgroup, Vulkan enumera la Radeon 780M (17 GiB VRAM+GTT).
|
||||
#
|
||||
# El DaemonSet corre privileged, pero es un componente de infraestructura sin
|
||||
# Service ni Ingress — no es comparable a exponer ollama privileged.
|
||||
# Imagen fijada por digest (no hay tags de versión en este proyecto).
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: generic-device-plugin
|
||||
namespace: ollama
|
||||
labels:
|
||||
app: generic-device-plugin
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: generic-device-plugin
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: generic-device-plugin
|
||||
spec:
|
||||
# Solo en el nodo con la iGPU (la 780M está en chemavx-k8).
|
||||
nodeSelector:
|
||||
kubernetes.io/hostname: chemavx-k8
|
||||
priorityClassName: system-node-critical
|
||||
tolerations:
|
||||
- operator: Exists
|
||||
containers:
|
||||
- name: generic-device-plugin
|
||||
image: ghcr.io/squat/generic-device-plugin@sha256:dc192e164c69b03f156765793a1be62ca437709ae477b27ca7d8f3dcf5021576
|
||||
args:
|
||||
- --log-level=info
|
||||
# Un único recurso "gpu" que entrega los dos nodos DRM juntos.
|
||||
- --device
|
||||
- |
|
||||
name: gpu
|
||||
groups:
|
||||
- paths:
|
||||
- path: /dev/dri/card0
|
||||
- path: /dev/dri/renderD128
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 16Mi
|
||||
limits:
|
||||
cpu: 50m
|
||||
memory: 32Mi
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- name: device-plugin
|
||||
mountPath: /var/lib/kubelet/device-plugins
|
||||
- name: dev
|
||||
mountPath: /dev
|
||||
volumes:
|
||||
- name: device-plugin
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/device-plugins
|
||||
- name: dev
|
||||
hostPath:
|
||||
path: /dev
|
||||
Reference in New Issue
Block a user